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