Aspose.Tasks for C++
WorkWeekCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="WorkWeekCollection.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 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/aspose_tasks_api_defs.h"
13 
14 namespace Aspose
15 {
16 namespace Tasks
17 {
18 class Calendar;
19 class WorkWeek;
20 } // namespace Tasks
21 } // namespace Aspose
22 namespace System
23 {
24 namespace Collections
25 {
26 namespace Generic
27 {
28 template <typename> class IEnumerator;
29 template <typename> class List;
30 } // namespace Generic
31 } // namespace Collections
32 } // namespace System
33 
34 namespace Aspose {
35 
36 namespace Tasks {
37 
38 /// <summary>
39 /// Represents a collection of <see cref="WorkWeek"></see> objects.
40 /// </summary>
41 class ASPOSE_TASKS_SHARED_CLASS WorkWeekCollection : public System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::WorkWeek>>
42 {
44  typedef System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::WorkWeek>> BaseType;
45 
46  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
47  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
48 
49  friend class Aspose::Tasks::Calendar;
50 
51 public:
52 
53  /// <summary>
54  /// Gets the number of objects contained in this <see cref="WorkWeekCollection"></see> object.
55  /// </summary>
56  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
57  /// <summary>
58  /// Gets the parent calendar.
59  /// </summary>
60  ASPOSE_TASKS_SHARED_API System::SharedPtr<Calendar> get_ParentCalendar() const;
61 
62  /// <summary>
63  /// Returns the element at the specified index.
64  /// </summary>
65  /// <param name="index">The zero-based index of the element to get.</param>
66  /// <returns>the element at the specified index.</returns>
67  ASPOSE_TASKS_SHARED_API System::SharedPtr<WorkWeek> idx_get(int32_t index) const override;
68  /// <summary>
69  /// Returns the element at the specified index.
70  /// </summary>
71  /// <param name="index">The zero-based index of the element to get.</param>
72  /// <param name="value">the element at the specified index.</param>
73  ASPOSE_TASKS_SHARED_API void idx_set(int32_t index, System::SharedPtr<WorkWeek> value) override;
74 
75  /// <summary>
76  /// Adds WorkWeek instance to this collection object.
77  /// </summary>
78  /// <param name="item">The item to add.</param>
79  ASPOSE_TASKS_SHARED_API void Add(const System::SharedPtr<WorkWeek>& item) override;
80  /// <summary>
81  /// Converts the WorkWeekCollection object to a list of <see cref="WorkWeek"></see> objects.
82  /// </summary>
83  /// <returns>List of <see cref="WorkWeek"></see> objects.</returns>
84  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<WorkWeek>>> ToList();
85  /// <summary>
86  /// Returns an enumerator for this collection.
87  /// </summary>
88  /// <returns>an enumerator for this collection.</returns>
89  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<WorkWeek>>> GetEnumerator() override;
90 
91 protected:
92 
93  ASPOSE_TASKS_SHARED_API WorkWeekCollection(const System::SharedPtr<Calendar>& calendar);
94 
95  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(WorkWeekCollection, CODEPORTING_ARGS(const System::SharedPtr<Calendar>& calendar));
96 
97  ASPOSE_TASKS_SHARED_API WorkWeekCollection(const System::SharedPtr<Calendar>& calendar, const System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<WorkWeek>>>& workWeeks);
98 
99  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(WorkWeekCollection, CODEPORTING_ARGS(const System::SharedPtr<Calendar>& calendar, const System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<WorkWeek>>>& workWeeks));
100 
101  virtual ASPOSE_TASKS_SHARED_API ~WorkWeekCollection();
102 
103  #ifdef ASPOSE_GET_SHARED_MEMBERS
104  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
105  #endif
106 
107 
108 private:
109 
110  System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<WorkWeek>>> workWeeks;
111  System::WeakPtr<Calendar> parentCalendar;
112 
113  bool get_IsReadOnly() const override;
114 
115  int32_t IndexOf(const System::SharedPtr<WorkWeek>& item) const override;
116  void Insert(int32_t index, const System::SharedPtr<WorkWeek>& item) override;
117  bool Remove(const System::SharedPtr<WorkWeek>& item) override;
118  void RemoveAt(int32_t index) override;
119  void Clear() override;
120  bool Contains(const System::SharedPtr<WorkWeek>& item) const override;
121  void CopyTo(System::ArrayPtr<System::SharedPtr<WorkWeek>> array, int32_t arrayIndex) override;
122 
123 };
124 
125 } // namespace Tasks
126 } // namespace Aspose
127 
128 
Represents a calendar used in a project.
Definition: Calendar.h:294
Represents a collection of WorkWeek objects.
Definition: WorkWeekCollection.h:42
void idx_set(int32_t index, System::SharedPtr< WorkWeek > value) override
Returns the element at the specified index.
System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< WorkWeek > > > ToList()
Converts the WorkWeekCollection object to a list of WorkWeek objects.
System::SharedPtr< WorkWeek > idx_get(int32_t index) const override
Returns the element at the specified index.
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< WorkWeek > > > GetEnumerator() override
Returns an enumerator for this collection.
int32_t get_Count() const override
Gets the number of objects contained in this WorkWeekCollection object.
System::SharedPtr< Calendar > get_ParentCalendar() const
Gets the parent calendar.
void Add(const System::SharedPtr< WorkWeek > &item) override
Adds WorkWeek instance to this collection object.
Definition: Asn.h:13