Aspose.Tasks for C++
AssignmentBaselineCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="AssignmentBaselineCollection.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2025 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/collections/list.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 AssignmentBaseline;
20 enum class BaselineType;
21 namespace Calculations
22 {
23 class ResourceAssignmentCalculator;
24 class ResourceAssignmentCostCalculator;
25 class ResourceAssignmentVarianceCalculator;
26 } // namespace Calculations
27 namespace Connectivity
28 {
29 class MpdAssignmentBaselineMapper;
30 class MpdAssignmentMapper;
31 class MspAssignmentBaseLineMapper;
32 } // namespace Connectivity
33 class EVCalculator;
34 namespace IO
35 {
36 namespace Html
37 {
38 class HtmlResourceAssignmentBaseLineTableReader;
39 } // namespace Html
40 namespace MSProject
41 {
42 class MPP12ResourceAssignmentWriter;
43 template <typename> class MPP14AsXResourceAssignmentReader;
44 class MPP14ResourceAssignmentWriter;
45 class MPP9ResourceAssignmentReader;
46 class MPP9ResourceAssignmentWriter;
47 class MPPResourceAssignmentWriter;
48 } // namespace MSProject
49 namespace Pwa
50 {
51 namespace InternalApi
52 {
53 namespace Mapping
54 {
55 class ProjectAssignmentsMapper;
56 } // namespace Mapping
57 } // namespace InternalApi
58 } // namespace Pwa
59 namespace Xml
60 {
61 class ResourceAssignmentNodeReader;
62 } // namespace Xml
63 } // namespace IO
64 class ProjectState;
65 class ResourceAssignment;
66 class TaskBaselineCollection;
67 class TimephasedWorkCostSelector;
68 namespace Visualization
69 {
70 class AssignmentToColumnText;
71 } // namespace Visualization
72 } // namespace Tasks
73 } // namespace Aspose
74 namespace System
75 {
76 namespace Collections
77 {
78 namespace Generic
79 {
80 template <typename> class IEnumerable;
81 template <typename> class IEnumerator;
82 } // namespace Generic
83 } // namespace Collections
84 } // namespace System
85 
86 namespace Aspose {
87 
88 namespace Tasks {
89 
90 /// <summary>
91 /// Represents a collection of <see cref="AssignmentBaseline"></see> objects.
92 /// </summary>
93 class ASPOSE_TASKS_SHARED_CLASS AssignmentBaselineCollection : public System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::AssignmentBaseline>>
94 {
96  typedef System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::AssignmentBaseline>> BaseType;
97 
98  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
99  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
100 
101  friend class Aspose::Tasks::Calculations::ResourceAssignmentCalculator;
102  friend class Aspose::Tasks::Calculations::ResourceAssignmentCostCalculator;
103  friend class Aspose::Tasks::Calculations::ResourceAssignmentVarianceCalculator;
105  friend class Aspose::Tasks::EVCalculator;
106  friend class Aspose::Tasks::Connectivity::MpdAssignmentBaselineMapper;
107  friend class Aspose::Tasks::Connectivity::MpdAssignmentMapper;
108  friend class Aspose::Tasks::Connectivity::MspAssignmentBaseLineMapper;
109  friend class Aspose::Tasks::IO::Html::HtmlResourceAssignmentBaseLineTableReader;
110  friend class Aspose::Tasks::IO::MSProject::MPP9ResourceAssignmentReader;
111  template<typename FT0> friend class Aspose::Tasks::IO::MSProject::MPP14AsXResourceAssignmentReader;
112  friend class Aspose::Tasks::IO::MSProject::MPP14ResourceAssignmentWriter;
113  friend class Aspose::Tasks::IO::MSProject::MPP12ResourceAssignmentWriter;
114  friend class Aspose::Tasks::IO::MSProject::MPPResourceAssignmentWriter;
115  friend class Aspose::Tasks::IO::MSProject::MPP9ResourceAssignmentWriter;
116  friend class Aspose::Tasks::IO::Pwa::InternalApi::Mapping::ProjectAssignmentsMapper;
117  friend class Aspose::Tasks::IO::Xml::ResourceAssignmentNodeReader;
118  friend class Aspose::Tasks::ProjectState;
120  friend class Aspose::Tasks::TimephasedWorkCostSelector;
121  friend class Aspose::Tasks::Visualization::AssignmentToColumnText;
122 
123 public:
124  /// A collection type whose iterator types is used as iterator types in the current collection.
125  using iterator_holder_type = System::Collections::Generic::List<System::SharedPtr<AssignmentBaseline>>;
126  /// Iterator type.
127  using iterator = typename iterator_holder_type::iterator;
128  /// Const iterator type.
129  using const_iterator = typename iterator_holder_type::const_iterator;
130  /// Virtualized element type.
131  using virtualized_iterator_element = typename iterator_holder_type::virtualized_iterator_element;
132  /// Virtualized type.
133  using virtualized_iterator = typename iterator_holder_type::virtualized_iterator;
134 
135 public:
136 
137  /// <summary>
138  /// Gets the number of objects contained in this AssignmentBaselineCollection object.
139  /// </summary>
140  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
141  /// <summary>
142  /// Gets the parent <see cref="ResourceAssignment"></see> for this collection.
143  /// </summary>
144  ASPOSE_TASKS_SHARED_API const System::SharedPtr<ResourceAssignment>& get_ParentAssignment() const;
145 
146  /// <summary>
147  /// Returns the element at the specified index.
148  /// </summary>
149  /// <param name="index">The zero-based index of the element to get.</param>
150  /// <returns>the element at the specified index.</returns>
151  ASPOSE_TASKS_SHARED_API System::SharedPtr<AssignmentBaseline> idx_get(int32_t index) const override;
152  /// <summary>
153  /// Returns the element at the specified index.
154  /// </summary>
155  /// <param name="index">The zero-based index of the element to get.</param>
156  /// <param name="value">the element at the specified index.</param>
157  ASPOSE_TASKS_SHARED_API void idx_set(int32_t index, System::SharedPtr<AssignmentBaseline> value) override;
158 
159  /// <summary>
160  /// Returns an enumerator for this collection.
161  /// </summary>
162  /// <returns>an enumerator for this collection.</returns>
163  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<AssignmentBaseline>>> GetEnumerator() override;
164  /// <summary>
165  /// This is the stub implementation of ICollection's Add method, that only throws NotSupportedException
166  /// </summary>
167  /// <param name="item">The item to add.</param>
168  ASPOSE_TASKS_SHARED_API void Add(const System::SharedPtr<AssignmentBaseline>& item) override;
169  /// <summary>
170  /// Removes baseline from this collection.
171  /// </summary>
172  /// <param name="item">The item to remove.</param>
173  /// <returns>true if <see cref="AssignmentBaseline"></see> instance has been removed successfully; otherwise, false</returns>
174  ASPOSE_TASKS_SHARED_API bool Remove(const System::SharedPtr<AssignmentBaseline>& item) override;
175  /// <summary>
176  /// Converts the AssignmentBaselineCollection object to a list of <see cref="AssignmentBaseline"></see> objects.
177  /// </summary>
178  /// <returns>List of <see cref="AssignmentBaseline"></see> objects.</returns>
179  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AssignmentBaseline>>> ToList();
180  /// Gets iterator pointing to the first element (if any) of the collection.
181  /// @return An iterator pointing to the first element (if any) of the collection
182  ASPOSE_TASKS_SHARED_API iterator begin() noexcept;
183  /// Gets iterator pointing right after the last element (if any) of the collection.
184  /// @return An iterator pointing right after the last element (if any) of the collection
185  ASPOSE_TASKS_SHARED_API iterator end() noexcept;
186  /// Gets iterator pointing to the first element (if any) of the const-qualified instance of the collection.
187  /// @return An iterator pointing to the first element (if any) of the const-qualified instance of the collection
188  ASPOSE_TASKS_SHARED_API const_iterator begin() const noexcept;
189  /// Gets iterator pointing right after the last element (if any) of the const-qualified instance of the collection.
190  /// @return An iterator pointing right after the last element (if any) of the const-qualified instance of the collection
191  ASPOSE_TASKS_SHARED_API const_iterator end() const noexcept;
192  /// Gets iterator pointing to the first const-qualified element (if any) of the collection.
193  /// @return An iterator pointing to the first const-qualified element (if any) of the collection
194  ASPOSE_TASKS_SHARED_API const_iterator cbegin() const noexcept;
195  /// Gets iterator pointing right after the last const-qualified element (if any) of the collection.
196  /// @return An iterator pointing right after the last const-qualified element (if any) of the collection
197  ASPOSE_TASKS_SHARED_API const_iterator cend() const noexcept;
198  /// Gets iterator pointing to the first element (if any) of the collection.
199  /// @return An iterator pointing to the first element (if any) of the collection
200  /// Provides iterator implementation to container's first element.
201  /// @return Newly-created iterator object.
202  ASPOSE_TASKS_SHARED_API virtualized_iterator* virtualizeBeginIterator() override;
203  /// Gets iterator pointing right after the last element (if any) of the collection.
204  /// @return An iterator pointing right after the last element (if any) of the collection
205  /// Provides iterator implementation to container's end.
206  /// @return Newly-created iterator object.
207  ASPOSE_TASKS_SHARED_API virtualized_iterator* virtualizeEndIterator() override;
208  /// Gets iterator pointing to the first element (if any)of the const-qualified instance of the collection.
209  /// @return An iterator pointing to the first element (if any)of the const-qualified instance of the collection
210  /// Provides const iterator implementation to container's first element.
211  /// @return Newly-created iterator object.
212  ASPOSE_TASKS_SHARED_API virtualized_iterator* virtualizeBeginConstIterator() const override;
213  /// Gets iterator pointing right after the last element (if any)of the const-qualified instance of the collection.
214  /// @return An iterator pointing right after the last element (if any)of the const-qualified instance of the collection
215  /// Provides const iterator implementation to container's end.
216  /// @return Newly-created iterator object.
217  ASPOSE_TASKS_SHARED_API virtualized_iterator* virtualizeEndConstIterator() const override;
218 
219 protected:
220 
221  ASPOSE_TASKS_SHARED_API AssignmentBaselineCollection(const System::SharedPtr<ResourceAssignment>& assn);
222 
223  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(AssignmentBaselineCollection, CODEPORTING_ARGS(const System::SharedPtr<ResourceAssignment>& assn));
224 
225  ASPOSE_TASKS_SHARED_API AssignmentBaselineCollection(const System::SharedPtr<ResourceAssignment>& assn, const System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<AssignmentBaseline>>>& baselines);
226 
227  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(AssignmentBaselineCollection, CODEPORTING_ARGS(const System::SharedPtr<ResourceAssignment>& assn, const System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<AssignmentBaseline>>>& baselines));
228  ASPOSE_TASKS_SHARED_API void Sort();
229  ASPOSE_TASKS_SHARED_API void RemoveByType(BaselineType baselineType);
230  ASPOSE_TASKS_SHARED_API System::SharedPtr<AssignmentBaseline> GetByType(BaselineType baselineType);
231  ASPOSE_TASKS_SHARED_API void AddInternal(const System::SharedPtr<AssignmentBaseline>& baseline);
232 
233  virtual ASPOSE_TASKS_SHARED_API ~AssignmentBaselineCollection();
234 
235  #ifdef ASPOSE_GET_SHARED_MEMBERS
236  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
237  #endif
238 
239 
240 private:
241 
242  System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AssignmentBaseline>>> baselines;
243 
244  bool get_IsReadOnly() const override;
245 
246  System::WeakPtr<ResourceAssignment> pr_ParentAssignment;
247 
248  /// <summary>
249  /// Gets the parent <see cref="ResourceAssignment"></see> for this collection.
250  /// </summary>
251  ASPOSE_TASKS_SHARED_API void set_ParentAssignment(const System::SharedPtr<ResourceAssignment>& value);
252 
253  int32_t IndexOf(const System::SharedPtr<AssignmentBaseline>& item) const override;
254  void RemoveAt(int32_t index) override;
255  void Insert(int32_t index, const System::SharedPtr<AssignmentBaseline>& item) override;
256  void Clear() override;
257  bool Contains(const System::SharedPtr<AssignmentBaseline>& item) const override;
258  void CopyTo(System::ArrayPtr<System::SharedPtr<AssignmentBaseline>> array, int32_t arrayIndex) override;
259 
260 };
261 
262 } // namespace Tasks
263 } // namespace Aspose
264 
265 
Represents a collection of TaskBaseline objects.
Definition: TaskBaselineCollection.h:100
Definition: Asn.h:12
typename iterator_holder_type::virtualized_iterator_element virtualized_iterator_element
Virtualized element type.
Definition: AssignmentBaselineCollection.h:131
Represents a resource assignment in a project.
Definition: ResourceAssignment.h:225
typename iterator_holder_type::const_iterator const_iterator
Const iterator type.
Definition: AssignmentBaselineCollection.h:129
typename iterator_holder_type::iterator iterator
Iterator type.
Definition: AssignmentBaselineCollection.h:127
typename iterator_holder_type::virtualized_iterator virtualized_iterator
Virtualized type.
Definition: AssignmentBaselineCollection.h:133
System::Collections::Generic::List< System::SharedPtr< AssignmentBaseline > > iterator_holder_type
A collection type whose iterator types is used as iterator types in the current collection.
Definition: AssignmentBaselineCollection.h:125
Represents a collection of AssignmentBaseline objects.
Definition: AssignmentBaselineCollection.h:93
Represents Baseline of a resource assignment.
Definition: AssignmentBaseline.h:83