Kanzi Connect 3.9.10
kanzi::connect::ServerConfig::AttributeList Class Reference

List of configuration specific attributes. More...

#include <serverconfig.hpp>

Public Member Functions

void add (const string &name, const string &value, const string type="")
 Inserts attribute to attribute list.
 
void clear ()
 Clears the list.
 
bool contains (const string &name) const
 Does this list contain a named attribute?
 
size_t count () const
 Amount of attributes held.
 
bool getBool (const string &name, const bool defaultValue) const
 Retrieve boolean type attribute.
 
int getInt (const string &name, int defaultValue=0) const
 Retrieve integer type attribute.
 
double getReal (const string &name, const double defaultValue=0.0) const
 Retrieve floating point type attribute.
 
string getString (const string &name, string defaultValue="") const
 Retrieve string type attribute.
 
string getType (const string &name, const string defaultValue="") const
 Retrieve the optional type of the given attribute.
 
vector< string > keys () const
 All attribute names.
 
void setBool (const string &name, const bool value)
 Set the attribute value to be specific.
 
void setInt (const string &name, int value)
 Sets the attribute value.
 
void setReal (const string &name, const double value)
 Set the attribute value to be specific.
 
void setString (const string &name, string value)
 Set the attribute value to be specific.
 

Detailed Description

List of configuration specific attributes.

Member Function Documentation

◆ add()

void kanzi::connect::ServerConfig::AttributeList::add ( const string & name,
const string & value,
const string type = "" )

Inserts attribute to attribute list.

Parameters
namethe name of the attribute
valuevalue for the attribute
typeoptional type information for the attribute.

◆ clear()

void kanzi::connect::ServerConfig::AttributeList::clear ( )

Clears the list.

◆ contains()

bool kanzi::connect::ServerConfig::AttributeList::contains ( const string & name) const

Does this list contain a named attribute?

Parameters
thename
Returns
true if contains, false otherwise.

◆ count()

size_t kanzi::connect::ServerConfig::AttributeList::count ( ) const

Amount of attributes held.

Returns
amount

◆ getBool()

bool kanzi::connect::ServerConfig::AttributeList::getBool ( const string & name,
const bool defaultValue ) const

Retrieve boolean type attribute.

Parameters
namethe name of the attribute
defaultValuethe default value (optional) to return if not found.
Returns
Attribute value

◆ getInt()

int kanzi::connect::ServerConfig::AttributeList::getInt ( const string & name,
int defaultValue = 0 ) const

Retrieve integer type attribute.

Parameters
namethe name of the attribute
defaultValuethe default value (optional) to return if not found.
Returns
integer attribute value

◆ getReal()

double kanzi::connect::ServerConfig::AttributeList::getReal ( const string & name,
const double defaultValue = 0.0 ) const

Retrieve floating point type attribute.

Parameters
namethe name of the attribute
defaultValuethe default value (optional) to return if not found.
Returns
Attribute value

◆ getString()

string kanzi::connect::ServerConfig::AttributeList::getString ( const string & name,
string defaultValue = "" ) const

Retrieve string type attribute.

Parameters
namethe name of the attribute
defaultValuethe default value (optional) to return if not found.
Returns
string attribute value

◆ getType()

string kanzi::connect::ServerConfig::AttributeList::getType ( const string & name,
const string defaultValue = "" ) const

Retrieve the optional type of the given attribute.

Parameters
namethe name of the attribute
Returns
optinal type for the attribute.

◆ keys()

vector< string > kanzi::connect::ServerConfig::AttributeList::keys ( ) const

All attribute names.

Returns
list of attribute names.

◆ setBool()

void kanzi::connect::ServerConfig::AttributeList::setBool ( const string & name,
const bool value )

Set the attribute value to be specific.

Parameters
nameof the attribute to set
valuevalue of the attribute

◆ setInt()

void kanzi::connect::ServerConfig::AttributeList::setInt ( const string & name,
int value )

Sets the attribute value.

Parameters
namethe name of the attribute
valuenew value for the attribute.

◆ setReal()

void kanzi::connect::ServerConfig::AttributeList::setReal ( const string & name,
const double value )

Set the attribute value to be specific.

Parameters
nameof the attribute to set
valuevalue of the attribute

◆ setString()

void kanzi::connect::ServerConfig::AttributeList::setString ( const string & name,
string value )

Set the attribute value to be specific.

Parameters
nameof the attribute to set
valuevalue of the attribute

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