DeSR Dependency Parser

IXE::Configuration Class Reference
[Configuration]

A Configuration object that holds all the configuration variables. More...

#include <conf.h>

List of all members.

Classes

class  Item

Public Types

typedef std::map< char const
*, Item * > 
Map

Static Public Member Functions

static void load (char const *file_name)
 Load configuration from file.
static void load (std::istream &is, Map *parameters=0, char const *="</desr>")
 Load configuration from stream.
static Map & variables ()
 Define and initialize (exactly once) a static data member for Conf and return a reference to it.
static void reset ()
 Reset all configuration variables to their default values.
static std::ostream & error (std::ostream &o=std::cerr)
static std::ostream & warning (std::ostream &o=std::cerr)

Friends

class Item
 An Item is the abstract base class for all configuration variables.


Detailed Description

A Configuration object that holds all the configuration variables.

Definition at line 54 of file conf.h.


Member Function Documentation

static void IXE::Configuration::load ( std::istream &  is,
Map *  parameters = 0,
char const *  = "</desr>" 
) [static]

Load configuration from stream.

Parameters:
is. Reading stops at first line equal to closing tag
close. Read only variables listed in
parameters. 

void IXE::Configuration::load ( char const *  file_name  )  [static]

Load configuration from file.

Parse the lines in a configuration file setting variables accordingly.

Parameters:
file_name The name of the configuration file to parse.

Definition at line 78 of file conf.cpp.

References IXE::io::MappedFileView::begin(), and IXE::io::MappedFileView::end().

Configuration::Map & IXE::Configuration::variables (  )  [static]

Define and initialize (exactly once) a static data member for Conf and return a reference to it.

The reason for this function is to guarantee that the map is initialized before its first use across all translation units, something that would not guaranteed if it were a static data member initialized at file scope.

Returns:
a reference to a static instance of an initialized Map.
SEE ALSO

Margaret A. Ellis and Bjarne Stroustrup. "The Annotated C++ Reference Manual." Addison-Wesley, Reading, MA, 1990. p. 19.

Definition at line 65 of file conf.cpp.

Referenced by reset().


Friends And Related Function Documentation

friend class Item [friend]

An Item is the abstract base class for all configuration variables.

It parses a given line and, based on the variable name, which is the first word on the line, dispatches to an appropriate instance of a derived class to parse the rest of the line.

Definition at line 138 of file conf.h.


The documentation for this class was generated from the following files:
 
Copyright © 2005-2007 G. Attardi. Generated on 13 Aug 2009 by doxygen 1.5.7.1.