Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
main:
uses: linksplatform/Workflows/.github/workflows/deploy-cpp.yml@main
with:
recipe_folder: "platform.interfaces"
recipe_folder: "platform.abstractions"
secrets:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
4 changes: 2 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ tasks:
- name: Setup .NET Environment
init: |
cd csharp
dotnet restore Platform.Interfaces.sln
dotnet build Platform.Interfaces.sln
dotnet restore Platform.Abstractions.sln
dotnet build Platform.Abstractions.sln
command: echo ".NET 8 SDK is ready for development"
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[![Gitpod](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/linksplatform/Interfaces)
[![Gitpod](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/linksplatform/Abstractions)

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/93857535a2214ba9b512e1a88787d461)](https://app.codacy.com/gh/linksplatform/Interfaces?utm_source=github.com&utm_medium=referral&utm_content=linksplatform/Interfaces&utm_campaign=Badge_Grade_Settings)
[![CodeFactor](https://www.codefactor.io/repository/github/linksplatform/interfaces/badge)](https://www.codefactor.io/repository/github/linksplatform/interfaces)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/93857535a2214ba9b512e1a88787d461)](https://app.codacy.com/gh/linksplatform/Abstractions?utm_source=github.com&utm_medium=referral&utm_content=linksplatform/Abstractions&utm_campaign=Badge_Grade_Settings)
[![CodeFactor](https://www.codefactor.io/repository/github/linksplatform/abstractions/badge)](https://www.codefactor.io/repository/github/linksplatform/abstractions)

| [![Actions Status](https://github.com/linksplatform/Interfaces/workflows/deploy-cpp/badge.svg)](https://github.com/linksplatform/Interfaces/actions?workflow=deploy-cpp) | [![NuGet Version and Downloads count](https://img.shields.io/nuget/v/Platform.Interfaces.TemplateLibrary?label=nuget&style=flat)](https://www.nuget.org/packages/Platform.Interfaces.TemplateLibrary) [![ConanCenter package](https://repology.org/badge/version-for-repo/conancenter/platform.interfaces.svg)](https://conan.io/center/platform.interfaces) | __C++__ |
| [![Actions Status](https://github.com/linksplatform/Abstractions/workflows/deploy-cpp/badge.svg)](https://github.com/linksplatform/Abstractions/actions?workflow=deploy-cpp) | [![NuGet Version and Downloads count](https://img.shields.io/nuget/v/Platform.Abstractions.TemplateLibrary?label=nuget&style=flat)](https://www.nuget.org/packages/Platform.Abstractions.TemplateLibrary) [![ConanCenter package](https://repology.org/badge/version-for-repo/conancenter/platform.interfaces.svg)](https://conan.io/center/platform.interfaces) | __C++__ |
|-|-|-|
| [![Actions Status](https://github.com/linksplatform/Interfaces/workflows/csharp/badge.svg)](https://github.com/linksplatform/Interfaces/actions?workflow=csharp) | [![NuGet Version and Downloads count](https://img.shields.io/nuget/v/Platform.Interfaces?label=nuget&style=flat)](https://www.nuget.org/packages/Platform.Interfaces) | C# |
| [![Actions Status](https://github.com/linksplatform/Abstractions/workflows/csharp/badge.svg)](https://github.com/linksplatform/Abstractions/actions?workflow=csharp) | [![NuGet Version and Downloads count](https://img.shields.io/nuget/v/Platform.Abstractions?label=nuget&style=flat)](https://www.nuget.org/packages/Platform.Abstractions) | C# |

# [Interfaces](https://github.com/linksplatform/Interfaces)
# [Abstractions](https://github.com/linksplatform/Abstractions)

LinksPlatform's Platform.Interfaces Class Library
LinksPlatform's Platform.Abstractions Class Library

Contains common interfaces that did not fit in any major category.

Namespace: [Platform.Interfaces](https://linksplatform.github.io/Interfaces/csharp/api/Platform.Interfaces.html)
Namespace: [Platform.Abstractions](https://linksplatform.github.io/Abstractions/csharp/api/Platform.Abstractions.html)

Forked from: [Konard/LinksPlatform/Platform/Platform.Helpers](https://github.com/Konard/LinksPlatform/tree/657ea248b32dc31d0793ae9a9e4989ec6ee61d5e/Platform/Platform.Helpers)

NuGet package: [Platform.Interfaces](https://www.nuget.org/packages/Platform.Interfaces)
NuGet package: [Platform.Abstractions](https://www.nuget.org/packages/Platform.Abstractions)

## [Documentation](https://linksplatform.github.io/Interfaces)
* Interface [IFactory\<TProduct\>](https://linksplatform.github.io/Interfaces/csharp/api/Platform.Interfaces.IFactory-1.html).
## [Documentation](https://linksplatform.github.io/Abstractions)
* Interface [IFactory\<TProduct\>](https://linksplatform.github.io/Abstractions/csharp/api/Platform.Abstractions.IFactory-1.html).

[PDF file](https://linksplatform.github.io/Interfaces/csharp/Platform.Interfaces.pdf) with code for e-readers.
[PDF file](https://linksplatform.github.io/Abstractions/csharp/Platform.Abstractions.pdf) with code for e-readers.

## Dependent libraries
* [Platform.Collections](https://github.com/linksplatform/Collections)
Expand Down
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(LINKS_PLATFORM_EXTRA_FLAGS "" CACHE STRING "Extra compiler flags")
set(CONAN_DISABLE_CHECK_COMPILER TRUE)
set(LINKS_PLATFORM_TESTS TRUE)

project(Platform.Interfaces CXX)
project(Platform.Abstractions CXX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
find_package(GTest)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{8D50757E-6191-4D9D-8B9D-263BC187E785}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>PlatformInterfacesTemplateLibraryTests</RootNamespace>
<RootNamespace>PlatformAbstractionsTemplateLibraryTests</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectSubType>NativeUnitTestProject</ProjectSubType>
</PropertyGroup>
Expand Down Expand Up @@ -93,7 +93,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\Platform.Interfaces;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Platform.Abstractions;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand All @@ -110,7 +110,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\Platform.Interfaces;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Platform.Abstractions;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand All @@ -129,7 +129,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\Platform.Interfaces;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Platform.Abstractions;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand All @@ -150,7 +150,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\Platform.Interfaces;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Platform.Abstractions;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <Platform.Interfaces.h>
#include <Platform.Abstractions.h>
#include <gtest/gtest.h>

namespace Platform::Interfaces::Tests {
namespace Platform::Abstractions::Tests {
TEST(CompileTests, Counter) {
struct EmptyCounter1 : ICounter<int> {
int Count() { return {}; }
Expand Down Expand Up @@ -140,4 +140,4 @@ namespace Platform::Interfaces::Tests {
ASSERT_TRUE((CSetter<EmptyProperty, int, int&>));
}
}
} // namespace Platform::Interfaces::Tests
} // namespace Platform::Abstractions::Tests
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

// add headers that you want to pre-compile here

#include <Platform.Interfaces.h>
#include <Platform.Abstractions.h>

#endif // PCH_H
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "CEnumerable.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
namespace Internal {
template <typename TSelf, typename... TItems>
consteval bool CArrayHelpFunction() {
Expand All @@ -34,4 +34,4 @@ namespace Platform::Interfaces {

template <CArray TSelf>
struct Array : Enumerable<TSelf> {};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <concepts>

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TSelf, typename TResult, typename... TArgument>
concept CCounter = sizeof...(TArgument) <= 1 && requires(TSelf self, TArgument... argument) {
{ self.Count(argument...) } -> std::same_as<TResult>;
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <concepts>

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TSelf, typename TArgument>
concept CCriterionMatcher = requires(TSelf self, TArgument argument) {
{ self.IsMatched(argument) } -> std::same_as<bool>;
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "CEnumerable.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
namespace Internal {
template <typename TRawSelf, typename... TArgs>
consteval bool CDictionaryHelpFunction() {
Expand Down Expand Up @@ -75,4 +75,4 @@ namespace Platform::Interfaces {
using Key = decltype(std::get<0>(std::declval<base::Item>()));
using Value = decltype(std::get<1>(std::declval<base::Item>()));
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <ranges>

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TSelf>
concept CEnumerable = std::ranges::range<TSelf>;

Expand All @@ -12,4 +12,4 @@ namespace Platform::Interfaces {
using ItemReference = std::ranges::range_reference_t<TSelf>;
using Iter = std::ranges::iterator_t<TSelf>;
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <concepts>

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TSelf, typename TProduct>
concept CFactory = requires(TSelf self) {
{ self.Create() } -> std::same_as<TProduct>;
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <concepts>
#include <type_traits>

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename T>
concept CLinkAddress = std::is_integral<T>::value && std::is_unsigned<T>::value;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "CArray.h"
#include "CEnumerable.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
namespace Internal {
template <typename TRawSelf, typename... TItems>
consteval bool CListHelpFunction() {
Expand Down Expand Up @@ -43,4 +43,4 @@ namespace Platform::Interfaces {

template <CList TSelf>
struct List : Enumerable<TSelf> {};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include <concepts>

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TSelf, typename TObject, typename TProperty, typename TValue>
concept CProperties = requires(TSelf self, TObject object, TProperty property, TValue value) {
{ self.GetValue(object, property) } -> std::same_as<TValue>;

{ self.SetValue(object, property, value) } -> std::same_as<void>;
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "CProvider.h"
#include "CSetter.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TSelf, typename TObject, typename TValue>
concept CProperty = CSetter<TSelf, TValue, TObject> && CProvider<TSelf, TValue, TObject>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <concepts>

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TSelf, typename TProvider, typename... TArgument>
concept CProvider = sizeof...(TArgument) <= 1 && requires(TSelf self, TArgument... argument) {
{ self.Get(argument...) } -> std::same_as<TProvider>;
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "CEnumerable.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
namespace Internal {
template <typename TRawSelf, typename... TItems>
consteval bool CSetHelpFunction() {
Expand Down Expand Up @@ -50,4 +50,4 @@ namespace Platform::Interfaces {

template <CSet TSelf>
struct Set : Enumerable<TSelf> {};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <concepts>

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TSelf, typename TValue, typename... TArgument>
concept CSetter = sizeof...(TArgument) <= 1 && requires(TSelf self, TArgument... argument, TValue value) {
{ self.Set(argument..., value) } -> std::same_as<void>;
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include "Macros.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TDecorated, template <typename, typename> typename TFirstDecorator, template <typename, typename> typename... TDecorators>
struct Decorated : public DecoratedBase<Decorated<TDecorated, TFirstDecorator, TDecorators...>, TDecorated, TFirstDecorator, TDecorators...> {
using base = DecoratedBase<Decorated<TDecorated, TFirstDecorator, TDecorators...>, TDecorated, TFirstDecorator, TDecorators...>;

USE_ALL_BASE_CONSTRUCTORS(Decorated, base)
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include "Macros.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TFacade, typename TDecorated, template <typename, typename> typename TFirstDecorator, template <typename, typename> typename... TDecorators>
struct DecoratedBase : public DECORATED_BASE_TYPE(DecoratedBase, TFacade, TDecorated, TFirstDecorator, TDecorators) {
using base = DECORATED_BASE_TYPE(DecoratedBase, TFacade, TDecorated, TFirstDecorator, TDecorators);

USE_ALL_BASE_CONSTRUCTORS(DecoratedBase, base)
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#include "Macros.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TFacade, typename TDecorated>
struct DecoratorBase : public TDecorated {
USE_ALL_BASE_CONSTRUCTORS(DecoratorBase, TDecorated)

THIS_REFERENCE_WRAPPER_METHODS(decorated, TDecorated)
THIS_REFERENCE_WRAPPER_METHODS(facade, TFacade)
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "ExtendedBase.h"
#include "Macros.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TExtendable, template <typename> typename TFirstExtender, template <typename> typename... TExtenders>
class Extended : public EXTENDED_BASE_TYPE(Extended, ExtendedBase, TExtendable, TFirstExtender, TExtenders) {};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include "Macros.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TExtendable>
struct ExtendedBase : public TExtendable {
THIS_REFERENCE_WRAPPER_METHODS(extended, TExtendable)
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "ExtendedContainerBase.h"
#include "Macros.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TExtendable, template <typename> typename TFirstExtender, template <typename> typename... TExtenders>
class ExtendedContainer : public EXTENDED_BASE_TYPE(ExtendedContainer, ExtendedContainerBase, TExtendable, TFirstExtender, TExtenders) {};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "Macros.h"

namespace Platform::Interfaces {
namespace Platform::Abstractions {
template <typename TExtendable>
class ExtendedContainerBase {
public:
Expand All @@ -11,4 +11,4 @@ namespace Platform::Interfaces {
protected:
TExtendable extendable;
};
} // namespace Platform::Interfaces
} // namespace Platform::Abstractions
Loading
Loading