Aspose.Tasks for C++
FilterCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="FilterCollection.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/collections/icollection.h>
9 #include <system/array.h>
10 #include <cstdint>
11 
12 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
13 
14 namespace Aspose
15 {
16 namespace Tasks
17 {
18 class Filter;
19 class GanttChartView;
20 namespace IO
21 {
22 namespace MSProject
23 {
24 class MppViewWriter;
25 } // namespace MSProject
26 } // namespace IO
27 class Project;
28 } // namespace Tasks
29 } // namespace Aspose
30 namespace System
31 {
32 namespace Collections
33 {
34 namespace Generic
35 {
36 template <typename> class IEnumerator;
37 template <typename> class List;
38 template <typename, typename> class SortedList;
39 } // namespace Generic
40 } // namespace Collections
41 } // namespace System
42 
43 namespace Aspose {
44 
45 namespace Tasks {
46 
47 /// <summary>
48 /// Contains a list of <see cref="Filter"></see> objects.
49 /// Implements ICollection&lt;Filter&gt; interface.
50 /// </summary>
51 class ASPOSE_TASKS_SHARED_CLASS FilterCollection : public System::Collections::Generic::ICollection<System::SharedPtr<Aspose::Tasks::Filter>>
52 {
53  typedef FilterCollection ThisType;
54  typedef System::Collections::Generic::ICollection<System::SharedPtr<Aspose::Tasks::Filter>> BaseType;
55 
56  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
57  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
58 
59  friend class Aspose::Tasks::Project;
60  friend class Aspose::Tasks::GanttChartView;
61  friend class Aspose::Tasks::IO::MSProject::MppViewWriter;
62 
63 public:
64 
65  /// <summary>
66  /// Gets the number of elements contained in this collection.
67  /// </summary>
68  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
69  /// <summary>
70  /// Gets a value indicating whether this collection is read-only; otherwise, false.
71  /// </summary>
72  ASPOSE_TASKS_SHARED_API bool get_IsReadOnly() const override;
73 
74  /// <summary>
75  /// Returns an enumerator for this collection.
76  /// </summary>
77  /// <returns>an enumerator for this collection.</returns>
78  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<Filter>>> GetEnumerator() override;
79  /// <summary>
80  /// Adds the specified item to this collection.
81  /// </summary>
82  /// <param name="item">the specified item to add to this collection.</param>
83  ASPOSE_TASKS_SHARED_API void Add(const System::SharedPtr<Filter>& item) override;
84  /// <summary>
85  /// Removes all items from this collection.
86  /// </summary>
87  ASPOSE_TASKS_SHARED_API void Clear() override;
88  /// <summary>
89  /// Returns true if the specified item is found in this collection; otherwise, false.
90  /// </summary>
91  /// <param name="item">the specified item to find.</param>
92  /// <returns>true if the specified item is found in this collection; otherwise, false.</returns>
93  ASPOSE_TASKS_SHARED_API bool Contains(const System::SharedPtr<Filter>& item) const override;
94  /// <summary>
95  /// Copies the elements of this collection to the specified array, starting at the specified array index.
96  /// </summary>
97  /// <param name="array">the specified one-dimensional array to copy elements to</param>
98  /// <param name="arrayIndex">the zero-based index of the specified array at which copying begins.</param>
99  ASPOSE_TASKS_SHARED_API void CopyTo(System::ArrayPtr<System::SharedPtr<Filter>> array, int32_t arrayIndex) override;
100  /// <summary>
101  /// Removes the first occurrence of a specific object from this collection.
102  /// </summary>
103  /// <param name="item">the specified object to remove.</param>
104  /// <returns>true if the specified object was successfully removed from this collection; otherwise, false.</returns>
105  ASPOSE_TASKS_SHARED_API bool Remove(const System::SharedPtr<Filter>& item) override;
106  /// <summary>
107  /// Converts a filter collection to a list of <see cref="Filter"></see> objects.
108  /// </summary>
109  /// <returns>Generic list of <see cref="Filter"></see> objects.</returns>
110  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Filter>>> ToList();
111 
112 protected:
113 
114  /// <summary>
115  /// Initializes a new instance of the <see cref="FilterCollection"></see> class.
116  /// </summary>
117  ASPOSE_TASKS_SHARED_API FilterCollection();
118 
119  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(FilterCollection, CODEPORTING_ARGS());
120  ASPOSE_TASKS_SHARED_API System::SharedPtr<Filter> GetFirstOrDefault();
121  ASPOSE_TASKS_SHARED_API System::SharedPtr<Filter> GetByName(const System::String& filterName);
122 
123  virtual ASPOSE_TASKS_SHARED_API ~FilterCollection();
124 
125  #ifdef ASPOSE_GET_SHARED_MEMBERS
126  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
127  #endif
128 
129 
130 private:
131 
132  System::SharedPtr<System::Collections::Generic::SortedList<int32_t, System::SharedPtr<Filter>>> filters;
133 
134  int32_t GetNextUid();
135 
136 };
137 
138 } // namespace Tasks
139 } // namespace Aspose
140 
141 
Contains a list of Filter objects. Implements ICollection<Filter> interface.
Definition: FilterCollection.h:52
void Add(const System::SharedPtr< Filter > &item) override
Adds the specified item to this collection.
bool get_IsReadOnly() const override
Gets a value indicating whether this collection is read-only; otherwise, false.
void CopyTo(System::ArrayPtr< System::SharedPtr< Filter >> array, int32_t arrayIndex) override
Copies the elements of this collection to the specified array, starting at the specified array index.
bool Contains(const System::SharedPtr< Filter > &item) const override
Returns true if the specified item is found in this collection; otherwise, false.
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< Filter > > > GetEnumerator() override
Returns an enumerator for this collection.
bool Remove(const System::SharedPtr< Filter > &item) override
Removes the first occurrence of a specific object from this collection.
System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< Filter > > > ToList()
Converts a filter collection to a list of Filter objects.
void Clear() override
Removes all items from this collection.
int32_t get_Count() const override
Gets the number of elements contained in this collection.
Represents a GanttChart view.
Definition: GanttChartView.h:70
Represents a project.
Definition: Project.h:552
Definition: Asn.h:13