Aspose.Tasks for C++
RiskItemStatisticsCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="RiskItemStatisticsCollection.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/shared_ptr.h>
9 #include <system/collections/ienumerable.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 RiskAnalysisResult;
21 class RiskItemStatistics;
22 enum class RiskItemType;
23 class SampleCollector;
24 } // namespace RiskAnalysis
25 class Task;
26 } // namespace Tasks
27 } // namespace Aspose
28 namespace System
29 {
30 namespace Collections
31 {
32 namespace Generic
33 {
34 template <typename> class ICollection;
35 template <typename, typename> class IDictionary;
36 template <typename> class IEnumerator;
37 } // namespace Generic
38 } // namespace Collections
39 } // namespace System
40 
41 namespace Aspose {
42 
43 namespace Tasks {
44 
45 namespace RiskAnalysis {
46 
47 /// <summary>
48 /// Represents a collection containing the instances of the <see cref="RiskItemStatistics"></see> class.
49 /// </summary>
50 class ASPOSE_TASKS_SHARED_CLASS RiskItemStatisticsCollection : public System::Collections::Generic::IEnumerable<System::SharedPtr<Aspose::Tasks::RiskAnalysis::RiskItemStatistics>>
51 {
53  typedef System::Collections::Generic::IEnumerable<System::SharedPtr<Aspose::Tasks::RiskAnalysis::RiskItemStatistics>> BaseType;
54 
55  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
56  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
57 
58  friend class Aspose::Tasks::RiskAnalysis::SampleCollector;
61 
62 public:
63 
64  /// <summary>
65  /// Returns an instance of the <see cref="RiskItemStatistics"></see> class containing in this collection which is associated with the specified Task object; null if the item is not found.
66  /// </summary>
67  /// <param name="task">the specified instance of the <see cref="Task"></see> class.</param>
68  /// <returns>risk item which is associated with the specified task object if found; null otherwise.</returns>
69  ASPOSE_TASKS_SHARED_API System::SharedPtr<RiskItemStatistics> Get(const System::SharedPtr<Task>& task);
70  /// <summary>
71  /// Returns an enumerator for this collection.
72  /// </summary>
73  /// <returns>an enumerator for this collection.</returns>
74  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<RiskItemStatistics>>> GetEnumerator() override;
75 
76 protected:
77 
78  ASPOSE_TASKS_SHARED_API int32_t get_IterationCount() const;
79 
80  /// <summary>
81  /// Initializes a new instance of the <see cref="RiskItemStatisticsCollection"></see> class.
82  /// </summary>
83  /// <param name="iterationCount">the specified iteration count.</param>
84  /// <param name="itemType">the specified instance of the <see cref="RiskItemType"></see> enumeration.</param>
85  ASPOSE_TASKS_SHARED_API RiskItemStatisticsCollection(int32_t iterationCount, RiskItemType itemType);
86 
87  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(RiskItemStatisticsCollection, CODEPORTING_ARGS(int32_t iterationCount, RiskItemType itemType));
88 
89  /// <summary>
90  /// Initializes a new instance of the <see cref="RiskItemStatisticsCollection"></see> class.
91  /// </summary>
92  /// <param name="iterationCount">the specified iteration count.</param>
93  /// <param name="itemType">the specified instance of the <see cref="RiskItemType"></see> enumeration.</param>
94  /// <param name="riskItems">the specified collection of the risk items.</param>
95  ASPOSE_TASKS_SHARED_API RiskItemStatisticsCollection(int32_t iterationCount, RiskItemType itemType, const System::SharedPtr<System::Collections::Generic::IDictionary<System::SharedPtr<Task>, System::SharedPtr<RiskItemStatistics>>>& riskItems);
96 
97  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(RiskItemStatisticsCollection, CODEPORTING_ARGS(int32_t iterationCount, RiskItemType itemType, const System::SharedPtr<System::Collections::Generic::IDictionary<System::SharedPtr<Task>, System::SharedPtr<RiskItemStatistics>>>& riskItems));
98  /// <summary>
99  /// Returns an instance of the <see cref="RiskItemStatistics"></see> class containing in this collection which is associated with the specified Task object;
100  /// if the item is not found then this method adds the new instance of the <see cref="RiskItemStatistics"></see> class and returns it as a result of operation.
101  /// </summary>
102  /// <param name="task">the specified instance of the <see cref="Task"></see> class.</param>
103  /// <returns>found or added risk item which is associated with the specified task object.</returns>
104  ASPOSE_TASKS_SHARED_API System::SharedPtr<RiskItemStatistics> GetOrAdd(const System::SharedPtr<Task>& task);
105 
106  virtual ASPOSE_TASKS_SHARED_API ~RiskItemStatisticsCollection();
107 
108  #ifdef ASPOSE_GET_SHARED_MEMBERS
109  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
110  #endif
111 
112 
113 private:
114 
115  RiskItemType itemType;
116  int32_t iterationCount;
117  System::SharedPtr<System::Collections::Generic::IDictionary<System::SharedPtr<Task>, System::SharedPtr<RiskItemStatistics>>> riskItems;
118 
119  System::SharedPtr<RiskItemStatistics> Add(const System::SharedPtr<Task>& task);
120 
121 };
122 
123 } // namespace RiskAnalysis
124 } // namespace Tasks
125 } // namespace Aspose
126 
127 
Represents a result of risk analysis.
Definition: RiskAnalysisResult.h:56
Represents a collection containing the instances of the RiskItemStatistics class.
Definition: RiskItemStatisticsCollection.h:51
System::SharedPtr< RiskItemStatistics > Get(const System::SharedPtr< Task > &task)
Returns an instance of the RiskItemStatistics class containing in this collection which is associated...
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< RiskItemStatistics > > > GetEnumerator() override
Returns an enumerator for this collection.
Represents an item which stores statistical data for the task of the analyzed project.
Definition: RiskItemStatistics.h:49
Definition: Asn.h:13