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