Aspose.Tasks for C++
EntityPropertyItem.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="EntityProperty.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/object_ext.h>
9 #include <system/make_const_ref.h>
10 #include <system/details/pointer_collection_helpers.h>
11 #include <cstdint>
12 
13 #include "aspose.tasks.cpp/Item.h"
14 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
15 
16 namespace Aspose {
17 
18 namespace Tasks {
19 
20 /// <summary>
21 /// Represents an entity item (property of container class).
22 /// <remarks>This object is a wrapper for a value or reference type.</remarks>
23 /// </summary>
24 template<typename T>
25 class ASPOSE_TASKS_SHARED_CLASS EntityProperty final : public Aspose::Tasks::Item
26 {
29 
30  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
31  RTTI_INFO_TEMPLATE_CLASS(ThisType, ThisTypeBaseTypesInfo);
32 
33  template<typename FT0> friend class Aspose::Tasks::EntityProperty;
34 
35 public:
36 
37  /// <summary>
38  /// Gets the item value.
39  /// </summary>
40  System::MakeConstRef_t<T> get_Val() const
41  {
42  return pr_Val;
43  }
44 
45  EntityProperty() : pr_Val(T())
46  {
47  }
48 
49  /// <summary>
50  /// Initializes a new instance of the <see cref="EntityProperty{T}"></see> class.
51  /// </summary>
52  /// <param name="val">
53  /// Value for this item.
54  /// </param>
55  EntityProperty(T val) : pr_Val(T())
56  {
57  this->set_Val(val);
58  }
59 
60  void UpdateValue(const T& val)
61  {
62  this->set_Val(val);
63  }
64 
65  System::SharedPtr<Item> Clone() override
66  {
67  return System::ExplicitCast<Aspose::Tasks::Item>(System::MemberwiseClone(this));
68  }
69 
70  System::String ToString() const override
71  {
72  // dummy for unimportant method
73  return System::String::Empty;
74  }
75 
76  void SetTemplateWeakPtr(uint32_t argument) override
77  {
78  switch (argument)
79  {
80  case 0:
81  break;
82 
83  }
84  }
85 
86 protected:
87 
88  #ifdef ASPOSE_GET_SHARED_MEMBERS
89  void GetSharedMembers(System::Object::shared_members_type& result) const override
90  {
91  Aspose::Tasks::Item::GetSharedMembers(result);
92 
93  result.Add("Aspose::Tasks::EntityProperty::pr_Val", this->pr_Val);
94  }
95  #endif
96 
97 
98 
99 private:
100 
101  typename System::WeakPtrFromTypeParameter<T>::type pr_Val;
102 
103  /// <summary>
104  /// Gets the item value.
105  /// </summary>
106  void set_Val(T value)
107  {
108  pr_Val = value;
109  }
110 
111 
112 };
113 
114 } // namespace Tasks
115 } // namespace Aspose
116 
117 
Represents an item which contains a value of any type and invokes Get/Set Actions.
Definition: Item.h:19
System::MakeConstRef_t< T > get_Val() const
Gets the item value.
Definition: EntityPropertyItem.h:40
EntityProperty(T val)
Initializes a new instance of the EntityProperty{T} class.
Definition: EntityPropertyItem.h:55
Represents an entity item (property of container class).
Definition: EntityPropertyItem.h:25