Aspose.Tasks for C++
Not.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="Not.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/details/pointer_collection_helpers.h>
9 #include <cstdint>
10 
11 #include "aspose.tasks.cpp/Util/ICondition.h"
12 
13 namespace Aspose {
14 
15 namespace Tasks {
16 
17 namespace Util {
18 
19 /// <summary>
20 /// Applies logical NOT to the specified condition.
21 /// </summary>
22 /// <typeparam name="T">The type of object to apply method interface to.</typeparam>
23 template<typename T>
25 {
26  typedef Not<T> ThisType;
27  typedef Aspose::Tasks::Util::ICondition<T> BaseType;
28 
29  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
30  RTTI_INFO_TEMPLATE_CLASS(ThisType, ThisTypeBaseTypesInfo);
31 
32  template<typename FT0> friend class Aspose::Tasks::Util::Not;
33 
34 public:
35 
36  /// <summary>
37  /// Initializes a new instance of the <see cref="Not{T}"></see> class.
38  /// </summary>
39  /// <param name="condition">Specified condition.</param>
40  Not(const System::SharedPtr<ICondition<T>>& condition)
41  {
42  this->condition = condition;
43  }
44 
45  /// <summary>
46  /// Returns true if the specified object satisfy the condition.
47  /// </summary>
48  /// <param name="el">The object to check.</param>
49  /// <returns>True if the object satisfy the condition.</returns>
50  bool Check(const T& el) override
51  {
52  return !this->condition->Check(el);
53  }
54 
55  void SetTemplateWeakPtr(uint32_t argument) override
56  {
57  switch (argument)
58  {
59  case 0:
60  System::Details::CollectionHelpers::SetWeakPointer(0, condition);
61  break;
62 
63  }
64  }
65 
66 protected:
67 
68  #ifdef ASPOSE_GET_SHARED_MEMBERS
69  void GetSharedMembers(System::Object::shared_members_type& result) const override
70  {
71  System::Object::GetSharedMembers(result);
72 
73  result.Add("Aspose::Tasks::Util::Not::condition", this->condition);
74  }
75  #endif
76 
77 
78 
79 private:
80 
81  System::SharedPtr<ICondition<T>> condition;
82 
83 };
84 
85 } // namespace Util
86 } // namespace Tasks
87 } // namespace Aspose
88 
89 
Represents a condition which can be used by filters or search methods.
Definition: ICondition.h:22
Applies logical NOT to the specified condition.
Definition: Not.h:25
Not(const System::SharedPtr< ICondition< T >> &condition)
Initializes a new instance of the Not<T> class.
Definition: Not.h:40
bool Check(const T &el) override
Returns true if the specified object satisfy the condition.
Definition: Not.h:50
Definition: Asn.h:13