| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT > Class Template Reference

`#include <Grammars.h>`

Inheritance diagram for Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >:

[legend]
Collaboration diagram for Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >:

[legend]
List of all members.

## Detailed Description

### template<typename KeyGrammarT, typename ValueGrammarT>
class Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >

The valid represenation of pairs are: ("abc",123) or ("abc","def") Inner types of pair depends on KeyGrammarT and ValueGrammarT grammars.

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 341 of file Grammars.h.

## Public Types
typedef KeyGrammarT::ResultT | KeyT
typedef ValueGrammarT::ResultT | ValueT
typedef std::pair< KeyT, ValueT > | ResultT
## Public Member Functions
| PairGrammar (const std::string &delim=",")
| Constructor.
void | matchFirst (const KeyT &first) const
| callback. Action when we match first value
void | matchSecond (const ValueT &second) const
| callback. Action when we match second value
const std::string & | delim () const
| Returns: Delimiter for pair values
void | setDelim (const std::string &delim)
| Set delimiters for pair values.
## Private Attributes
std::string | m_delim
## Classes
struct | definition

## Member Typedef Documentation

template<typename KeyGrammarT, typename ValueGrammarT>

typedef KeyGrammarT::ResultT Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::KeyT

Definition at line 350 of file Grammars.h.

template<typename KeyGrammarT, typename ValueGrammarT>

typedef ValueGrammarT::ResultT Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::ValueT

Definition at line 351 of file Grammars.h.

template<typename KeyGrammarT, typename ValueGrammarT>

typedef std::pair<KeyT,ValueT> Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::ResultT

Definition at line 352 of file Grammars.h.

## Constructor & Destructor Documentation

template<typename KeyGrammarT, typename ValueGrammarT>

Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::PairGrammar | ( | const std::string & | delim = `","` | ) | `[inline]`

Constructor.

Parameters:

  | delim | Delimiter for pair values

Definition at line 357 of file Grammars.h.

    00358         : m_delim(delim) {}

## Member Function Documentation

template<typename KeyGrammarT, typename ValueGrammarT>

void Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::matchFirst | ( | const KeyT & | first | ) | const`[inline]`

callback. Action when we match first value

Definition at line 361 of file Grammars.h.

Referenced by Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::definition< ScannerT >::definition().

    00361 { this->val().first = first; }

template<typename KeyGrammarT, typename ValueGrammarT>

void Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::matchSecond | ( | const ValueT & | second | ) | const`[inline]`

callback. Action when we match second value

Definition at line 363 of file Grammars.h.

References second.

Referenced by Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::definition< ScannerT >::definition().

    00363 { this->val().second = second; }

template<typename KeyGrammarT, typename ValueGrammarT>

const std::string& Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::delim | ( |  | ) | const`[inline]`

Returns:
  Delimiter for pair values

Definition at line 386 of file Grammars.h.

References Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::m_delim.

Referenced by Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::definition< ScannerT >::definition(), and Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::setDelim().

    00386 { return m_delim ; }

template<typename KeyGrammarT, typename ValueGrammarT>

void Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::setDelim | ( | const std::string & | delim | ) | `[inline]`

Set delimiters for pair values.

Parameters:

  | delim | Delimiter

Definition at line 390 of file Grammars.h.

References Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::delim(), and Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::m_delim.

    00390 { m_delim = delim;}

## Member Data Documentation

template<typename KeyGrammarT, typename ValueGrammarT>

std::string Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::m_delim`[private]`

Definition at line 392 of file Grammars.h.

Referenced by Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::delim(), and Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::setDelim().

The documentation for this class was generated from the following file:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiKernel/v25r2/GaudiKernel/Grammars.h