ArcGIS Procedural Runtime  3.2.10650
ReportsCollector.h
1 /*
2  COPYRIGHT (c) 2012-2024 Esri R&D Center Zurich
3  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
4  Unpublished material - all rights reserved under the
5  Copyright Laws of the United States and applicable international
6  laws, treaties, and conventions.
7 
8  For additional information, contact:
9  Environmental Systems Research Institute, Inc.
10  Attn: Contracts and Legal Services Department
11  380 New York Street
12  Redlands, California, 92373
13  USA
14 
15  email: contracts@esri.com
16 */
17 
18 #ifndef PRTX_REPORTSCOLLECTOR_H_
19 #define PRTX_REPORTSCOLLECTOR_H_
20 
21 #include "prtx/prtx.h"
22 
23 #ifdef _MSC_VER
24 # pragma warning(push)
25 # pragma warning(disable : 4275)
26 #endif
27 
28 #include <memory>
29 #include <map>
30 
31 
32 namespace prtx {
33 
34 class GenerateContext;
35 
36 class Reports;
37 using ReportsPtr = std::shared_ptr<Reports>;
38 
39 using ReportDomains = std::map<uint32_t, prtx::ReportsPtr>;
40 
41 class ReportsAccumulator;
42 typedef std::shared_ptr<ReportsAccumulator> ReportsAccumulatorPtr;
43 
47 class PRTX_EXPORTS_API ReportsAccumulator {
48 public:
49  ReportsAccumulator() = default;
50  ReportsAccumulator(const ReportsAccumulator&) = delete;
51  ReportsAccumulator& operator=(const ReportsAccumulator&) = delete;
52 
58  virtual void add(
59  ReportDomains& reportDomains,
60  uint32_t domain,
61  const prtx::ReportsPtr& reports
62  ) = 0;
63 
68  virtual void finalize(ReportDomains& reportDomains) const = 0;
69 };
70 
71 
75 class PRTX_EXPORTS_API AppendingReportsAccumulator : public ReportsAccumulator {
76 public:
77  static ReportsAccumulatorPtr create();
78 };
79 
80 
88 class PRTX_EXPORTS_API SumReportsAccumulator : public AppendingReportsAccumulator {
89 public:
90  static ReportsAccumulatorPtr create();
91 };
92 
93 
106 public:
107  static ReportsAccumulatorPtr create();
108 };
109 
110 
114 class PRTX_EXPORTS_API WriteFirstReportsAccumulator : public ReportsAccumulator {
115 public:
116  static ReportsAccumulatorPtr create();
117 };
118 
119 
120 class ReportingStrategy;
121 typedef std::shared_ptr<ReportingStrategy> ReportingStrategyPtr;
122 
129 class PRTX_EXPORTS_API ReportingStrategy {
130 public:
131  ReportingStrategy() = default;
132  ReportingStrategy(const ReportingStrategy&) = delete;
133  ReportingStrategy& operator=(const ReportingStrategy&) = delete;
134  virtual ~ReportingStrategy() { }
135 
141  virtual const prtx::ReportsPtr& getReports(uint32_t domain) const = 0;
142 
147  virtual const prtx::ReportsPtr& getReports() const = 0;
148 };
149 
150 
155 class PRTX_EXPORTS_API LeafShapeReportingStrategy : public ReportingStrategy {
156 public:
157  static ReportingStrategyPtr create(
158  prtx::GenerateContext& context,
159  size_t initialShapeIndex,
160  ReportsAccumulatorPtr reportsAccumulator
161  );
162 };
163 
164 
169 class PRTX_EXPORTS_API AllShapesReportingStrategy : public ReportingStrategy {
170 public:
171  static ReportingStrategyPtr create(
172  prtx::GenerateContext& context,
173  size_t initialShapeIndex,
174  ReportsAccumulatorPtr reportsAccumulator
175  );
176 };
177 
178 
182 class PRTX_EXPORTS_API SingleShapeReportingStrategy : public ReportingStrategy {
183 public:
184  static ReportingStrategyPtr create(
185  prtx::GenerateContext& context,
186  size_t initialShapeIndex,
187  ReportsAccumulatorPtr reportsAccumulator
188  );
189 };
190 
191 
192 } // namespace prtx
193 
194 
195 #ifdef _MSC_VER
196 # pragma warning(pop)
197 #endif
198 
199 #endif
Definition: ReportsCollector.h:105
Definition: GenerateContext.h:42
Definition: ReportsCollector.h:169
Definition: ReportsCollector.h:114
Definition: ReportsCollector.h:75
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
Definition: ReportsCollector.h:88
Definition: ReportsCollector.h:47
Definition: ReportsCollector.h:155
Definition: ReportsCollector.h:182
Definition: ReportsCollector.h:129