ArcGIS Procedural Runtime  3.2.10650
/Attributable.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_ATTRIBUTABLE_H_
19 #define PRTX_ATTRIBUTABLE_H_
20 
21 #include "prt/Attributable.h"
22 
23 #include "prtx/prtx.h"
24 #include "prtx/Types.h"
25 
26 #include <string>
27 
28 
29 namespace prtx {
30 
37 class PRTX_EXPORTS_API Attributable {
38 public:
42  using PrimitiveType = uint8_t;
43 
44  static constexpr PrimitiveType PT_UNDEFINED = prt::Attributable::PT_UNDEFINED;
45  static constexpr PrimitiveType PT_STRING = prt::Attributable::PT_STRING;
46  static constexpr PrimitiveType PT_FLOAT = prt::Attributable::PT_FLOAT;
47  static constexpr PrimitiveType PT_BOOL = prt::Attributable::PT_BOOL;
48  static constexpr PrimitiveType PT_INT = prt::Attributable::PT_INT;
49  static constexpr PrimitiveType PT_STRING_ARRAY = prt::Attributable::PT_STRING_ARRAY;
50  static constexpr PrimitiveType PT_FLOAT_ARRAY = prt::Attributable::PT_FLOAT_ARRAY;
51  static constexpr PrimitiveType PT_BOOL_ARRAY = prt::Attributable::PT_BOOL_ARRAY;
52  static constexpr PrimitiveType PT_INT_ARRAY = prt::Attributable::PT_INT_ARRAY;
53  static constexpr PrimitiveType PT_BLIND_DATA = prt::Attributable::PT_BLIND_DATA;
54  static constexpr PrimitiveType PT_BLIND_DATA_ARRAY = prt::Attributable::PT_BLIND_DATA_ARRAY;
55  static constexpr PrimitiveType PT_COUNT = prt::Attributable::PT_COUNT;
56 
60  virtual const WStringVector& getKeys() const = 0;
66  virtual bool hasKey (const std::wstring& key) const = 0;
71  virtual PrimitiveType getType (const std::wstring& key) const = 0;
72 
78  virtual Bool getBool (const std::wstring& key) const = 0;
84  virtual int32_t getInt (const std::wstring& key) const = 0;
90  virtual double getFloat (const std::wstring& key) const = 0;
96  virtual const std::wstring& getString (const std::wstring& key) const = 0;
97 
103  virtual const BoolVector& getBoolArray (const std::wstring& key) const = 0;
109  virtual const Int32Vector& getIntArray (const std::wstring& key) const = 0;
115  virtual const DoubleVector& getFloatArray (const std::wstring& key) const = 0;
121  virtual const WStringVector& getStringArray (const std::wstring& key) const = 0;
122 
128  virtual void* getBlindData (const std::wstring& key) const = 0;
129 
130 protected:
131  Attributable() {}
132  virtual ~Attributable() {}
133 };
134 
135 
139 class PRTX_EXPORTS_API AttributableSetter {
140 public:
146  virtual void setBool (const std::wstring& key, Bool val) = 0;
152  virtual void setInt (const std::wstring& key, int32_t val) = 0;
158  virtual void setFloat (const std::wstring& key, double val) = 0;
164  virtual void setString (const std::wstring& key, const std::wstring& val) = 0;
165 
171  virtual void setBoolArray (const std::wstring& key, const BoolVector& val) = 0;
177  virtual void setIntArray (const std::wstring& key, const Int32Vector& val) = 0;
183  virtual void setFloatArray (const std::wstring& key, const DoubleVector& val) = 0;
189  virtual void setStringArray (const std::wstring& key, const WStringVector& val) = 0;
190 
196  virtual void setBlindData (const std::wstring& key, void* val) = 0;
197 
198 protected:
199  AttributableSetter() {}
200  virtual ~AttributableSetter() {}
201 };
202 
203 
204 } // namespace prtx
205 
206 
207 #endif /* PRTX_ATTRIBUTABLE_H_ */
Float array type.
Definition: Attributable.h:51
Float type.
Definition: Attributable.h:47
Boolean type.
Definition: Attributable.h:48
uint8_t PrimitiveType
Definition: /Attributable.h:42
uint8_t Bool
uint8_t based Bool type
Definition: Types.h:30
std::vector< prtx::Bool > BoolVector
vector of uint8_t based Bool type
Definition: Types.h:31
Definition: /Attributable.h:37
std::vector< double > DoubleVector
vector of double
Definition: Types.h:32
Blind data type.
Definition: Attributable.h:54
Boolean array type.
Definition: Attributable.h:52
Integer type.
Definition: Attributable.h:49
Definition: /Attributable.h:139
Undefined type.
Definition: Attributable.h:45
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
String type.
Definition: Attributable.h:46
String array type.
Definition: Attributable.h:50
Integer array type.
Definition: Attributable.h:53
std::vector< int32_t > Int32Vector
vector of int32_t
Definition: Types.h:33
Number of primitive types.
Definition: Attributable.h:56
Blind data array type.
Definition: Attributable.h:55
std::vector< std::wstring > WStringVector
vector of std::wstring
Definition: Types.h:35