Image Component Library (ICL)
Public Types | Public Member Functions | List of all members
icl::utils::ParamList Struct Reference

Utility structure that utilizes an std::map as parameter list. More...

#include <ParamList.h>

Inheritance diagram for icl::utils::ParamList:

Public Types

typedef std::string Key
 The Key type (std::string) More...
 
typedef Any Value
 The Value type (icl::Any) More...
 

Public Member Functions

 ParamList ()
 creates an empty param list instance More...
 
 ParamList (const std::string &commaSepKeyValueString)
 creates a param list from a single given string More...
 
 ParamList (const char *commaSepKeyValueString)
 this allows for implicit creation of a ParamList instance from a given const char * More...
 
void init (const std::string commaSepKeyValueString)
 
 ParamList (const Key &key0, const Value &value0, const Key &key1="", const Value &value1="", const Key &key2="", const Value &value2="", const Key &key3="", const Value &value3="", const Key &key4="", const Value &value4="", const Key &key5="", const Value &value5="", const Key &key6="", const Value &value6="", const Key &key7="", const Value &value7="", const Key &key8="", const Value &value8="", const Key &key9="", const Value &value9="")
 Constructor, that can get up to 10 key-value pairs. More...
 
bool hasKey (const Key &key) const
 returns whether the map contains the given key More...
 
void removeKey (const Key &key)
 removes the given key from the map More...
 
const Anyoperator[] (const Key &key) const
 extension for the unconst operator that is provided by the std::map class More...
 

Detailed Description

Utility structure that utilizes an std::map as parameter list.

The ParamList is supposed to be used in function interfaces for passing several parameters as one argument. Usually this should only be used where efficiency is not compulsory

Member Typedef Documentation

◆ Key

typedef std::string icl::utils::ParamList::Key

The Key type (std::string)

◆ Value

The Value type (icl::Any)

Constructor & Destructor Documentation

◆ ParamList() [1/4]

icl::utils::ParamList::ParamList ( )
inline

creates an empty param list instance

◆ ParamList() [2/4]

icl::utils::ParamList::ParamList ( const std::string &  commaSepKeyValueString)
inline

creates a param list from a single given string

The string is a comma seperated list of key=value tokens. Both comma and the '='-character can be escaped using backslash

◆ ParamList() [3/4]

icl::utils::ParamList::ParamList ( const char *  commaSepKeyValueString)
inline

this allows for implicit creation of a ParamList instance from a given const char *

◆ ParamList() [4/4]

icl::utils::ParamList::ParamList ( const Key key0,
const Value value0,
const Key key1 = "",
const Value value1 = "",
const Key key2 = "",
const Value value2 = "",
const Key key3 = "",
const Value value3 = "",
const Key key4 = "",
const Value value4 = "",
const Key key5 = "",
const Value value5 = "",
const Key key6 = "",
const Value value6 = "",
const Key key7 = "",
const Value value7 = "",
const Key key8 = "",
const Value value8 = "",
const Key key9 = "",
const Value value9 = "" 
)
inline

Constructor, that can get up to 10 key-value pairs.

zero-length keys are skipped!

Member Function Documentation

◆ hasKey()

bool icl::utils::ParamList::hasKey ( const Key key) const
inline

returns whether the map contains the given key

This is just a shortcut to the find()-method that is provided by the std::map

◆ init()

void icl::utils::ParamList::init ( const std::string  commaSepKeyValueString)
inline

◆ operator[]()

const Any& icl::utils::ParamList::operator[] ( const Key key) const
inline

extension for the unconst operator that is provided by the std::map class

◆ removeKey()

void icl::utils::ParamList::removeKey ( const Key key)
inline

removes the given key from the map

This is just a shortcut to the find()-method that is provided by the std::map


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