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

BasicListParser Class Reference

#include <BasicListParser.h>

Inheritance diagram for BasicListParser:

Inheritance graph
[legend]
List of all members.

Public Methods

 BasicListParser ()
 Constructor. More...

virtual ~BasicListParser ()
 Destructor. More...

virtual bool parse (AIDA_STD::string a_string)=0
bool isValid ()
 This method returns true if parsing of pairs has been successful. More...

virtual void clear ()
 Method to clear up the list parser. Clears names and values vectors. More...

size_t count ()
 Number of pairs processed when parse succeeded. More...

void startTerm ()
 Move to first pair element. More...

void forthTerm ()
 Move to next pair element. More...

bool hasTerm ()
 True if current "list" of pairs has valid item. More...

const AIDA_STD::string getName ()
 Name of current pair element. More...

const AIDA_STD::string getValue ()
 Value of current pair element or name of the element to compare with. More...


Protected Types

typedef AIDA_STD::vector<
AIDA_STD::string > 
StringVector

Protected Attributes

StringVector pair_names_os
StringVector pair_values_os
size_t pair_count
size_t iter_index
bool parsing_successful

Detailed Description

Base class to parse and keep a list of pairs id/value. This class contains a pure virtual method, thus it can't be instantiated. The class maintains two lists for such pairs: a list of names and a list of their values. They can be retrieved via `getName' and `getValue'.

Definition at line 29 of file BasicListParser.h.


Member Typedef Documentation

typedef AIDA_STD::vector<AIDA_STD::string > StringVector [protected]
 

Definition at line 75 of file BasicListParser.h.


Constructor & Destructor Documentation

BasicListParser   [inline]
 

Definition at line 32 of file BasicListParser.h.

References iter_index, pair_count, and parsing_successful.

virtual ~BasicListParser   [inline, virtual]
 

Definition at line 34 of file BasicListParser.h.

References clear.


Member Function Documentation

virtual void clear   [inline, virtual]
 

Definition at line 43 of file BasicListParser.h.

References iter_index, pair_count, pair_names_os, pair_values_os, and parsing_successful.

Referenced by ConstList::parse, ~BasicListParser, and ConstList::~ConstList.

size_t count   [inline]
 

Definition at line 51 of file BasicListParser.h.

References pair_count.

Referenced by hasTerm.

void forthTerm   [inline]
 

Definition at line 67 of file BasicListParser.h.

References iter_index.

const AIDA_STD::string getName   [inline]
 

Definition at line 71 of file BasicListParser.h.

References iter_index, and pair_names_os.

const AIDA_STD::string getValue   [inline]
 

Definition at line 73 of file BasicListParser.h.

References iter_index, and pair_values_os.

bool hasTerm   [inline]
 

Definition at line 69 of file BasicListParser.h.

References count, and iter_index.

bool isValid   [inline]
 

Definition at line 41 of file BasicListParser.h.

References parsing_successful.

virtual bool parse AIDA_STD::string    a_string [pure virtual]
 

This method returns true if parsing of `a_string' has been successful. The method is pure virtual, thus must be implemented in subclasses. Updates pairs names and values to be looped over.

Implemented in ConstList.

void startTerm   [inline]
 

Looping over terms:

        startTerm();
        while( hasTerm() ) {
                ... getName();
                ... getValue();
                forthTerm();
        }
    

Definition at line 65 of file BasicListParser.h.

References iter_index.


Member Data Documentation

size_t iter_index [protected]
 

Definition at line 79 of file BasicListParser.h.

Referenced by BasicListParser, clear, forthTerm, getName, getValue, hasTerm, and startTerm.

size_t pair_count [protected]
 

Definition at line 78 of file BasicListParser.h.

Referenced by BasicListParser, clear, count, and ConstList::parse.

StringVector pair_names_os [protected]
 

Definition at line 76 of file BasicListParser.h.

Referenced by clear, getName, and ConstList::parseTerm.

StringVector pair_values_os [protected]
 

Definition at line 77 of file BasicListParser.h.

Referenced by clear, getValue, and ConstList::parseTerm.

bool parsing_successful [protected]
 

Definition at line 80 of file BasicListParser.h.

Referenced by BasicListParser, clear, isValid, and ConstList::parse.


The documentation for this class was generated from the following file:
Generated on Tue May 20 14:50:27 2003 for HepUtilities by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002