Changes between Version 8 and Version 9 of Documentation/Configuration


Ignore:
Timestamp:
Feb 4, 2010, 5:05:38 PM (15 years ago)
Author:
Christoph Mayer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Configuration

    v8 v9  
    2121function, as in the {{{main.cpp}}} of the !PingPong sample. The given configuration file will be read and is accessible throughout the whole process. You can check if there is a configuration file available using
    2222{{{
     23#!cpp
    2324if( Configuration::haveConfig() )
    2425}}}
    2526and get a reference to the configuration singleton using
    2627{{{
     28#!cpp
    2729Configuration& config = Configuration::instance();
    2830}}}
     
    3436where value can be a string, integer, or {{{true|false}}}. Reading from the configuration file is parametrized using the desired type:
    3537{{{
     38#!cpp
    3639string name = config.read<string>("name");
    3740int count = config.read<int>("count");
     
    4144The !PingPong sample uses the following to read the {{{endpoint}}} and {{{bootstrap.hints}}} from the configuration file:
    4245{{{
     46#!cpp
    4347if (config.exists("ariba.endpoints"))
    4448  ariba->setProperty("endpoints", config.read<string>("ariba.endpoints"));