| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

Classes | Public Types | Public Member Functions | Public Attributes | Private Attributes

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

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

`#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.

## Classes
struct | definition
struct | first
struct | second
## Public Types
typedef KeyGrammarT::ResultT | KeyT
typedef ValueGrammarT::ResultT | ValueT
typedef std::pair< KeyT, ValueT > | ResultT
typedef PairT | ResultT
typedef PairT::first_type | first_type
typedef PairT::second_type | second_type
## 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
void | setDelim (const std::string &delim)
| Set delimiters for pair values.
| PairGrammar ()
| PairGrammar (const std::string &delimeter)
void | init (const std::string &delimeter)
## Public Attributes
Grammar_< Iterator, typename PairT::first_type, Skipper > ::Grammar | key
Grammar_< Iterator, typename PairT::second_type, Skipper > ::Grammar | value
qi::rule< Iterator, char()> | begin
qi::rule< Iterator, void(char)> | end
qi::rule< Iterator, ResultT(), qi::locals< char >, Skipper > | pair
qi::rule< Iterator, ResultT(), Skipper > | pair_in
## Private Attributes
std::string | m_delim

## 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 358 of file Grammars.h.

## Member Typedef Documentation

template<typename KeyGrammarT , typename ValueGrammarT >

typedef PairT::first_type Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::first_type

Definition at line 242 of file GrammarsV2.h.

template<typename KeyGrammarT , typename ValueGrammarT >

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

Definition at line 367 of file Grammars.h.

template<typename KeyGrammarT , typename ValueGrammarT >

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

Definition at line 241 of file GrammarsV2.h.

template<typename KeyGrammarT , typename ValueGrammarT >

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

Definition at line 369 of file Grammars.h.

template<typename KeyGrammarT , typename ValueGrammarT >

typedef PairT::second_type Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::second_type

Definition at line 243 of file GrammarsV2.h.

template<typename KeyGrammarT , typename ValueGrammarT >

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

Definition at line 368 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 374 of file Grammars.h.

            : m_delim(delim) {}

template<typename KeyGrammarT , typename ValueGrammarT >

Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::PairGrammar | ( | ) | `[inline]`

Definition at line 245 of file GrammarsV2.h.

                      : PairGrammar::base_type(pair) {
            init(",");
        }

template<typename KeyGrammarT , typename ValueGrammarT >

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

Definition at line 249 of file GrammarsV2.h.

                                                : PairGrammar::base_type(pair) {
            init(delimeter);
        }

## Member Function Documentation

template<typename KeyGrammarT , typename ValueGrammarT >

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

Returns:
  Delimiter for pair values

Definition at line 403 of file Grammars.h.

    { return m_delim ; }

template<typename KeyGrammarT , typename ValueGrammarT >

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

Definition at line 255 of file GrammarsV2.h.

                                              {
          begin = enc::char_('(')[qi::_val=')']
                  |
                  enc::char_('[')[qi::_val=']'];
          end =  qi::char_(qi::_r1);
          pair = begin[qi::_a = qi::_1] >> pair_in[qi::_val = qi::_1] >> end(qi::_a);
          pair_in =  key >> qi::lit(delimeter) >> value;
        }

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 378 of file Grammars.h.

    { 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 380 of file Grammars.h.

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

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 407 of file Grammars.h.

    { m_delim = delim;}

## Member Data Documentation

template<typename KeyGrammarT , typename ValueGrammarT >

qi::rule<Iterator, char()> Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::begin

Definition at line 269 of file GrammarsV2.h.

template<typename KeyGrammarT , typename ValueGrammarT >

qi::rule<Iterator, void(char)> Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::end

Definition at line 270 of file GrammarsV2.h.

template<typename KeyGrammarT , typename ValueGrammarT >

Grammar_<Iterator, typename PairT::first_type, Skipper>::Grammar Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::key

Definition at line 265 of file GrammarsV2.h.

template<typename KeyGrammarT , typename ValueGrammarT >

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

Definition at line 409 of file Grammars.h.

template<typename KeyGrammarT , typename ValueGrammarT >

qi::rule<Iterator, ResultT(), qi::locals<char>, Skipper> Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::pair

Definition at line 271 of file GrammarsV2.h.

template<typename KeyGrammarT , typename ValueGrammarT >

qi::rule<Iterator, ResultT(), Skipper> Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::pair_in

Definition at line 272 of file GrammarsV2.h.

template<typename KeyGrammarT , typename ValueGrammarT >

Grammar_<Iterator, typename PairT::second_type, Skipper>::Grammar Gaudi::Parsers::PairGrammar< KeyGrammarT, ValueGrammarT >::value

Definition at line 268 of file GrammarsV2.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/GaudiKernel/Grammars.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/GaudiKernel/GrammarsV2.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines