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