Aspose.Tasks for C++
RiskPatternCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="RiskPatternCollection.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 namespace RiskAnalysis
19 {
20 class RiskAnalysisSettings;
21 class RiskPattern;
22 } // namespace RiskAnalysis
23 class Task;
24 } // namespace Tasks
25 } // namespace Aspose
26 namespace System
27 {
28 namespace Collections
29 {
30 namespace Generic
31 {
32 template <typename, typename> class IDictionary;
33 template <typename> class IEnumerator;
34 } // namespace Generic
35 } // namespace Collections
36 } // namespace System
37 
38 namespace Aspose {
39 
40 namespace Tasks {
41 
42 namespace RiskAnalysis {
43 
44 /// <summary>
45 /// Represents a collection containing the instances of the <see cref="RiskPattern"></see> class.
46 /// </summary>
47 class ASPOSE_TASKS_SHARED_CLASS RiskPatternCollection : public System::Collections::Generic::ICollection<System::SharedPtr<Aspose::Tasks::RiskAnalysis::RiskPattern>>
48 {
50  typedef System::Collections::Generic::ICollection<System::SharedPtr<Aspose::Tasks::RiskAnalysis::RiskPattern>> BaseType;
51 
52  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
53  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
54 
56 
57 public:
58 
59  /// <summary>
60  /// Gets the number of elements contained in this collection.
61  /// </summary>
62  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
63  /// <summary>
64  /// Gets a value indicating whether this collection is read-only; otherwise, false.
65  /// </summary>
66  ASPOSE_TASKS_SHARED_API bool get_IsReadOnly() const override;
67 
68  /// <summary>
69  /// Gets the instance of the <see cref="RiskPattern"></see> class for the specified task.
70  /// </summary>
71  /// <param name="task">the specified task.</param>
72  /// <returns>the pattern for the specified task.</returns>
73  ASPOSE_TASKS_SHARED_API System::SharedPtr<RiskPattern> idx_get(const System::SharedPtr<Task>& task);
74 
75  /// <summary>
76  /// Adds an instance of the <see cref="RiskPattern"></see> class to this collection.
77  /// </summary>
78  /// <param name="item">an instance of the <see cref="RiskPattern"></see> class to add to this collection.</param>
79  /// <exception cref="ArgumentNullException"><paramref name="item"></paramref> task is null.</exception>
80  ASPOSE_TASKS_SHARED_API void Add(const System::SharedPtr<RiskPattern>& item) override;
81  /// <summary>
82  /// Removes all items from this collection.
83  /// </summary>
84  ASPOSE_TASKS_SHARED_API void Clear() override;
85  /// <summary>
86  /// Returns true if the specified item is found in this collection; otherwise, false.
87  /// </summary>
88  /// <param name="item">the specified item to find.</param>
89  /// <returns>true if the specified item is found in this collection; otherwise, false.</returns>
90  ASPOSE_TASKS_SHARED_API bool Contains(const System::SharedPtr<RiskPattern>& item) const override;
91  /// <summary>
92  /// Copies the elements of this collection to the specified array, starting at the specified array index.
93  /// </summary>
94  /// <param name="array">the specified one-dimensional array to copy elements to</param>
95  /// <param name="arrayIndex">the zero-based index of the specified array at which copying begins.</param>
96  ASPOSE_TASKS_SHARED_API void CopyTo(System::ArrayPtr<System::SharedPtr<RiskPattern>> array, int32_t arrayIndex) override;
97  /// <summary>
98  /// Removes the first occurrence of a specific object from this collection.
99  /// </summary>
100  /// <param name="item">the specified object to remove.</param>
101  /// <returns>true if the specified object was successfully removed from this collection; otherwise, false.</returns>
102  ASPOSE_TASKS_SHARED_API bool Remove(const System::SharedPtr<RiskPattern>& item) override;
103  /// <summary>
104  /// Returns an enumerator for this collection.
105  /// </summary>
106  /// <returns>an enumerator for this collection.</returns>
107  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<RiskPattern>>> GetEnumerator() override;
108 
109 protected:
110 
111  /// <summary>
112  /// Initializes a new instance of the <see cref="RiskPatternCollection"></see> class.
113  /// </summary>
114  ASPOSE_TASKS_SHARED_API RiskPatternCollection();
115 
116  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(RiskPatternCollection, CODEPORTING_ARGS());
117 
118  /// <summary>
119  /// Initializes a new instance of the <see cref="RiskPatternCollection"></see> class.
120  /// </summary>
121  ASPOSE_TASKS_SHARED_API RiskPatternCollection(const System::SharedPtr<System::Collections::Generic::IDictionary<System::SharedPtr<Task>, System::SharedPtr<RiskPattern>>>& patterns);
122 
123  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(RiskPatternCollection, CODEPORTING_ARGS(const System::SharedPtr<System::Collections::Generic::IDictionary<System::SharedPtr<Task>, System::SharedPtr<RiskPattern>>>& patterns));
124 
125  virtual ASPOSE_TASKS_SHARED_API ~RiskPatternCollection();
126 
127  #ifdef ASPOSE_GET_SHARED_MEMBERS
128  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
129  #endif
130 
131 
132 private:
133 
134  System::SharedPtr<System::Collections::Generic::IDictionary<System::SharedPtr<Task>, System::SharedPtr<RiskPattern>>> patterns;
135 
136 };
137 
138 } // namespace RiskAnalysis
139 } // namespace Tasks
140 } // namespace Aspose
141 
142 
Specifies settings for performing risk analysis.
Definition: RiskAnalysisSettings.h:40
Represents a collection containing the instances of the RiskPattern class.
Definition: RiskPatternCollection.h:48
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< RiskPattern > > > GetEnumerator() override
Returns an enumerator for this collection.
void Clear() override
Removes all items from this collection.
void CopyTo(System::ArrayPtr< System::SharedPtr< RiskPattern >> array, int32_t arrayIndex) override
Copies the elements of this collection to the specified array, starting at the specified array index.
bool get_IsReadOnly() const override
Gets a value indicating whether this collection is read-only; otherwise, false.
int32_t get_Count() const override
Gets the number of elements contained in this collection.
bool Remove(const System::SharedPtr< RiskPattern > &item) override
Removes the first occurrence of a specific object from this collection.
System::SharedPtr< RiskPattern > idx_get(const System::SharedPtr< Task > &task)
Gets the instance of the RiskPattern class for the specified task.
bool Contains(const System::SharedPtr< RiskPattern > &item) const override
Returns true if the specified item is found in this collection; otherwise, false.
void Add(const System::SharedPtr< RiskPattern > &item) override
Adds an instance of the RiskPattern class to this collection.
Definition: Asn.h:13