Tanl Linguistic Pipeline |
A Configuration object that holds all the configuration variables. More...
#include <conf.h>
Classes | |
class | Item |
Public Types | |
typedef std::map< char const *, Item * > | Map |
Static Public Member Functions | |
static void | load (char const *file_name) |
Parse the lines in a configuration file setting variables accordingly. | |
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. |
A Configuration object that holds all the configuration variables.
void IXE::Configuration::load | ( | char const * | file_name | ) | [static] |
Parse the lines in a configuration file setting variables accordingly.
file_name | The name of the configuration file to parse. |
Referenced by Tanl::NER::NER::NER(), and Tanl::SST::SST::SST().
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.
We also load the map with all configuration variable names so we can tell the difference between a variable that doesn't exist (and that we will complain about to the user) and one that simply isn't used in a particular executable (and will be silently ignored).
SEE ALSO
Margaret A. Ellis and Bjarne Stroustrup. "The Annotated C++ Reference Manual." Addison-Wesley, Reading, MA, 1990. p. 19.
Referenced by reset().
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.