Aspose.Tasks for C++
TimephasedData.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="TimephasedData.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/timespan.h>
9 #include <system/object.h>
10 #include <system/date_time.h>
11 #include <cstdint>
12 
13 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
14 
15 namespace Aspose
16 {
17 namespace Tasks
18 {
19 class BaselineTimephasedDataMaker;
20 namespace Calculations
21 {
22 class ResourceAssignmentCalculator;
23 class ResourceAssignmentRateByDateEnumerator;
24 class ResourceAssignmentWorkCalculator;
25 class TimephasedDataCalculator;
26 class TimephasedIterator;
27 class TimeScaledCalculator;
28 } // namespace Calculations
29 namespace IO
30 {
31 namespace MSProject
32 {
33 class MPP14ResourceAssignmentWriter;
34 class MPP9ResourceAssignmentReader;
35 class MppTimephasedDataWriter;
36 } // namespace MSProject
37 namespace Xml
38 {
39 class TimephasedDataNodeReader;
40 } // namespace Xml
41 } // namespace IO
42 namespace Recalculation
43 {
44 class TaskSplitCalculator;
45 } // namespace Recalculation
46 class Resource;
47 class ResourceAssignment;
48 class ResourceAssignmentTimephasedDataCollection;
49 class SplitsCalculator;
50 class Task;
51 class TaskPlanner;
52 class TimephasedDataCalculationUtil;
53 class TimephasedDataCollection;
54 class TimephasedDataMaker;
55 enum class TimephasedDataType : int8_t;
56 class TimephasedWorkCostSelector;
57 enum class TimeUnitType : int8_t;
58 namespace Visualization
59 {
60 class UsageCostCell;
61 class UsageWorkCell;
62 } // namespace Visualization
63 } // namespace Tasks
64 } // namespace Aspose
65 namespace System
66 {
67 class String;
68 } // namespace System
69 
70 namespace Aspose {
71 
72 namespace Tasks {
73 
74 /// <summary>
75 /// Represents a time phased data.
76 /// </summary>
77 class ASPOSE_TASKS_SHARED_CLASS TimephasedData : public System::Object
78 {
79  typedef TimephasedData ThisType;
80  typedef System::Object BaseType;
81 
82  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
83  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
84 
85  friend class Aspose::Tasks::Calculations::TimephasedIterator;
86  friend class Aspose::Tasks::Calculations::TimeScaledCalculator;
87  friend class Aspose::Tasks::Calculations::ResourceAssignmentRateByDateEnumerator;
88  friend class Aspose::Tasks::Calculations::ResourceAssignmentCalculator;
89  friend class Aspose::Tasks::Calculations::ResourceAssignmentWorkCalculator;
90  friend class Aspose::Tasks::Calculations::TimephasedDataCalculator;
91  friend class Aspose::Tasks::Resource;
93  friend class Aspose::Tasks::Task;
94  friend class Aspose::Tasks::BaselineTimephasedDataMaker;
95  friend class Aspose::Tasks::TimephasedDataCalculationUtil;
96  friend class Aspose::Tasks::IO::MSProject::MPP9ResourceAssignmentReader;
97  friend class Aspose::Tasks::IO::MSProject::MPP14ResourceAssignmentWriter;
98  friend class Aspose::Tasks::IO::MSProject::MppTimephasedDataWriter;
99  friend class Aspose::Tasks::IO::Xml::TimephasedDataNodeReader;
100  friend class Aspose::Tasks::SplitsCalculator;
101  friend class Aspose::Tasks::Recalculation::TaskSplitCalculator;
102  friend class Aspose::Tasks::ResourceAssignmentTimephasedDataCollection;
104  friend class Aspose::Tasks::TimephasedDataMaker;
105  friend class Aspose::Tasks::TimephasedWorkCostSelector;
106  friend class Aspose::Tasks::Visualization::UsageCostCell;
107  friend class Aspose::Tasks::Visualization::UsageWorkCell;
108  friend class Aspose::Tasks::TaskPlanner;
109 
110 public:
111 
112  /// <summary>
113  /// Gets <see cref="double"></see> instance which represents string value of this object for unit-based time phased data.
114  /// </summary>
115  /// <returns>a floating point representation of this object.</returns>
116  ASPOSE_TASKS_SHARED_API double get_ValueToUnits();
117  /// <summary>
118  /// Gets the unique identifier of a time phased data
119  /// </summary>
120  ASPOSE_TASKS_SHARED_API int32_t get_Uid() const;
121  /// <summary>
122  /// Sets the unique identifier of a time phased data
123  /// </summary>
124  ASPOSE_TASKS_SHARED_API void set_Uid(int32_t value);
125  /// <summary>
126  /// Gets the start date of a time phased data period.
127  /// </summary>
128  ASPOSE_TASKS_SHARED_API System::DateTime get_Start() const;
129  /// <summary>
130  /// Sets the start date of a time phased data period.
131  /// </summary>
132  ASPOSE_TASKS_SHARED_API void set_Start(System::DateTime value);
133  /// <summary>
134  /// Gets the finish date of a time phased data period.
135  /// </summary>
136  ASPOSE_TASKS_SHARED_API System::DateTime get_Finish() const;
137  /// <summary>
138  /// Sets the finish date of a time phased data period.
139  /// </summary>
140  ASPOSE_TASKS_SHARED_API void set_Finish(System::DateTime value);
141  /// <summary>
142  /// Gets the time unit of a time phased data period.
143  /// </summary>
144  ASPOSE_TASKS_SHARED_API TimeUnitType get_Unit() const;
145  /// <summary>
146  /// Sets the time unit of a time phased data period.
147  /// </summary>
148  ASPOSE_TASKS_SHARED_API void set_Unit(TimeUnitType value);
149  /// <summary>
150  /// Gets the type of a time phased data.
151  /// </summary>
152  /// <remarks> <see cref="Value"></see> property will be cleared, if it is not suitable for type, specified here. </remarks>
153  ASPOSE_TASKS_SHARED_API Aspose::Tasks::TimephasedDataType get_TimephasedDataType() const;
154  /// <summary>
155  /// Sets the type of a time phased data.
156  /// </summary>
157  /// <remarks> <see cref="Value"></see> property will be cleared, if it is not suitable for type, specified here. </remarks>
158  ASPOSE_TASKS_SHARED_API void set_TimephasedDataType(Aspose::Tasks::TimephasedDataType value);
159  /// <summary>
160  /// Gets the value per unit of time for a time phased data period.
161  /// </summary>
162  /// <exception cref="TasksException"> When value is incorrect for specified <see cref="TimephasedDataType"></see> or have negative value.</exception>
163  ASPOSE_TASKS_SHARED_API System::String get_Value();
164  /// <summary>
165  /// Sets the value per unit of time for a time phased data period.
166  /// </summary>
167  /// <exception cref="TasksException"> When value is incorrect for specified <see cref="TimephasedDataType"></see> or have negative value.</exception>
168  ASPOSE_TASKS_SHARED_API void set_Value(const System::String& value);
169  /// <summary>
170  /// Gets <see cref="TimeSpan"></see> instance which represents string value of this object.
171  /// </summary>
172  /// <returns>a time span representation of the object.</returns>
173  ASPOSE_TASKS_SHARED_API System::TimeSpan get_ValueToDuration() const;
174  /// <summary>
175  /// Gets <see cref="double"></see> instance which represents string value of this object.
176  /// </summary>
177  /// <returns>a floating point representation of the object.</returns>
178  ASPOSE_TASKS_SHARED_API double get_ValueToCost();
179  /// <summary>
180  /// Gets <see cref="double"></see> instance which represents string value of this object.
181  /// </summary>
182  /// <param name="value">a floating point representation of the object.</param>
183  ASPOSE_TASKS_SHARED_API void set_ValueToCost(double value);
184 
185  /// <summary>
186  /// Initializes a new instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class.
187  /// </summary>
188  ASPOSE_TASKS_SHARED_API TimephasedData();
189 
190  /// <summary>
191  /// Creates and initializes a new instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for work-based time phased data.
192  /// </summary>
193  /// <param name="uid"> UID of the task. </param>
194  /// <param name="start"> start date-time. </param>
195  /// <param name="finish"> Finish date-time. </param>
196  /// <param name="value"> Timespan value. </param>
197  /// <param name="timeUnit"> Time unit type. </param>
198  /// <param name="type"> Time-phased data type. </param>
199  /// <returns>A instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for work-based time phased data.</returns>
200  /// <exception cref="ArgumentException">If negative work value was specified.</exception>
201  static ASPOSE_TASKS_SHARED_API System::SharedPtr<TimephasedData> CreateWorkTimephased(int32_t uid, System::DateTime start, System::DateTime finish, System::TimeSpan value, TimeUnitType timeUnit, Aspose::Tasks::TimephasedDataType type);
202  /// <summary>
203  /// Creates and initializes a new instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for cost-based time phased data.
204  /// </summary>
205  /// <param name="uid"> UID of the task. </param>
206  /// <param name="start"> start date-time. </param>
207  /// <param name="finish"> Finish date-time. </param>
208  /// <param name="value"> Cost value. </param>
209  /// <param name="timeUnit"> Time unit type. </param>
210  /// <param name="type"> Time-phased data type. </param>
211  /// <returns>A instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for cost-based time phased data.</returns>
212  /// <exception cref="ArgumentException">If negative cost value was specified.</exception>
213  static ASPOSE_TASKS_SHARED_API System::SharedPtr<TimephasedData> CreateCostTimephased(int32_t uid, System::DateTime start, System::DateTime finish, double value, TimeUnitType timeUnit, Aspose::Tasks::TimephasedDataType type);
214  /// <summary>
215  /// Creates and initializes a new instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for cost-based time phased data.
216  /// </summary>
217  /// <param name="uid"> UID of the task. </param>
218  /// <param name="start"> start date-time. </param>
219  /// <param name="finish"> Finish date-time. </param>
220  /// <param name="value"> Cost value. </param>
221  /// <param name="type"> Time-phased data type. </param>
222  /// <returns>A instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for cost-based time phased data.</returns>
223  /// <exception cref="ArgumentException">If negative cost value was specified.</exception>
224  static ASPOSE_TASKS_SHARED_API System::SharedPtr<TimephasedData> CreateCostTimephased(int32_t uid, System::DateTime start, System::DateTime finish, double value, Aspose::Tasks::TimephasedDataType type);
225  /// <summary>
226  /// Creates and initializes a new instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for unit-based time phased data of an assignment of a material resource.
227  /// </summary>
228  /// <param name="uid"> UID of the task. </param>
229  /// <param name="start"> Start date-time. </param>
230  /// <param name="finish"> Finish date-time. </param>
231  /// <param name="units"> Number of units. </param>
232  /// <param name="type"> Time-phased data type. </param>
233  /// <returns>A instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for cost-based time phased data.</returns>
234  /// <exception cref="ArgumentException">If negative amount of units was specified.</exception>
235  static ASPOSE_TASKS_SHARED_API System::SharedPtr<TimephasedData> CreateUnitTimephased(int32_t uid, System::DateTime start, System::DateTime finish, double units, Aspose::Tasks::TimephasedDataType type);
236 
237 protected:
238 
239  /// <summary>
240  /// Gets <see cref="TimeSpan"></see> instance which represents string value of this object.
241  /// </summary>
242  /// <param name="value">a time span representation of the object.</param>
243  ASPOSE_TASKS_SHARED_API void set_ValueToDuration(System::TimeSpan value);
244  /// <summary>
245  /// Gets a value indicating whether this instance is custom user time phase data instance.
246  /// </summary>
247  ASPOSE_TASKS_SHARED_API bool get_IsCustom() const;
248  /// <summary>
249  /// Sets a value indicating whether this instance is custom user time phase data instance.
250  /// </summary>
251  ASPOSE_TASKS_SHARED_API void set_IsCustom(bool value);
252  ASPOSE_TASKS_SHARED_API const System::SharedPtr<TimephasedDataCollection>& get_Parent() const;
253  ASPOSE_TASKS_SHARED_API void set_Parent(const System::SharedPtr<TimephasedDataCollection>& value);
254  ASPOSE_TASKS_SHARED_API bool get_IsEmptyValue();
255 
256  ASPOSE_TASKS_SHARED_API TimephasedData(int32_t uid, Aspose::Tasks::TimephasedDataType type, const System::SharedPtr<TimephasedData>& originalTd);
257 
258  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(TimephasedData, CODEPORTING_ARGS(int32_t uid, Aspose::Tasks::TimephasedDataType type, const System::SharedPtr<TimephasedData>& originalTd));
259 
260  /// <summary>
261  /// Initializes a new instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for work-based time phased data.
262  /// </summary>
263  /// <param name="uid"> UID of the task. </param>
264  /// <param name="start"> start date-time. </param>
265  /// <param name="finish"> Finish date-time. </param>
266  /// <param name="value"> Timespan value. </param>
267  /// <param name="timeUnit"> Time unit type. </param>
268  /// <param name="type"> Time-phased data type. </param>
269  ASPOSE_TASKS_SHARED_API TimephasedData(int32_t uid, System::DateTime start, System::DateTime finish, System::TimeSpan value, TimeUnitType timeUnit, Aspose::Tasks::TimephasedDataType type);
270 
271  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(TimephasedData, CODEPORTING_ARGS(int32_t uid, System::DateTime start, System::DateTime finish, System::TimeSpan value, TimeUnitType timeUnit, Aspose::Tasks::TimephasedDataType type));
272 
273  /// <summary>
274  /// Initializes a new instance of the <see cref="Aspose::Tasks::TimephasedData"></see> class for cost-based time phased data.
275  /// </summary>
276  /// <param name="uid"> UID of the task. </param>
277  /// <param name="start"> start date-time. </param>
278  /// <param name="finish"> Finish date-time. </param>
279  /// <param name="value"> Cost value. </param>
280  /// <param name="timeUnit"> Time unit type. </param>
281  /// <param name="type"> Time-phased data type. </param>
282  ASPOSE_TASKS_SHARED_API TimephasedData(int32_t uid, System::DateTime start, System::DateTime finish, double value, TimeUnitType timeUnit, Aspose::Tasks::TimephasedDataType type);
283 
284  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(TimephasedData, CODEPORTING_ARGS(int32_t uid, System::DateTime start, System::DateTime finish, double value, TimeUnitType timeUnit, Aspose::Tasks::TimephasedDataType type));
285  static ASPOSE_TASKS_SHARED_API System::SharedPtr<TimephasedData> ChangeType(const System::SharedPtr<TimephasedData>& timephasedDataItem, Aspose::Tasks::TimephasedDataType type);
286  static ASPOSE_TASKS_SHARED_API System::SharedPtr<TimephasedData> ChangeValue(const System::SharedPtr<TimephasedData>& timephasedDataItem, System::TimeSpan newValue);
287  #ifdef ASPOSE_GET_SHARED_MEMBERS
288  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
289  #endif
290 
291 
292 private:
293 
294  Aspose::Tasks::TimephasedDataType timephasedDataType;
295  System::TimeSpan durationValue;
296  System::DateTime start;
297  System::DateTime finish;
298  int32_t pr_Uid;
299  TimeUnitType pr_Unit;
300  bool pr_IsCustom;
301  System::WeakPtr<TimephasedDataCollection> pr_Parent;
302 
303  System::String get_DebuggerDisplay();
304 
305  void OnChange();
306 
307 };
308 
309 } // namespace Tasks
310 } // namespace Aspose
311 
312 
Represents a collection of TimephasedData objects.
Definition: TimephasedDataCollection.h:90
Represents a task in a project.
Definition: Task.h:383
Represents a time phased data.
Definition: TimephasedData.h:77
Represents a resource assignment in a project.
Definition: ResourceAssignment.h:221
Represents a resource in a project.
Definition: Resource.h:206