15 #include "tr1proxy/rr_memory.h"
16 #include "tr1proxy/rr_unordered_map.h"
18 #if defined(SWIG) || defined(SWIGPYTHON)
72 virtual bool hasKey(
const std::string& key)
const = 0;
82 virtual std::vector<std::string>
getKeys()
const = 0;
99 #if defined(SWIGPYTHON)
101 return dictionary_keys(
this);
105 return dictionary_values(
this);
109 return dictionary_items(
this);
112 PyObject *__getitem__(
const char* key) {
113 return dictionary_getitem(
this, key);
116 PyObject *__setitem__(
const char* key, PyObject* value) {
117 return dictionary_setitem(
this, key, value);
120 void __delitem__(
const char* key) {
121 return dictionary_delitem(
this, key);
124 PyObject *__contains__(
const char* key) {
125 return dictionary_contains(
this, key);
128 std::string helloPython() {
129 return "hello python";
160 bool hasKey(
const std::string& key)
const override;
170 std::vector<std::string>
getKeys()
const override;
179 typedef cxx11_ns::unordered_map<std::string, Variant> VariantMap;
This class is frozen, no new features Basic implementation of the Dictionary interface which uses a s...
Definition: Dictionary.h:141
std::vector< std::string > getKeys() const override
Variant getItem(const std::string &key) const override
bool hasKey(const std::string &key) const override
~BasicDictionary() override=default
void setItem(const std::string &key, const rr::Variant &value) override
size_t deleteItem(const std::string &key) override
This class is frozen, no new features A dictionary interface that objects can implement....
Definition: Dictionary.h:31
virtual Variant getItem(const std::string &key) const =0
virtual void setItem(const std::string &key, const rr::Variant &value)=0
virtual bool hasKey(const std::string &key) const =0
virtual size_t deleteItem(const std::string &key)=0
virtual ~Dictionary()
Definition: Dictionary.h:88
virtual std::vector< std::string > getKeys() const =0