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