ArcGIS Procedural Runtime  3.2.10650
AnnotationBuilder.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_ANNOTATIONBUILDER_H_
19 #define PRTX_ANNOTATIONBUILDER_H_
20 
21 #include "prt/Annotation.h"
22 
23 #include "prtx.h"
24 #include "prtx/Builder.h"
25 
26 #include <string>
27 #include <vector>
28 
29 #ifdef _MSC_VER
30 # pragma warning(push)
31 # pragma warning(disable : 4251 4275)
32 #endif
33 
34 
35 namespace prtx {
36 
37 
41 class PRTX_EXPORTS_API AnnotationBuilder : public Builder<const prt::Annotation> {
42 public:
44  AnnotationBuilder(const AnnotationBuilder&) = delete;
45  AnnotationBuilder& operator=(const AnnotationBuilder&) = delete;
46  virtual ~AnnotationBuilder();
47 
51  void setName(const std::wstring& name);
52 
56  void addArgument(const prt::AnnotationArgument* arg);
57 
61  void addString(const std::wstring& key, const std::wstring& val);
62 
66  void addFloat(const std::wstring& key, double val);
67 
71  void addBool(const std::wstring& key, bool val);
72 
76  virtual const prt::Annotation* create(std::wstring* warnings = 0) const;
77 
81  virtual const prt::Annotation* createAndReset(std::wstring* warnings = 0);
82 
86  static const prt::Annotation* createAnnotation(const std::wstring& name);
87 
91  static const prt::Annotation* createAnnotation(const std::wstring& name, const std::wstring& key, const std::wstring& val);
92 
96  static const prt::Annotation* createAnnotation(const std::wstring& name, const std::wstring& key, double val);
97 
101  static const prt::Annotation* createAnnotation(const std::wstring& name, const std::wstring& key, bool val);
102 
103 private:
104  std::wstring mName;
105  std::vector<const prt::AnnotationArgument*> mArguments;
106 };
107 
108 
113 namespace AnnotationArgumentBuilder {
114 
115 prt::AnnotationArgument* createStringArgument(const std::wstring& key, const std::wstring& val);
116 prt::AnnotationArgument* createFloatArgument (const std::wstring& key, double val);
117 prt::AnnotationArgument* createBoolArgument (const std::wstring& key, bool val);
118 
119 } // namespace AnnotationArgumentBuilder
120 
121 
122 } // namespace prtx
123 
124 
125 #ifdef _MSC_VER
126 # pragma warning(pop)
127 #endif
128 
129 
130 #endif /* PRTX_ANNOTATIONBUILDER_H_ */
Definition: AnnotationBuilder.h:41
Definition: Annotation.h:43
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
Definition: Annotation.h:56
Definition: Builder.h:37