14 #include <unordered_map>
15 #include "rrExporter.h"
17 #if defined(SWIG) || defined(SWIGPYTHON)
71 virtual bool hasKey(
const std::string& key)
const = 0;
81 virtual std::vector<std::string>
getKeys()
const = 0;
98 #if defined(SWIGPYTHON)
100 return dictionary_keys(
this);
104 return dictionary_values(
this);
108 return dictionary_items(
this);
111 PyObject *__getitem__(
const char* key) {
112 return dictionary_getitem(
this, key);
115 PyObject *__setitem__(
const char* key, PyObject* value) {
116 return dictionary_setitem(
this, key, value);
119 void __delitem__(
const char* key) {
120 return dictionary_delitem(
this, key);
123 PyObject *__contains__(
const char* key) {
124 return dictionary_contains(
this, key);
127 std::string helloPython() {
128 return "hello python";
142 using item = std::pair<std::string, Setting>;
150 void setItem(
const std::string& key,
const rr::Setting& value)
override;
155 Setting getItem(
const std::string& key)
const override;
162 bool hasKey(
const std::string& key)
const override;
167 size_t deleteItem(
const std::string& key)
override;
172 std::vector<std::string> getKeys()
const override;
181 typedef std::unordered_map<std::string, Setting> VariantMap;
This class is frozen, no new features Basic implementation of the Dictionary interface which uses a s...
Definition: Dictionary.h:140
~BasicDictionary() override=default
Pure virtual interface, you should never have to delete an instance of this type directly.
This class is frozen, no new features A dictionary interface that objects can implement.
Definition: Dictionary.h:30
virtual Setting getItem(const std::string &key) const =0
Get a value.
virtual void setItem(const std::string &key, const rr::Setting &value)=0
Set the value for an arbitrary key.
virtual bool hasKey(const std::string &key) const =0
is there a key matching this name.
virtual size_t deleteItem(const std::string &key)=0
remove a value
virtual ~Dictionary()
Pure virtual interface, you should never have to delete an instance of this type directly.
Definition: Dictionary.h:87
virtual std::vector< std::string > getKeys() const =0
list of keys in this object.
Store a roadrunner option (or setting) as a Variant type.
Definition: Setting.h:78