GetSet  .9
A c++ library for load/saving typed and named properties and automatic GUI.
GetSetDictionary Class Reference

Dictionary holding Sections of keys with associated properties. Usually not used directly. More...

#include <GetSetDictionary.h>

Classes

class  Observer
 Observers for the signals "create" and "change". More...

Public Types

typedef std::map< std::string,
GetSetInternal::GetSetDataInterface * > 
Section
typedef std::map< std::string,
Section
Dictionary

Public Member Functions

 ~GetSetDictionary ()
void parseXML (const std::string &xml)
 Add parameters and their values from an xml file.
std::string getXML () const
 Returns a string with an xml description of this dictionary.
void parseIni (const std::string &ini)
 Add values from an ini file.
std::string getIni () const
 Returns a string with all values in Ini-file format.
void erase (const std::string &section, const std::string &key)
 Remove a single parameter from the dictionary.
void clear (const std::string &section)
 Clear a section in this dictionary, deleting all its properties.
GetSetInternal::GetSetDataInterfacegetDatainterface (const std::string &section, const std::string &key) const
 Check if section/key pair exists in this dictionary. If so, return the entry. (used internally)
Dictionaryget ()
 Direct access to sections of the dictionary. (used internally)
void signalChange (const std::string &section, const std::string &key)
 This function is called when a variable in the dictionary changes. Calls Observer's notifyChange(...)
void signalCreate (const std::string &section, const std::string &key)
 This function is called when a variable in the dictionary was created (or changed type). Calls Observer's notifyCreate(...)
void signalDestroy (const std::string &section, const std::string &key="")
 This function is called right before a variable is removed from the dictionary. Key may be empty string if the section is removed completely.

Static Public Member Functions

static GetSetDictionaryglobalDictionary ()

Protected Member Functions

void loadSection (tinyxml2::XMLElement *node, const std::string &section="")

Protected Attributes

std::set< Observer * > registered_observers
Dictionary properties

Friends

class GetSetDictionary::Observer

Detailed Description

Dictionary holding Sections of keys with associated properties. Usually not used directly.

Member Typedef Documentation

typedef std::map<std::string, Section> GetSetDictionary::Dictionary

Constructor & Destructor Documentation

GetSetDictionary::~GetSetDictionary ( )

Member Function Documentation

void GetSetDictionary::clear ( const std::string &  section)

Clear a section in this dictionary, deleting all its properties.

void GetSetDictionary::erase ( const std::string &  section,
const std::string &  key 
)

Remove a single parameter from the dictionary.

GetSetDictionary::Dictionary & GetSetDictionary::get ( )

Direct access to sections of the dictionary. (used internally)

GetSetInternal::GetSetDataInterface * GetSetDictionary::getDatainterface ( const std::string &  section,
const std::string &  key 
) const

Check if section/key pair exists in this dictionary. If so, return the entry. (used internally)

std::string GetSetDictionary::getIni ( ) const

Returns a string with all values in Ini-file format.

std::string GetSetDictionary::getXML ( ) const

Returns a string with an xml description of this dictionary.

GetSetDictionary & GetSetDictionary::globalDictionary ( )
static
void GetSetDictionary::loadSection ( tinyxml2::XMLElement *  node,
const std::string &  section = "" 
)
protected
void GetSetDictionary::parseIni ( const std::string &  ini)

Add values from an ini file.

void GetSetDictionary::parseXML ( const std::string &  xml)

Add parameters and their values from an xml file.

void GetSetDictionary::signalChange ( const std::string &  section,
const std::string &  key 
)

This function is called when a variable in the dictionary changes. Calls Observer's notifyChange(...)

void GetSetDictionary::signalCreate ( const std::string &  section,
const std::string &  key 
)

This function is called when a variable in the dictionary was created (or changed type). Calls Observer's notifyCreate(...)

void GetSetDictionary::signalDestroy ( const std::string &  section,
const std::string &  key = "" 
)

This function is called right before a variable is removed from the dictionary. Key may be empty string if the section is removed completely.

Friends And Related Function Documentation

friend class GetSetDictionary::Observer
friend

Member Data Documentation

Dictionary GetSetDictionary::properties
protected
std::set<Observer*> GetSetDictionary::registered_observers
protected

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