Aspose.Tasks for C++
SplitPartCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="SplitPartCollection.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/date_time.h>
9 #include <system/collections/ilist.h>
10 #include <system/array.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 AutoRecalculationState;
20 class DatesCalculator;
21 class ResourceAssignment;
22 class SplitPart;
23 class SplitsCalculator;
24 class Task;
25 namespace Visualization
26 {
27 class GanttPageTaskGlyphBuilder;
28 } // namespace Visualization
29 } // namespace Tasks
30 } // namespace Aspose
31 namespace System
32 {
33 namespace Collections
34 {
35 namespace Generic
36 {
37 template <typename> class IEnumerable;
38 template <typename> class IEnumerator;
39 } // namespace Generic
40 } // namespace Collections
41 } // namespace System
42 
43 namespace Aspose {
44 
45 namespace Tasks {
46 
47 /// <summary>
48 /// Collection that represents the portions of a task.
49 /// </summary>
50 class ASPOSE_TASKS_SHARED_CLASS SplitPartCollection : public System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::SplitPart>>
51 {
53  typedef System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::SplitPart>> BaseType;
54 
55  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
56  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
57 
59  friend class Aspose::Tasks::Task;
60  friend class Aspose::Tasks::AutoRecalculationState;
61  friend class Aspose::Tasks::DatesCalculator;
62  friend class Aspose::Tasks::SplitsCalculator;
63  friend class Aspose::Tasks::Visualization::GanttPageTaskGlyphBuilder;
64 
65 public:
66 
67  /// <summary>
68  /// Gets the number of parts in the collection.
69  /// </summary>
70  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
71 
72  /// <summary>
73  /// Retrieves a task's split part at the given index.
74  /// </summary>
75  /// <param name="index">The part index.</param>
76  /// <returns>a split part.</returns>
77  /// <remarks>The index is zero-based. Returns null if the index is outside array's boundaries.</remarks>
78  ASPOSE_TASKS_SHARED_API System::SharedPtr<SplitPart> idx_get(int32_t index) const override;
79  /// <summary>
80  /// Retrieves a task's split part at the given index.
81  /// </summary>
82  /// <param name="index">The part index.</param>
83  /// <param name="value">a split part.</param>
84  /// <remarks>The index is zero-based. Returns null if the index is outside array's boundaries.</remarks>
85  ASPOSE_TASKS_SHARED_API void idx_set(int32_t index, System::SharedPtr<SplitPart> value) override;
86 
87  /// <summary>
88  /// Returns an enumerator for this collection.
89  /// </summary>
90  /// <returns>an enumerator for this collection.</returns>
91  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<SplitPart>>> GetEnumerator() override;
92  /// <summary>
93  /// Copies all parts from the collection to a new array.
94  /// </summary>
95  /// <returns>An array of <see cref="Aspose::Tasks::SplitPart"></see> objects.</returns>
96  ASPOSE_TASKS_SHARED_API System::ArrayPtr<System::SharedPtr<SplitPart>> ToArray();
97 
98 protected:
99 
100  /// <summary>
101  /// Gets start date of splits.
102  /// </summary>
103  ASPOSE_TASKS_SHARED_API System::DateTime get_Start() const;
104  /// <summary>
105  /// Sets start date of splits.
106  /// </summary>
107  ASPOSE_TASKS_SHARED_API void set_Start(System::DateTime value);
108  ASPOSE_TASKS_SHARED_API System::DateTime get_Finish();
109  ASPOSE_TASKS_SHARED_API void set_Finish(System::DateTime value);
110 
111  /// <summary>
112  /// Initializes a new instance of the <see cref="SplitPartCollection"></see> class.
113  /// </summary>
114  /// <param name="start">Start date of splits.</param>
115  /// <param name="parts">Collection parts.</param>
116  ASPOSE_TASKS_SHARED_API SplitPartCollection(System::DateTime start, const System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<SplitPart>>>& parts);
117 
118  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(SplitPartCollection, CODEPORTING_ARGS(System::DateTime start, const System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<SplitPart>>>& parts));
119 
120  ASPOSE_TASKS_SHARED_API SplitPartCollection(const System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<SplitPart>>>& parts);
121 
122  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(SplitPartCollection, CODEPORTING_ARGS(const System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<SplitPart>>>& parts));
123  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<SplitPart>>> GetNonworkingSplits();
124 
125  virtual ASPOSE_TASKS_SHARED_API ~SplitPartCollection();
126 
127  #ifdef ASPOSE_GET_SHARED_MEMBERS
128  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
129  #endif
130 
131 
132 private:
133 
134  System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<SplitPart>>> parts;
135 
136  bool get_IsReadOnly() const override;
137 
138  System::DateTime pr_Start;
139 
140  void Add(const System::SharedPtr<SplitPart>& item) override;
141  void Clear() override;
142  int32_t IndexOf(const System::SharedPtr<SplitPart>& item) const override;
143  void Insert(int32_t index, const System::SharedPtr<SplitPart>& item) override;
144  void RemoveAt(int32_t index) override;
145  void CopyTo(System::ArrayPtr<System::SharedPtr<SplitPart>> array, int32_t arrayIndex) override;
146  bool Remove(const System::SharedPtr<SplitPart>& item) override;
147  bool Contains(const System::SharedPtr<SplitPart>& item) const override;
148 
149 };
150 
151 } // namespace Tasks
152 } // namespace Aspose
153 
154 
Represents a resource assignment in a project.
Definition: ResourceAssignment.h:220
Collection that represents the portions of a task.
Definition: SplitPartCollection.h:51
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< SplitPart > > > GetEnumerator() override
Returns an enumerator for this collection.
System::SharedPtr< SplitPart > idx_get(int32_t index) const override
Retrieves a task's split part at the given index.
void idx_set(int32_t index, System::SharedPtr< SplitPart > value) override
Retrieves a task's split part at the given index.
int32_t get_Count() const override
Gets the number of parts in the collection.
System::ArrayPtr< System::SharedPtr< SplitPart > > ToArray()
Copies all parts from the collection to a new array.
Represents a task in a project.
Definition: Task.h:383
Definition: Asn.h:13