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
12 changes: 6 additions & 6 deletions cpp/Platform.Interfaces.Tests/Platform.Interfaces.Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ namespace Platform::Interfaces::Tests {
}
}

TEST(CompileTests, CriterionMatcher) {
struct EmptyCriterionMatcher : public ICriterionMatcher<int> {
TEST(CompileTests, Matcher) {
struct EmptyMatcher : public IMatcher<int> {
bool IsMatched(int) { return {}; }
};
static_assert(CCriterionMatcher<EmptyCriterionMatcher, int>);
static_assert(CMatcher<EmptyMatcher, int>);

{
CCriterionMatcher<int> auto criterionMatcher = EmptyCriterionMatcher{};
CMatcher<int> auto matcher = EmptyMatcher{};

ASSERT_TRUE((CCriterionMatcher<EmptyCriterionMatcher, int>));
ASSERT_TRUE((CCriterionMatcher<EmptyCriterionMatcher, float>));
ASSERT_TRUE((CMatcher<EmptyMatcher, int>));
ASSERT_TRUE((CMatcher<EmptyMatcher, float>));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

namespace Platform::Interfaces {
template <typename...>
struct ICriterionMatcher;
struct IMatcher;

template <typename TArgument>
struct ICriterionMatcher<TArgument> {
struct IMatcher<TArgument> {
virtual bool IsMatched(TArgument argument) = 0;

virtual ~ICriterionMatcher() = default;
virtual ~IMatcher() = default;
};
} // namespace Platform::Interfaces
4 changes: 2 additions & 2 deletions cpp/Platform.Interfaces/Platform.Interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "CSet.h"
#include "CDictionary.h"
#include "CCounter.h"
#include "CCriterionMatcher.h"
#include "CMatcher.h"
#include "CFactory.h"
#include "CProperties.h"
#include "CProvider.h"
Expand All @@ -17,7 +17,7 @@

#include "ICounter[TResult, TArgument].h"
#include "ICounter[TResult].h"
#include "ICriterionMatcher.h"
#include "IMatcher.h"
#include "IFactory.h"
#include "IProperties.h"
#include "IProperty.h"
Expand Down
2 changes: 1 addition & 1 deletion csharp/Platform.Interfaces.Tests/InterfacesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static void BuildTest()
{
ICounter<int, int> c1 = null;
ICounter<int> c2 = null;
ICriterionMatcher<int> cm1 = null;
IMatcher<int> cm1 = null;
IFactory<int> f1 = null;
IProperties<int, int, int> p1 = null;
IProperty<int, int> p2 = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
namespace Platform.Interfaces
{
/// <summary>
/// <para>Defines a criterion matcher, that contains a specific method for determining whether the argument matches the criterion or not.</para>
/// <para>Определяет объект который проверяет соответствие критерию и содержит конкретный метод для определения, соответствует ли аргумент критерию или нет.</para>
/// <para>Defines a matcher that contains a specific method for determining whether the argument matches or not.</para>
/// <para>Определяет объект который проверяет соответствие и содержит конкретный метод для определения, соответствует ли аргумент или нет.</para>
/// </summary>
/// <typeparam name="TArgument">
/// <para>Argument type.</para>
/// <para>Тип аргумента.</para>
/// </typeparam>
public interface ICriterionMatcher<in TArgument>
public interface IMatcher<in TArgument>
{
/// <summary>
/// <para>Determines whether the argument matches the criterion.</para>
/// <para>Определяет, соответствует ли аргумент критерию.</para>
/// <para>Determines whether the argument matches.</para>
/// <para>Определяет, соответствует ли аргумент.</para>
/// </summary>
/// <param name="argument">
/// <para>The argument.</para>
/// <para>Аргумент.</para>
/// </param>
/// <returns>
/// <para>A value that determines whether the argument matches the criterion.</para>
/// <para>Значение, определяющие соответствует ли аргумент критерию.</para>
/// <para>A value that determines whether the argument matches.</para>
/// <para>Значение, определяющие соответствует ли аргумент.</para>
/// </returns>
bool IsMatched(TArgument argument);
}
Expand Down
Loading