Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

propertylist.h File Reference

List of properties for the configuration of the devices. More...

#include <string>
#include <iostream>
#include <map>
#include <utility>
#include <vector>
#include <stdexcept>
#include <simthetic/misc.h>

Go to the source code of this file.

Namespaces

namespace  simth

Defines

#define DLLIMPORT
#define EXPIMP_TEMPLATE
#define MSVC_WORKAROUND(x)   x

Functions

std::ostream & operator<< (std::ostream &os, const PropertyList &pl)
Property::StringPairList to_stringpairs (const char **a)


Detailed Description

List of properties for the configuration of the devices.


Define Documentation

#define DLLIMPORT
 

#define EXPIMP_TEMPLATE
 

#define MSVC_WORKAROUND  )     x
 


Function Documentation

std::ostream& operator<< std::ostream &  os,
const PropertyList &  pl
 

Output.

Property::StringPairList to_stringpairs const char **  a  ) 
 

Helper function to create a list of string pairs from an array of const char*, terminated by a 0 (zero, NULL). The element in the given array are, alternating, the first and the second element of each pair. I.e. you can write {"1st pair->first", "1st pair->second", "2nd pair->first", "2nd pair->second", 0} and so on.

However, since C++ does not allow anonymus char* arrays, you have to store the char array in a variable. I.e. you need to write

      simth::PropertyList pl;
      const char * a[] = { "option1", "explanation of option", "option2", "explanation", 0 };
      pl.addProperty("my_mode", "enum", "option1", "description of property", simth::to_stringpairs( a ));

Note:
Watch out -- if you forget the trailing 0 (zero, NULL) then this function will crash.


Generated on Mon Apr 24 21:19:19 2006 for simthetic by  doxygen 1.4.1