ledger-core
DynamicObject.hpp
1 // AUTOGENERATED FILE - DO NOT MODIFY!
2 // This file generated by Djinni from dynamic.djinni
3 
4 #ifndef DJINNI_GENERATED_DYNAMICOBJECT_HPP
5 #define DJINNI_GENERATED_DYNAMICOBJECT_HPP
6 
7 #include "../utils/optional.hpp"
8 #include <cstdint>
9 #include <memory>
10 #include <string>
11 #include <vector>
12 #ifndef LIBCORE_EXPORT
13  #if defined(_MSC_VER)
14  #include <libcore_export.h>
15  #else
16  #define LIBCORE_EXPORT
17  #endif
18 #endif
19 
20 namespace ledger { namespace core { namespace api {
21 
22 class DynamicArray;
23 enum class DynamicType;
24 
30 class LIBCORE_EXPORT DynamicObject {
31 public:
32  virtual ~DynamicObject() {}
33 
40  virtual std::shared_ptr<DynamicObject> putString(const std::string & key, const std::string & value) = 0;
41 
48  virtual std::shared_ptr<DynamicObject> putInt(const std::string & key, int32_t value) = 0;
49 
56  virtual std::shared_ptr<DynamicObject> putLong(const std::string & key, int64_t value) = 0;
57 
64  virtual std::shared_ptr<DynamicObject> putDouble(const std::string & key, double value) = 0;
65 
72  virtual std::shared_ptr<DynamicObject> putData(const std::string & key, const std::vector<uint8_t> & value) = 0;
73 
80  virtual std::shared_ptr<DynamicObject> putBoolean(const std::string & key, bool value) = 0;
81 
87  virtual std::shared_ptr<DynamicObject> putObject(const std::string & key, const std::shared_ptr<DynamicObject> & value) = 0;
88 
94  virtual std::shared_ptr<DynamicObject> putArray(const std::string & key, const std::shared_ptr<DynamicArray> & value) = 0;
95 
101  virtual std::experimental::optional<std::string> getString(const std::string & key) = 0;
102 
108  virtual std::experimental::optional<int32_t> getInt(const std::string & key) = 0;
109 
115  virtual std::experimental::optional<int64_t> getLong(const std::string & key) = 0;
116 
122  virtual std::experimental::optional<double> getDouble(const std::string & key) = 0;
123 
129  virtual std::experimental::optional<std::vector<uint8_t>> getData(const std::string & key) = 0;
130 
136  virtual std::experimental::optional<bool> getBoolean(const std::string & key) = 0;
137 
143  virtual std::shared_ptr<DynamicObject> getObject(const std::string & key) = 0;
144 
150  virtual std::shared_ptr<DynamicArray> getArray(const std::string & key) = 0;
151 
157  virtual bool contains(const std::string & key) = 0;
158 
164  virtual bool remove(const std::string & key) = 0;
165 
170  virtual std::vector<std::string> getKeys() = 0;
171 
177  virtual std::experimental::optional<DynamicType> getType(const std::string & key) = 0;
178 
183  virtual std::string dump() = 0;
184 
189  virtual std::vector<uint8_t> serialize() = 0;
190 
195  virtual bool isReadOnly() = 0;
196 
201  virtual int64_t size() = 0;
202 
207  static std::shared_ptr<DynamicObject> newInstance();
208 
214  static std::shared_ptr<DynamicObject> load(const std::vector<uint8_t> & serialized);
215 };
216 
217 } } } // namespace ledger::core::api
218 #endif //DJINNI_GENERATED_DYNAMICOBJECT_HPP
Definition: DynamicObject.hpp:30
DynamicType
Definition: DynamicType.hpp:20
Definition: Account.cpp:8