Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Parameter Class Reference

======================================================================== Abstract class for the parameter administration. More...

#include <parameter.h>

Inheritance diagram for Parameter:

AddrFilter Analyse Filter Plugin Report aliasesAddrFilter lowercaseAddrFilter virtuserAddrFilter bmAnalyse ltAnalyse ltdAnalyse mfAnalyse mrAnalyse mtAnalyse xtAnalyse syslogFilter analysePlugin filterPlugin reportPlugin asciiReport htmlReport List of all members.

Public Types

enum  param_e {
  FLAG, G_FLAG, STRING, G_STRING,
  INTEGER, G_INTEGER, DATE, G_DATE
}

Public Methods

 Parameter ()
virtual std::map< std::string,
param_t > & 
Param (void)
virtual const char * Prefix (void) const=0
virtual const char * Name (void) const
virtual const char * Version (void) const
virtual const char * Author (void) const
virtual const char * Help (void) const
virtual ~Parameter ()

Protected Methods

void addParam (const std::string &prefix, const std::string &info, const std::string &help, const param_e typ, const std::string &value)
long getIntParam (const std::string &prefix)
std::string getStringParam (const std::string &prefix)
bool getFlagParam (const std::string &prefix)

Protected Attributes

std::map< std::string, param_tmapParam

Private Attributes

const char *const str_unknown
const char *const str_none

Detailed Description

======================================================================== Abstract class for the parameter administration.

This is the class on the top of the whole class hierarchy of this project. Every object is inherited by parameter. This class provides a universal interface for commandoline parameters.

Author:
Tobias Erbsland


Member Enumeration Documentation

enum Parameter::param_e
 

Every Parameter can have one this this four Types.

FLAG is a local flag like "--xxx-flagname". The initial value of such local flag should be "0". If the flag is set, the value is set to "1".

STRING is a local string like "--xxx-stringname=yyy". If the string is set, the vaule will by yyy in this example.

G_FLAG and G_STRING are the global versions of the types above.

Enumeration values:
FLAG 
G_FLAG 
STRING 
G_STRING 
INTEGER 
G_INTEGER 
DATE 
G_DATE 


Constructor & Destructor Documentation

Parameter::Parameter  
 

Parameter::~Parameter   [virtual]
 

Virtual deconstructor.


Member Function Documentation

void Parameter::addParam const std::string &    prefix,
const std::string &    info,
const std::string &    help,
const param_e    typ,
const std::string &    value
[protected]
 

This protected function is normaly used in the Constructor of every parameter object to add all needed parameters. A exception is the Plugin object. In this object a function beforeParam() exist to add new parameters on thy fly.

virtual const char* Parameter::Author void    const [inline, virtual]
 

Name of authors of the Object with Email in format "Firstname Lastname <email>" up to 40 chars.

Reimplemented in aliasesAddrFilter, analysePlugin, asciiReport, bmAnalyse, filterPlugin, htmlReport, lowercaseAddrFilter, ltAnalyse, ltdAnalyse, mfAnalyse, mrAnalyse, mtAnalyse, reportPlugin, syslogFilter, virtuserAddrFilter, and xtAnalyse.

bool Parameter::getFlagParam const std::string &    prefix [protected]
 

This function is like getIntParam, only with Flags. This function is usable too with STRING parameters.

long Parameter::getIntParam const std::string &    prefix [protected]
 

With this function every parameter object can check out a submitted integer parameter.

std::string Parameter::getStringParam const std::string &    prefix [protected]
 

With this function every parameter object can check out a submitted string parameter.

virtual const char* Parameter::Help void    const [inline, virtual]
 

A short helptext, or description to this object.

Reimplemented in aliasesAddrFilter, analysePlugin, asciiReport, bmAnalyse, filterPlugin, htmlReport, lowercaseAddrFilter, ltAnalyse, ltdAnalyse, mfAnalyse, mrAnalyse, mtAnalyse, reportPlugin, syslogFilter, virtuserAddrFilter, and xtAnalyse.

virtual const char* Parameter::Name void    const [inline, virtual]
 

Select a short Name for the parameter Object.

Reimplemented in aliasesAddrFilter, analysePlugin, asciiReport, bmAnalyse, filterPlugin, htmlReport, lowercaseAddrFilter, ltAnalyse, ltdAnalyse, mfAnalyse, mrAnalyse, mtAnalyse, reportPlugin, syslogFilter, virtuserAddrFilter, and xtAnalyse.

virtual std::map< std::string, param_t >& Parameter::Param void    [inline, virtual]
 

This function passes a reference to the parameter map inside every object.

virtual const char* Parameter::Prefix void    const [pure virtual]
 

This function returns a unique object prefix. Use only lowercase letters (a-z) and keep this name short as possible.

Implemented in aliasesAddrFilter, analysePlugin, asciiReport, bmAnalyse, filterPlugin, htmlReport, lowercaseAddrFilter, ltAnalyse, ltdAnalyse, mfAnalyse, mrAnalyse, mtAnalyse, reportPlugin, syslogFilter, virtuserAddrFilter, and xtAnalyse.

virtual const char* Parameter::Version void    const [inline, virtual]
 

Version up to 8 chars in the format V-.-

Reimplemented in aliasesAddrFilter, analysePlugin, asciiReport, bmAnalyse, filterPlugin, htmlReport, lowercaseAddrFilter, ltAnalyse, ltdAnalyse, mfAnalyse, mrAnalyse, mtAnalyse, reportPlugin, syslogFilter, virtuserAddrFilter, and xtAnalyse.


Member Data Documentation

std::map< std::string, param_t > Parameter::mapParam [protected]
 

This is the primary parameter map every object own. The function Param() let everyony access this map for read and write.

const char* const Parameter::str_none [private]
 

internal use.

const char* const Parameter::str_unknown [private]
 

internal use.


The documentation for this class was generated from the following files:
Generated on Wed Oct 15 13:54:52 2003 for Anteater.kdevelop by doxygen1.2.18