OMNeT++ Simulation Library
6.0.3
|
16 #ifndef __OMNETPP_CVALUEMAP_H
17 #define __OMNETPP_CVALUEMAP_H
22 #include "cvaluecontainer.h"
39 std::map<std::string,cValue> fields;
46 typedef std::map<std::string,cValue>::value_type Entry;
47 const Entry& getEntry(
int k)
const;
48 static std::string entryToStr(
const Entry& e) {
return e.first +
" : " + e.second.str();}
102 virtual std::string str()
const override;
108 virtual void forEachChild(
cVisitor *v)
override;
117 virtual int size()
const {
return fields.size();}
122 virtual void clear();
127 virtual void set(
const char *key,
const cValue& value);
132 virtual bool containsKey(
const char *key)
const;
137 virtual const cValue& get(
const char *key)
const;
147 virtual void erase(
const char *key);
152 const std::map<std::string,cValue>&
getFields()
const {
return fields;}
Common base class for cValue-based containers.
Definition: cvaluecontainer.h:32
A variant-like value class used during evaluating NED expressions.
Definition: cvalue.h:47
cValueMap(const char *name=nullptr)
Definition: cvaluemap.h:67
virtual cValueMap * dup() const override
Definition: cvaluemap.h:96
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
cValueMap(const cValueMap &other)
Definition: cvaluemap.h:62
virtual int size() const
Definition: cvaluemap.h:117
const cValue & operator[](const char *key) const
Definition: cvaluemap.h:142
Key-value container class based on std::map<std::string,cValue>.
Definition: cvaluemap.h:36
const std::map< std::string, cValue > & getFields() const
Definition: cvaluemap.h:152