Aspose.Tasks for C++
DayTypeCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="DayTypeCollection.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2025 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/collections/ilist.h>
9 #include <system/array.h>
10 #include <cstdint>
11 
12 #include "aspose.tasks.cpp/Enums/DayType.h"
13 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
14 
15 namespace Aspose
16 {
17 namespace Tasks
18 {
19 class CalendarException;
20 namespace IO
21 {
22 namespace Html
23 {
24 class HtmlReadingUtils;
25 } // namespace Html
26 namespace MSProject
27 {
28 class Mpp12CalendarWriter;
29 class Mpp12ExceptionReader;
30 } // namespace MSProject
31 namespace Xml
32 {
33 class ExceptionNodeReader;
34 class ExceptionNodeWriter;
35 } // namespace Xml
36 } // namespace IO
37 class ResourceAssignment;
38 } // namespace Tasks
39 } // namespace Aspose
40 namespace System
41 {
42 namespace Collections
43 {
44 namespace Generic
45 {
46 template <typename, typename> class Dictionary;
47 template <typename> class IEnumerator;
48 } // namespace Generic
49 } // namespace Collections
50 } // namespace System
51 
52 namespace Aspose {
53 
54 namespace Tasks {
55 
56 /// <summary>
57 /// Represents a collection of <see cref="DayType"></see> objects.
58 /// </summary>
59 class ASPOSE_TASKS_SHARED_CLASS DayTypeCollection : public System::Collections::Generic::IList<Aspose::Tasks::DayType>
60 {
62  typedef System::Collections::Generic::IList<Aspose::Tasks::DayType> BaseType;
63 
64  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
65  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
66 
69  friend class Aspose::Tasks::IO::Html::HtmlReadingUtils;
70  friend class Aspose::Tasks::IO::MSProject::Mpp12ExceptionReader;
71  friend class Aspose::Tasks::IO::MSProject::Mpp12CalendarWriter;
72  friend class Aspose::Tasks::IO::Xml::ExceptionNodeReader;
73  friend class Aspose::Tasks::IO::Xml::ExceptionNodeWriter;
74 
75 public:
76 
77  /// <summary>
78  /// Gets the number of elements contained in this collection.
79  /// </summary>
80  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
81  /// <summary>
82  /// Gets a value indicating whether if this collection is read-only; otherwise, false.
83  /// </summary>
84  ASPOSE_TASKS_SHARED_API bool get_IsReadOnly() const override;
85 
86  /// <summary>
87  /// Returns the element at the specified index.
88  /// </summary>
89  /// <param name="index">The zero-based index of the element to get or set.</param>
90  /// <returns>the element at the specified index.</returns>
91  ASPOSE_TASKS_SHARED_API DayType idx_get(int32_t index) const override;
92  /// <summary>
93  /// Sets the element at the specified index.
94  /// </summary>
95  /// <param name="index">The zero-based index of the element to get or set.</param>
96  /// <param name="value">the element at the specified index.</param>
97  ASPOSE_TASKS_SHARED_API void idx_set(int32_t index, DayType value) override;
98 
99  /// <summary>
100  /// Returns an enumerator for this collection.
101  /// </summary>
102  /// <returns>an enumerator for this collection.</returns>
103  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<DayType>> GetEnumerator() override;
104  /// <summary>
105  /// Adds the specified item to this collection.
106  /// </summary>
107  /// <param name="item">the specified item to add to this collection.</param>
108  ASPOSE_TASKS_SHARED_API void Add(const DayType& item) override;
109  /// <summary>
110  /// Removes all items from this collection.
111  /// </summary>
112  ASPOSE_TASKS_SHARED_API void Clear() override;
113  /// <summary>
114  /// Returns true if the specified item is found in this collection; otherwise, false.
115  /// </summary>
116  /// <param name="item">the specified item to find.</param>
117  /// <returns>true if the specified item is found in this collection; otherwise, false.</returns>
118  ASPOSE_TASKS_SHARED_API bool Contains(const DayType& item) const override;
119  /// <summary>
120  /// Copies the elements of this collection to the specified array, starting at the specified array index.
121  /// </summary>
122  /// <param name="array">the specified one-dimensional array to copy elements to</param>
123  /// <param name="arrayIndex">the zero-based index of the specified array at which copying begins.</param>
124  ASPOSE_TASKS_SHARED_API void CopyTo(System::ArrayPtr<DayType> array, int32_t arrayIndex) override;
125  /// <summary>
126  /// Removes the first occurrence of a specific object from this collection.
127  /// </summary>
128  /// <param name="item">the specified object to remove.</param>
129  /// <returns>true if the specified object was successfully removed from this collection; otherwise, false.</returns>
130  ASPOSE_TASKS_SHARED_API bool Remove(const DayType& item) override;
131  /// <summary>
132  /// Determines the index of the specified item in this collection.
133  /// </summary>
134  /// <param name="item">the specified item to locate in this collection.</param>
135  /// <returns>the index of the specified item if found; otherwise, -1.</returns>
136  ASPOSE_TASKS_SHARED_API int32_t IndexOf(const DayType& item) const override;
137  /// <summary>
138  /// Inserts the specified item at the specified index.
139  /// </summary>
140  /// <param name="index">the specified zero-based index at which the item should be inserted.</param>
141  /// <param name="item">the specified item to insert to this collection.</param>
142  ASPOSE_TASKS_SHARED_API void Insert(int32_t index, const DayType& item) override;
143  /// <summary>
144  /// Removes an item at the specified index.
145  /// </summary>
146  /// <param name="index">the specified zero-based index to remove an item at.</param>
147  ASPOSE_TASKS_SHARED_API void RemoveAt(int32_t index) override;
148 
149 protected:
150 
151  static ASPOSE_TASKS_SHARED_API System::ArrayPtr<DayType>& DaysOfWeek();
152 
153  ASPOSE_TASKS_SHARED_API DayTypeCollection();
154 
155  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(DayTypeCollection, CODEPORTING_ARGS());
156 
157  ASPOSE_TASKS_SHARED_API DayTypeCollection(int32_t val);
158 
159  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(DayTypeCollection, CODEPORTING_ARGS(int32_t val));
160  ASPOSE_TASKS_SHARED_API int32_t Pack();
161 
162  virtual ASPOSE_TASKS_SHARED_API ~DayTypeCollection();
163 
164  #ifdef ASPOSE_GET_SHARED_MEMBERS
165  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
166  #endif
167 
168 
169 private:
170 
171  static System::SharedPtr<System::Collections::Generic::Dictionary<int32_t, DayType>>& DaysOfWeekTypes();
172 
173  System::SharedPtr<System::Collections::Generic::IList<DayType>> days;
174 
175  static System::SharedPtr<System::Collections::Generic::Dictionary<int32_t, DayType>> InitDaysOfWeekTable();
176  System::SharedPtr<System::Collections::Generic::IList<DayType>> ToDays(int32_t val);
177 
178 };
179 
180 } // namespace Tasks
181 } // namespace Aspose
182 
183 
Represents a collection of DayType objects.
Definition: DayTypeCollection.h:59
Represent exceptional time periods in a calendar.
Definition: CalendarException.h:72
Definition: Asn.h:12
Represents a resource assignment in a project.
Definition: ResourceAssignment.h:225