roadrunner  2.6.0
Fast simulator for SBML models
Public Member Functions | List of all members
rr::Dictionary Class Referenceabstract

This class is frozen, no new features A dictionary interface that objects can implement. More...

#include <Dictionary.h>

Inheritance diagram for rr::Dictionary:
rr::BasicDictionary rr::LoadSBMLOptions

Public Member Functions

virtual void setItem (const std::string &key, const rr::Setting &value)=0
 Set the value for an arbitrary key. More...
 
virtual Setting getItem (const std::string &key) const =0
 Get a value. More...
 
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 std::vector< std::string > getKeys () const =0
 list of keys in this object.
 
virtual ~Dictionary ()
 Pure virtual interface, you should never have to delete an instance of this type directly.
 

Detailed Description

This class is frozen, no new features A dictionary interface that objects can implement.

These are automatically mapped to python dictionaries.

Member Function Documentation

◆ getItem()

virtual Setting rr::Dictionary::getItem ( const std::string &  key) const
pure virtual

Get a value.

Variants are POD. If the key does not exist, an std::exception will be thrown.

The Setting object has the assigment operator overloaded so it will automatically convert to any native C++ object. If the Setting can not be converted, it will raise an exception, i.e.

Dictionary* d = ...;
int a = d->getItem("someIntKey");
std::string s = d->getItem("someStrVal");
double val = d->getItem("someDoubleVal");

Implemented in rr::LoadSBMLOptions, and rr::BasicDictionary.

◆ setItem()

virtual void rr::Dictionary::setItem ( const std::string &  key,
const rr::Setting value 
)
pure virtual

Set the value for an arbitrary key.

The Setting object has a large number of creation operators so you only have to give the value as native C++ object i.e.

Dictionary*d = (...);
d->setItem("someIntKey", 1);
d->setItem("someStrKey", std::string("some std::string"));
d->setItem("someFloatVal, 0.123);

Implemented in rr::LoadSBMLOptions, and rr::BasicDictionary.


The documentation for this class was generated from the following file: