All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | Static Public Attributes | Friends | List of all members
entity::SetDescriptor Class Reference

A SetDescriptor (SD) is a set of pairs <key, value>, where the key is always a string, while the value may be an integer, a float or a string. More...

#include <SetDescriptor.h>

Public Member Functions

 SetDescriptor ()
 
void setSequenceNumber (int sn)
 
int getSequenceNumber () const
 
int size () const
 
const std::map< std::string,
std::string > & 
getStringFields () const
 
const std::map< std::string,
int > & 
getIntFields () const
 
const std::map< std::string,
float > & 
getFloatFields () const
 
bool existKey (const std::string &key)
 
bool hasValue (const std::string &key, const std::string &value)
 
bool hasValue (const std::string &key, int value)
 
bool hasValue (const std::string &key, float value)
 
void addValue (const std::string &key, const std::string &value)
 
void addValue (const std::string &key, int value)
 
void addValue (const std::string &key, float value)
 
template<typename T >
bool addKey (const std::string &key)
 
bool operator== (const SetDescriptor &other)
 
bool operator!= (const SetDescriptor &other)
 
template<>
bool addKey (const string &key)
 
template<>
bool addKey (const string &key)
 
template<>
bool addKey (const string &key)
 

Static Public Attributes

static const unsigned int MAX_FIELDS_NUMBER = 512
 

Friends

std::ostream & operator<< (std::ostream &os, const SetDescriptor &sd)
 

Detailed Description

A SetDescriptor (SD) is a set of pairs <key, value>, where the key is always a string, while the value may be an integer, a float or a string.

The SD is implemented by a map for each of the three possible combinations. The SD has a Sequence Number (SN), which is a normal field within the DSS configuration file but in the resulting SD object is a class member.

Constructor & Destructor Documentation

SetDescriptor::SetDescriptor ( )

Max fields number allowed.

Member Function Documentation

template<typename T >
bool entity::SetDescriptor::addKey ( const std::string &  key)

Add a new key but without its value. The type of the value is the template parameter.

Parameters
keyThe key of the new field. It can't be an empty string.
Returns
true if the insert operation succeeds, false otherwise.
bool SetDescriptor::existKey ( const std::string &  key)
Parameters
keyThe key of a certain field.
Returns
true if the SetDescriptor has a field with the key <key>, false otherwise.
int SetDescriptor::size ( ) const
Returns
SetDescriptor fields number, including the "extra" field for the sequence number. "

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