Aspose.Tasks for C++
TableFieldCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="TableFieldCollection.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 Field;
20 namespace IO
21 {
22 namespace MSProject
23 {
24 class MPPTableReader;
25 } // namespace MSProject
26 } // namespace IO
27 class Table;
28 class TableField;
29 } // namespace Tasks
30 } // namespace Aspose
31 namespace System
32 {
33 namespace Collections
34 {
35 namespace Generic
36 {
37 template <typename> class IEnumerator;
38 } // namespace Generic
39 } // namespace Collections
40 } // namespace System
41 
42 namespace Aspose {
43 
44 namespace Tasks {
45 
46 /// <summary>
47 /// Contains a list of <see cref="TableField"></see> objects.
48 /// Implements IList&lt;TableField&gt; interface.
49 /// </summary>
50 class ASPOSE_TASKS_SHARED_CLASS TableFieldCollection : public System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::TableField>>
51 {
53  typedef System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::TableField>> BaseType;
54 
55  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
56  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
57 
58  friend class Aspose::Tasks::IO::MSProject::MPPTableReader;
59  friend class Aspose::Tasks::Table;
60 
61 public:
62  /// A collection type whose iterator types is used as iterator types in the current collection.
63  using iterator_holder_type = System::Collections::Generic::List<System::SharedPtr<TableField>>;
64  /// Iterator type.
65  using iterator = typename iterator_holder_type::iterator;
66  /// Const iterator type.
67  using const_iterator = typename iterator_holder_type::const_iterator;
68  /// Virtualized element type.
69  using virtualized_iterator_element = typename iterator_holder_type::virtualized_iterator_element;
70  /// Virtualized type.
71  using virtualized_iterator = typename iterator_holder_type::virtualized_iterator;
72 
73 public:
74 
75  /// <summary>
76  /// Gets the number of elements contained in this collection.
77  /// </summary>
78  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
79  /// <summary>
80  /// Gets a value indicating whether this collection is read-only; otherwise, false.
81  /// </summary>
82  ASPOSE_TASKS_SHARED_API bool get_IsReadOnly() const override;
83 
84  /// <summary>
85  /// Returns the element at the specified index.
86  /// </summary>
87  /// <param name="index">The zero-based index of the element to get or set.</param>
88  /// <returns>the element at the specified index.</returns>
89  ASPOSE_TASKS_SHARED_API System::SharedPtr<TableField> idx_get(int32_t index) const override;
90  /// <summary>
91  /// Sets the element at the specified index.
92  /// </summary>
93  /// <param name="index">The zero-based index of the element to get or set.</param>
94  /// <param name="value">the element at the specified index.</param>
95  ASPOSE_TASKS_SHARED_API void idx_set(int32_t index, System::SharedPtr<TableField> value) override;
96 
97  /// <summary>
98  /// Returns an enumerator for this collection.
99  /// </summary>
100  /// <returns>an enumerator for this collection.</returns>
101  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<TableField>>> GetEnumerator() override;
102  /// <summary>
103  /// Adds the specified item to this collection.
104  /// </summary>
105  /// <param name="item">the specified item to add to this collection.</param>
106  ASPOSE_TASKS_SHARED_API void Add(const System::SharedPtr<TableField>& item) override;
107  /// <summary>
108  /// Removes all items from this collection.
109  /// </summary>
110  ASPOSE_TASKS_SHARED_API void Clear() override;
111  /// <summary>
112  /// Returns true if the specified item is found in this collection; otherwise, false.
113  /// </summary>
114  /// <param name="item">the specified item to find.</param>
115  /// <returns>true if the specified item is found in this collection; otherwise, false.</returns>
116  ASPOSE_TASKS_SHARED_API bool Contains(const System::SharedPtr<TableField>& item) const override;
117  /// <summary>
118  /// Copies the elements of this collection to the specified array, starting at the specified array index.
119  /// </summary>
120  /// <param name="array">the specified one-dimensional array to copy elements to</param>
121  /// <param name="arrayIndex">the zero-based index of the specified array at which copying begins.</param>
122  ASPOSE_TASKS_SHARED_API void CopyTo(System::ArrayPtr<System::SharedPtr<TableField>> array, int32_t arrayIndex) override;
123  /// <summary>
124  /// Removes the first occurrence of a specific object from this collection.
125  /// </summary>
126  /// <param name="item">the specified object to remove.</param>
127  /// <returns>true if the specified object was successfully removed from this collection; otherwise, false.</returns>
128  ASPOSE_TASKS_SHARED_API bool Remove(const System::SharedPtr<TableField>& item) override;
129  /// <summary>
130  /// Determines the index of the specified item in this collection.
131  /// </summary>
132  /// <param name="item">the specified item to locate in this collection.</param>
133  /// <returns>the index of the specified item if found; otherwise, -1.</returns>
134  ASPOSE_TASKS_SHARED_API int32_t IndexOf(const System::SharedPtr<TableField>& item) const override;
135  /// <summary>
136  /// Inserts the specified item at the specified index.
137  /// </summary>
138  /// <param name="index">the specified zero-based index at which the item should be inserted.</param>
139  /// <param name="item">the specified item to insert to this collection.</param>
140  ASPOSE_TASKS_SHARED_API void Insert(int32_t index, const System::SharedPtr<TableField>& item) override;
141  /// <summary>
142  /// Removes an item at the specified index.
143  /// </summary>
144  /// <param name="index">the specified zero-based index to remove an item at.</param>
145  ASPOSE_TASKS_SHARED_API void RemoveAt(int32_t index) override;
146  /// Gets iterator pointing to the first element (if any) of the collection.
147  /// @return An iterator pointing to the first element (if any) of the collection
148  ASPOSE_TASKS_SHARED_API iterator begin() noexcept;
149  /// Gets iterator pointing right after the last element (if any) of the collection.
150  /// @return An iterator pointing right after the last element (if any) of the collection
151  ASPOSE_TASKS_SHARED_API iterator end() noexcept;
152  /// Gets iterator pointing to the first element (if any) of the const-qualified instance of the collection.
153  /// @return An iterator pointing to the first element (if any) of the const-qualified instance of the collection
154  ASPOSE_TASKS_SHARED_API const_iterator begin() const noexcept;
155  /// Gets iterator pointing right after the last element (if any) of the const-qualified instance of the collection.
156  /// @return An iterator pointing right after the last element (if any) of the const-qualified instance of the collection
157  ASPOSE_TASKS_SHARED_API const_iterator end() const noexcept;
158  /// Gets iterator pointing to the first const-qualified element (if any) of the collection.
159  /// @return An iterator pointing to the first const-qualified element (if any) of the collection
160  ASPOSE_TASKS_SHARED_API const_iterator cbegin() const noexcept;
161  /// Gets iterator pointing right after the last const-qualified element (if any) of the collection.
162  /// @return An iterator pointing right after the last const-qualified element (if any) of the collection
163  ASPOSE_TASKS_SHARED_API const_iterator cend() const noexcept;
164  /// Gets iterator pointing to the first element (if any) of the collection.
165  /// @return An iterator pointing to the first element (if any) of the collection
166  /// Provides iterator implementation to container's first element.
167  /// @return Newly-created iterator object.
168  ASPOSE_TASKS_SHARED_API virtualized_iterator* virtualizeBeginIterator() override;
169  /// Gets iterator pointing right after the last element (if any) of the collection.
170  /// @return An iterator pointing right after the last element (if any) of the collection
171  /// Provides iterator implementation to container's end.
172  /// @return Newly-created iterator object.
173  ASPOSE_TASKS_SHARED_API virtualized_iterator* virtualizeEndIterator() override;
174  /// Gets iterator pointing to the first element (if any)of the const-qualified instance of the collection.
175  /// @return An iterator pointing to the first element (if any)of the const-qualified instance of the collection
176  /// Provides const iterator implementation to container's first element.
177  /// @return Newly-created iterator object.
178  ASPOSE_TASKS_SHARED_API virtualized_iterator* virtualizeBeginConstIterator() const override;
179  /// Gets iterator pointing right after the last element (if any)of the const-qualified instance of the collection.
180  /// @return An iterator pointing right after the last element (if any)of the const-qualified instance of the collection
181  /// Provides const iterator implementation to container's end.
182  /// @return Newly-created iterator object.
183  ASPOSE_TASKS_SHARED_API virtualized_iterator* virtualizeEndConstIterator() const override;
184 
185 protected:
186 
187  /// <summary>
188  /// Initializes a new instance of the <see cref="TableFieldCollection"></see> class.
189  /// </summary>
190  ASPOSE_TASKS_SHARED_API TableFieldCollection();
191 
192  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(TableFieldCollection, CODEPORTING_ARGS());
193  ASPOSE_TASKS_SHARED_API System::SharedPtr<TableField> FindByField(Field id);
194 
195  virtual ASPOSE_TASKS_SHARED_API ~TableFieldCollection();
196 
197  #ifdef ASPOSE_GET_SHARED_MEMBERS
198  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
199  #endif
200 
201 
202 private:
203 
204  System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<TableField>>> fields;
205 
206 };
207 
208 } // namespace Tasks
209 } // namespace Aspose
210 
211 
Contains a list of TableField objects. Implements IList<TableField> interface.
Definition: TableFieldCollection.h:51
int32_t get_Count() const override
Gets the number of elements contained in this collection.
bool Contains(const System::SharedPtr< TableField > &item) const override
Returns true if the specified item is found in this collection; otherwise, false.
void Clear() override
Removes all items from this collection.
void RemoveAt(int32_t index) override
Removes an item at the specified index.
bool get_IsReadOnly() const override
Gets a value indicating whether this collection is read-only; otherwise, false.
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< TableField > > > GetEnumerator() override
Returns an enumerator for this collection.
void idx_set(int32_t index, System::SharedPtr< TableField > value) override
Sets the element at the specified index.
typename iterator_holder_type::const_iterator const_iterator
Const iterator type.
Definition: TableFieldCollection.h:67
void Add(const System::SharedPtr< TableField > &item) override
Adds the specified item to this collection.
void CopyTo(System::ArrayPtr< System::SharedPtr< TableField >> array, int32_t arrayIndex) override
Copies the elements of this collection to the specified array, starting at the specified array index.
bool Remove(const System::SharedPtr< TableField > &item) override
Removes the first occurrence of a specific object from this collection.
typename iterator_holder_type::iterator iterator
Iterator type.
Definition: TableFieldCollection.h:65
typename iterator_holder_type::virtualized_iterator virtualized_iterator
Virtualized type.
Definition: TableFieldCollection.h:71
System::SharedPtr< TableField > 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: TableFieldCollection.h:69
System::Collections::Generic::List< System::SharedPtr< TableField > > iterator_holder_type
A collection type whose iterator types is used as iterator types in the current collection.
Definition: TableFieldCollection.h:63
int32_t IndexOf(const System::SharedPtr< TableField > &item) const override
Determines the index of the specified item in this collection.
void Insert(int32_t index, const System::SharedPtr< TableField > &item) override
Inserts the specified item at the specified index.
Represents a field of a table in a project.
Definition: TableField.h:33
Represents a table in Project
Definition: Table.h:46
Definition: Asn.h:13