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