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