| # Gaudi Framework, version v21r11 |

Home |  | Generated: 30 Sep 2010

# Gaudi::Parsers Namespace Reference

## Classes
struct | ClosureGrammar
| Grammar or grammar rule which derive from this struct will have attribute of type `T` and name `val`. More...
struct | AttributesClosureGrammar
| Grammar or grammar rule which derive from this struct will have two attributes: type `T1` and name `val`, type `T2` and name `attrs`. More...
class | BoolGrammar
| The valid represenation of boolean values are:. More...
class | CharGrammar
| The valid represenation of char values are:. More...
class | IntGrammar
| The valid representation of integers values are:. More...
class | RealGrammar
| The valid represenation of real values are:. More...
class | StringGrammar
| The valid represenation of string values are:. More...
class | SkipperGrammar
| Skipping spaces and comments. More...
class | PairGrammar
| The valid represenation of pairs are: ("abc",123) or ("abc","def") Inner types of pair depends on KeyGrammarT and ValueGrammarT grammars. More...
class | VectorGrammar
| The valid represenation of vector are: {"abc","defj","i"} or {1,2,3,4,5} ["abc","defj","i"] or [1,2,3,4,5] Inner type depends on GrammarT grammar. More...
class | MapGrammar
| The valid represenation of map are: {"file1":"path1","something":"nothing"} {"file1"="path1","something"="nothing"} ["file1":10,"something":20] ["file1"=30,"something"=40] Inner key type depends on KeyGrammarT grammar Inner value type depends on ValueGrammarT grammar. More...
class | Pnt3DGrammar
| The grammar for 3D-point. More...
class | Pnt4DGrammar
| The grammar for 4D-point. More...
class | Histo1DGrammar
| The simple grammar for histogram description/definition:. More...
struct | _NoCaseCmp_
| case-insensitive comparison criteria for strings More...
class | Catalogue
| Catalogue of PropertyEntry. More...
class | PropertyEntry
class | PushBackImpl
class | PushBackRefImpl
class | AssignBoolToStringImpl
class | IdentifierGrammar
| Recognize alphanumeric strings and _ starting with alpha: Example, abc, ab_cd123, a_12. More...
class | PropertyGrammar
| Recognize property Example, A.B, A::B::C.D, A::B.C::D.E. More...
class | RealUnitsGrammar
| The valid represenation of reals with units are 1, 1.0, 1.0e+2, 1e-2, 0.5mm, 0.5 mm, 0.5*mm. More...
class | UnitsFileGrammar
| The valid represenation units file: `1 cm = 10 1 m = 1000` . More...
class | ValueGrammar
| Grammar recognize value that can appear in right side of '=' operator in job options file. More...
class | ParserGrammar
| Grammar recognize job options file `Grammar's EBNF: `job_options_file ::= (platform_statement | platform_dependency)*.`` More...
class | Message
| Parser message interface. More...
class | Parser
| Parser controller. More...
class | Position
| Parser position entity. More...
## Namespaces
namespace | Utils
## Typedefs
typedef boost::spirit::position_iterator < string::const_iterator > | IteratorT
| the actual type of position iterator
typedef AttributesClosureGrammar < boost::tuple< std::string, std::vector< std::string > >, boost::tuple< int > > | ValueClosureT
typedef AttributesClosureGrammar < IteratorT, boost::tuple < bool, std::string, std::vector< std::string > > > | ParserClosureT
## Functions
template<class TYPE, std::size_t N>
StatusCode | parse (boost::array< TYPE, N > &result, const std::string &input)
| parse class boost::array from the string
GAUDI_API StatusCode | parse (bool &result, const std::string &input)
| parse the `bool` value
GAUDI_API StatusCode | parse (char &result, const std::string &input)
| parse the `char` value
GAUDI_API StatusCode | parse (unsigned char &result, const std::string &input)
GAUDI_API StatusCode | parse (signed char &result, const std::string &input)
GAUDI_API StatusCode | parse (int &result, const std::string &input)
| parse the `int` value
GAUDI_API StatusCode | parse (short &result, const std::string &input)
GAUDI_API StatusCode | parse (unsigned short &result, const std::string &input)
GAUDI_API StatusCode | parse (unsigned int &result, const std::string &input)
GAUDI_API StatusCode | parse (long &result, const std::string &input)
GAUDI_API StatusCode | parse (unsigned long &result, const std::string &input)
GAUDI_API StatusCode | parse (long long &result, const std::string &input)
GAUDI_API StatusCode | parse (unsigned long long &result, const std::string &input)
GAUDI_API StatusCode | parse (double &result, const std::string &input)
| parse the `double` value
GAUDI_API StatusCode | parse (float &result, const std::string &input)
GAUDI_API StatusCode | parse (long double &result, const std::string &input)
GAUDI_API StatusCode | parse (std::string &result, const std::string &input)
| parse the `std::string` value
GAUDI_API StatusCode | parse (std::vector< bool > &result, const std::string &input)
| parse the `std::vector<bool>` value
GAUDI_API StatusCode | parse (std::vector< char > &result, const std::string &input)
| parse the `std::vector<char>` value
GAUDI_API StatusCode | parse (std::vector< unsigned char > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< signed char > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< int > &result, const std::string &input)
| parse the `std::vector<int>` value
GAUDI_API StatusCode | parse (std::vector< short > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< unsigned short > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< unsigned int > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< long > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< unsigned long > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< long long > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< unsigned long long > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< double > &result, const std::string &input)
| parse the `std::vector<double>` value
GAUDI_API StatusCode | parse (std::vector< float > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< long double > &result, const std::string &input)
GAUDI_API StatusCode | parse (std::vector< std::string > &result, const std::string &input)
| parse the `std::vector<std::string>` value
GAUDI_API StatusCode | parse (std::pair< double, double > &result, const std::string &input)
| parse the `std::pair<double,double>` value
GAUDI_API StatusCode | parse (std::pair< int, int > &result, const std::string &input)
| parse the `std::pair<int,int>` value
GAUDI_API StatusCode | parse (std::vector< std::pair< double, double > > &result, const std::string &input)
| parse the `std::vector<std::pair<double,double> >` value
GAUDI_API StatusCode | parse (std::vector< std::pair< int, int > > &result, const std::string &input)
| parse the `std::vector<std::pair<int,int> >` value
GAUDI_API StatusCode | parse (std::vector< std::vector< std::string > > &result, const std::string &input)
| parse the `std::vector<std::vector<std::string> >` value
GAUDI_API StatusCode | parse (std::vector< std::vector< double > > &result, const std::string &input)
| parse the `std::vector<std::vector<double> >` value
GAUDI_API StatusCode | parse (std::map< int, int > &result, const std::string &input)
| parse the `std::map<int , int>` value
GAUDI_API StatusCode | parse (std::map< int, double > &result, const std::string &input)
| parse the `std::map<int , double>` value
GAUDI_API StatusCode | parse (std::map< std::string, std::string > &result, const std::string &input)
| parse the `std::map<std::string , std::string>` value
GAUDI_API StatusCode | parse (std::map< std::string, int > &result, const std::string &input)
| parse the `std::map<std::string , int>` value
GAUDI_API StatusCode | parse (std::map< std::string, double > &result, const std::string &input)
| parse the `std::map<std::string , double>` value
GAUDI_API StatusCode | parse (std::map< std::string, std::vector< std::string > > &result, const std::string &input)
| parse the `std::map<std::string , std::vector<std::string> >` value
GAUDI_API StatusCode | parse (std::map< std::string, std::vector< int > > &result, const std::string &input)
| parse the `std::map<std::string , std::vector<int> >` value
GAUDI_API StatusCode | parse (std::map< std::string, std::vector< double > > &result, const std::string &input)
| parse the `std::map<std::string , std::vector<double> >` value
GAUDI_API StatusCode | parse (std::map< int, std::string > &result, const std::string &input)
| parse the `std::map<int,std::string> >` objects
GAUDI_API StatusCode | parse (std::map< unsigned int, std::string > &result, const std::string &input)
| parse the `std::map<unsigned int,std::string> >` objects
GAUDI_API StatusCode | parse (std::map< std::string, unsigned int > &result, const std::string &input)
| parse the `std::map<unsigned int,std::string> >` objects
GAUDI_API StatusCode | parse (std::string &name, std::string &value, const std::string &input)
| parse the pair expression (map-component) " 'name' :value"
GAUDI_API StatusCode | parse (Gaudi::Histo1DDef &histo, const std::string &input)
| helper function, needed for implementation of "Histogram Property"
GAUDI_API StatusCode | parse (std::map< std::string, Gaudi::Histo1DDef > &histos, const std::string &input)
| helper function, needed for implementation of "Histogram Property"
GAUDI_API StatusCode | parse (std::map< std::string, std::pair< double, double > > &params, const std::string &input)
| helper function, needed for implementation of map of pairs It is very useful construction for monitoring to represent the value and error or the allowed range for some parameter
template<class T, unsigned int N>
StatusCode | parse (T(&result)[N], const std::string &input)
| parser function for C-arrays
template<unsigned int N>
StatusCode | parse (char(&result)[N], const std::string &input)
| parser function for C-strings
IteratorT | createIterator (const std::string &input)
| create the position iterator from the input
template<typename IntegerT>
StatusCode | parse_integer (IntegerT &result, const string &input)
| helper function to "merge" the implementation of all parsers for integer-like quantities into one templated grammar
template<typename IntegerT>
StatusCode | parse_integer_vector (std::vector< IntegerT > &result, const string &input)
| helper function to "merge" the implementation of all parsers for vector of integer-like quantities into the combination of templated grammars
template<typename CharT>
StatusCode | parse_char (CharT &result, const string &input)
| helper function to "merge" the implementation of all parsers for "char-like" quantities into one templated grammar
template<typename CharT>
StatusCode | parse_char_vector (std::vector< CharT > &result, const string &input)
| helper function to "merge" the implementation of all parsers for vector of 'char-like' quantities into the combination of templated grammars
template<typename RealT>
StatusCode | parse_real (RealT &result, const string &input)
| helper function to "merge" the implementation of all parsers for "float-like" quantities into one templated grammar
template<typename RealT>
StatusCode | parse_real_vector (std::vector< RealT > &result, const string &input)
| helper function to "merge" the implementation of all parsers for vector of 'char-like' quantities into the combination of templated grammars
GAUDI_API StatusCode | parse (Gaudi::StringKey &result, const std::string &input)
| parse the key from the string
GAUDI_API StatusCode | parse (std::vector< Gaudi::StringKey > &result, const std::string &input)
| parse the vector of keys from the string
template<class SCALAR, unsigned int N>
StatusCode | parse (ROOT::Math::SVector< SCALAR, N > &result, const std::string &input)
| parse SVector
GAUDI_API StatusCode | parse (Gaudi::XYZPoint &result, const std::string &input)
| parse 3D-point
GAUDI_API StatusCode | parse (Gaudi::XYZVector &result, const std::string &input)
| parse 3D-vector
GAUDI_API StatusCode | parse (Gaudi::LorentzVector &result, const std::string &input)
| parse LorentzVector
GAUDI_API StatusCode | parse (std::vector< Gaudi::XYZPoint > &result, const std::string &input)
| parse the vector of points
GAUDI_API StatusCode | parse (std::vector< Gaudi::XYZVector > &result, const std::string &input)
| parse the vector of vectors
GAUDI_API StatusCode | parse (std::vector< Gaudi::LorentzVector > &result, const std::string &input)
| parse the vector of vectors
template<class T>
phoenix::actor< PushBackImpl< T > > | PushBack (T &x)
template<class T, typename IT>
phoenix::actor < PushBackRefImpl< T, IT > > | PushBack (T &x, IT it)
template<class T>
phoenix::actor < AssignBoolToStringImpl< T > > | AssignBoolToString (T &x)
StatusCode | parse (Parser parser, const std::string &fileName, std::vector< Message > &msgs)
| Parse job options fiel using the configured parser object.
StatusCode | parse (const std::string &filename, const std::vector< std::string > &searchPath, Catalogue &catalogue, std::vector< std::string > &included, std::vector< Message > &messages)
| Parse job options file.
StatusCode | parse (const std::string &filename, const std::string &searchPath, Catalogue &catalogue, std::vector< std::string > &included, std::vector< Message > &messages)
| Parse job options file.
StatusCode | parse (const std::string &filename, Catalogue &catalogue, std::vector< std::string > &included, std::vector< Message > &messages)
| Parse job options file.

## Typedef Documentation

typedef boost::spirit::position_iterator< std::string::const_iterator > Gaudi::Parsers::IteratorT

the actual type of position iterator

Definition at line 64 of file Parsers.icpp.

typedef AttributesClosureGrammar<IteratorT,boost::tuple<bool,std::string,std::vector<std::string> > > Gaudi::Parsers::ParserClosureT

Definition at line 441 of file ParserGrammar.h.

typedef AttributesClosureGrammar<boost::tuple<std::string,std::vector<std::string> > , boost::tuple<int> > Gaudi::Parsers::ValueClosureT

Definition at line 287 of file ParserGrammar.h.

## Function Documentation

template<class T>

phoenix::actor<AssignBoolToStringImpl<T> > Gaudi::Parsers::AssignBoolToString | ( | T & | x | ) | `[inline]`

Definition at line 95 of file ParserActions.h.

    00095                                                                                                         {
    00096       return AssignBoolToStringImpl<T> (x);
    00097     }

IteratorT Gaudi::Parsers::createIterator | ( | const std::string & | input | ) | `[inline]`

create the position iterator from the input

Definition at line 67 of file Parsers.icpp.

    00068     { return IteratorT ( input.begin(), input.end() ) ; }

StatusCode Gaudi::Parsers::parse | ( | const std::string & | filename,
|  | Catalogue & | catalogue,
|  | std::vector< std::string > & | included,
|  | std::vector< Message > & | messages |
| ) |  |  |

Parse job options file.

Returns:
  StatusCode::SUCCESS if no errors

Parameters:

  | filename | Path to options file
  | Catalogue | of parser properties
  | included | Already included files
  | List | of parser messages

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

Date:
  2006-02-17

Definition at line 75 of file ParserUtils.cpp.

    00078                                     {
    00079   return parse
    00080     (Gaudi::Parsers::Parser(catalogue,included),filename,msgs);
    00081 }

StatusCode Gaudi::Parsers::parse | ( | const std::string & | filename,
|  | const std::string & | searchPath,
|  | Catalogue & | catalogue,
|  | std::vector< std::string > & | included,
|  | std::vector< Message > & | messages |
| ) |  |  |

Parse job options file.

Returns:
  StatusCode::SUCCESS if no errors

Parameters:

  | filename | Path to options file
  | searchPath | Directories for search include and units files
  | Catalogue | of parser properties
  | included | Already included files
  | List | of parser messages

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

Date:
  2006-02-17

Definition at line 63 of file ParserUtils.cpp.

    00068 {
    00069   return parse
    00070     ( Gaudi::Parsers::Parser (catalogue , included, searchPath ) ,
    00071       filename ,  msgs ) ;
    00072 }

StatusCode Gaudi::Parsers::parse | ( | const std::string & | filename,
|  | const std::vector< std::string > & | searchPath,
|  | Catalogue & | catalogue,
|  | std::vector< std::string > & | included,
|  | std::vector< Message > & | messages |
| ) |  |  |

Parse job options file.

Returns:
  StatusCode::SUCCESS if no errors

Parameters:

  | filename | Path to options file
  | searchPath | Directories for search include and units files
  | Catalogue | of parser properties
  | included | Already included files
  | List | of parser messages

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

Date:
  2006-02-17

Definition at line 51 of file ParserUtils.cpp.

    00056 {
    00057   return parse
    00058     ( Gaudi::Parsers::Parser(catalogue, included, searchPath) ,
    00059       filename , msgs ) ;
    00060 }

StatusCode Gaudi::Parsers::parse | ( | Parser | parser,
|  | const std::string & | fileName,
|  | std::vector< Message > & | msgs |
| ) |  |  |

Parse job options fiel using the configured parser object.

Author:
  Vanya BELYAEV ibelyaev@phsycis.syr.edu

Date:
  2006-06-28

Definition at line 41 of file ParserUtils.cpp.

    00044 {
    00045   StatusCode res = parser.parse(fileName);
    00046   msgs = parser.messages();
    00047   return res;
    00048 }

StatusCode Gaudi::Parsers::parse | ( | std::vector< Gaudi::LorentzVector > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the vector of vectors

Parameters:

  | resut | (OUTPUT) the parser vector
  | input | (INPIUT) the string to be parsed

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-05

Definition at line 224 of file ParseVct.cpp.

    00226 {
    00227   result.clear() ;
    00228
    00229   // the grammar
    00230   VectorGrammar < Pnt4DGrammar<RealGrammar<double>,Gaudi::LorentzVector> >  g ;
    00231
    00232   if ( parse ( input.begin () ,
    00233                input.end   () ,
    00234                g[var(result)=arg1],SkipperGrammar()).full )
    00235   { return StatusCode::SUCCESS ; }                                  // RETURN
    00236   //
    00237   return StatusCode::FAILURE ;
    00238 }

StatusCode Gaudi::Parsers::parse | ( | std::vector< Gaudi::XYZVector > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the vector of vectors

Parameters:

  | resut | (OUTPUT) the parser vector
  | input | (INPIUT) the string to be parsed

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-05

Definition at line 199 of file ParseVct.cpp.

    00201 {
    00202   result.clear() ;
    00203
    00204   // the grammar
    00205   VectorGrammar < Pnt3DGrammar<RealGrammar<double>,Gaudi::XYZVector> >  g ;
    00206
    00207   if ( parse ( input.begin () ,
    00208                input.end   () ,
    00209                g[var(result)=arg1],SkipperGrammar()).full )
    00210   { return StatusCode::SUCCESS ; }                                  // RETURN
    00211   //
    00212   return StatusCode::FAILURE ;
    00213 }

StatusCode Gaudi::Parsers::parse | ( | std::vector< Gaudi::XYZPoint > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the vector of points

Parameters:

  | resut | (OUTPUT) the parser vector
  | input | (INPIUT) the string to be parsed

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-05

Definition at line 175 of file ParseVct.cpp.

    00177 {
    00178   result.clear() ;
    00179
    00180   // the grammar
    00181   VectorGrammar < Pnt3DGrammar<RealGrammar<double>,Gaudi::XYZPoint> >  g ;
    00182
    00183   if ( parse ( input.begin () ,
    00184                input.end   () ,
    00185                g[var(result)=arg1],SkipperGrammar()).full )
    00186   { return StatusCode::SUCCESS ; }                                  // RETURN
    00187   //
    00188   return StatusCode::FAILURE ;
    00189 }

StatusCode Gaudi::Parsers::parse | ( | Gaudi::LorentzVector & | result,
|  | const std::string & | input |
| ) |  |  |

parse LorentzVector

Valid representations of Lorenzt vector

- a'la python tuple with 4 elements ("canonical")
- a'la python list with 4 elements
- python/list with inner representation of 3D-point/vector
- tuple or list with named ordered fields

        " (1,2,3,4) "
        " (1,2,3;4) "

        " [1,2,3,4] "
        " [1,2,3;4] "

        " [ x:1 ,2,3; e= 4] "
        " [ pX : 1 , PY : 2, 3 , T= 4] "

        " [ ( pX : 1 , PY : 2, 3 ) , 4] "
        " [ ( pX : 1 , PY : 2, 3 ) ; 4] "

        " [ 4 , ( pX : 1 , PY : 2, 3 ) ] "
        " [ 4 ; ( pX : 1 , PY : 2, 3 ) ] "

        " [ [ pX : 1 , PY : 2, 3 ] , 4] "
        " [ [ pX : 1 , PY : 2, 3 ] ; 4] "

        " [ 4 , [ pX : 1 , PY : 2, 3 ] ] "
        " [ 4 ; [ pX : 1 , PY : 2, 3 ] ] "

        " ( ( pX : 1 , PY : 2, 3 ) , 4 )"
        " ( ( pX : 1 , PY : 2, 3 ) ; 4 )"

        " ( 4 , ( pX : 1 , PY : 2, 3 ) )"
        " ( 4 ; ( pX : 1 , PY : 2, 3 ) )"

        " ( [ pX : 1 , PY : 2, 3 ] , 4 )"
        " ( [ pX : 1 , PY : 2, 3 ] ; 4 )"

        " ( 4 , [ pX : 1 , PY : 2, 3 ] )"
        " ( 4 ; [ pX : 1 , PY : 2, 3 ] )"

Note that "eenrgy" element can be separated with semicolumn.

Valid keys for names fields:

        "x", "X" , "pX" , "Px" , "PX "
        "y", "Y" , "pY" , "Py" , "PY "
        "z", "Z" , "pZ" , "Pz" , "PZ "
        "t", "T" , "e"  , "E"

Attention:
  Named fields must be ordered `(x,y,z)`

Parameters:

  | result | (output) the parsed lorentz vector
  | input | (input) the input string

Returns:
  status code

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-05

Definition at line 127 of file ParseVct.cpp.

    00129 {
    00130   // the grammar
    00131   Pnt4DGrammar<RealGrammar<double>,Gaudi::LorentzVector> g ;
    00132
    00133
    00134   if ( parse ( input.begin () ,
    00135                input.end   () ,
    00136                g[var(result)=arg1],SkipperGrammar()).full )
    00137   { return StatusCode::SUCCESS ; } // RETURN
    00138
    00139   // try map:
    00140   MAP m ;
    00141   StatusCode sc = parse ( m , input ) ;
    00142
    00143   if ( sc.isFailure () ) { return sc                  ; } // RETURN
    00144   if ( 4 != m.size  () ) { return StatusCode::FAILURE ; } // REUTRN
    00145
    00146   MAP::const_iterator x = find ( m , s_X ) ;
    00147   MAP::const_iterator y = find ( m , s_Y ) ;
    00148   MAP::const_iterator z = find ( m , s_Z ) ;
    00149   MAP::const_iterator e = find ( m , s_E ) ;
    00150
    00151   if ( m.end() == x ||
    00152        m.end() == y ||
    00153        m.end() == z ||
    00154        m.end() == e ) { return StatusCode::FAILURE ; } // RETURN
    00155
    00156   result.SetXYZT ( x->second ,
    00157                    y->second ,
    00158                    z->second ,
    00159                    e->second ) ;
    00160
    00161   return StatusCode::SUCCESS ;
    00162
    00163 }

StatusCode Gaudi::Parsers::parse | ( | Gaudi::XYZVector & | result,
|  | const std::string & | input |
| ) |  |  |

parse 3D-vector

Valid representations of 3D-vector:

- a'la python tuple with 3 elements ("canonical")
- a'la python list with 3 elements
- tuple or list with named ordered fields

        " (1,2,3) "
        " [1,2,3] "
        " [ x : 1, 2, Z:3 ] "
        " [ pX : 1 , PY : 2, 3] "

Valid keys for names fields:

        "x", "X" , "pX" , "Px" , "PX "
        "y", "Y" , "pY" , "Py" , "PY "
        "z", "Z" , "pZ" , "Pz" , "PZ "

Attention:
  Named fields must be ordered `(x,y,z)`

Parameters:

  | result | (output) the parsed vector
  | input | (input) the input string

Returns:
  status code

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-05

Definition at line 104 of file ParseVct.cpp.

    00106 {
    00107
    00108   Gaudi::XYZPoint point ;
    00109
    00110   StatusCode sc = parse ( point , input ) ;
    00111   if ( sc.isFailure() ){ return sc ; }                               // RETURN
    00112
    00113   result = point ;
    00114   return StatusCode::SUCCESS ;                                       // RETURN
    00115 }

StatusCode Gaudi::Parsers::parse | ( | Gaudi::XYZPoint & | result,
|  | const std::string & | input |
| ) |  |  |

parse 3D-point

Valid representations of 3D-point:

- a'la python tuple with 3 elements ("canonical")
- a'la python list with 3 elements
- tuple or list with named ordered fields

        " (1,2,3) "
        " [1,2,3] "
        " [ x : 1, 2, Z:3 ] "
        " [ pX : 1 , PY : 2, 3] "

Valid keys for names fields:

        "x", "X" , "pX" , "Px" , "PX "
        "y", "Y" , "pY" , "Py" , "PY "
        "z", "Z" , "pZ" , "Pz" , "PZ "

Attention:
  Named fields must be ordered `(x,y,z)`

Parameters:

  | result | (output) the parsed point
  | input | (input) the input string

Returns:
  status code

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-05

Definition at line 61 of file ParseVct.cpp.

    00063 {
    00064   // the grammar
    00065   Pnt3DGrammar<RealGrammar<double>,Gaudi::XYZPoint> g ;
    00066
    00067   if ( parse ( input.begin () ,
    00068                input.end   () ,
    00069                g[var(result)=arg1],SkipperGrammar()).full )
    00070   { return StatusCode::SUCCESS ; } // RETURN
    00071
    00072   // try map:
    00073   MAP m ;
    00074   StatusCode sc = parse ( m , input ) ;
    00075
    00076   if ( sc.isFailure () ) { return sc                  ; } // RETURN
    00077   if ( 3 != m.size  () ) { return StatusCode::FAILURE ; } // REUTRN
    00078
    00079   MAP::const_iterator x = find ( m , s_X ) ;
    00080   MAP::const_iterator y = find ( m , s_Y ) ;
    00081   MAP::const_iterator z = find ( m , s_Z ) ;
    00082
    00083   if ( m.end() == x ||
    00084        m.end() == y ||
    00085        m.end() == z  ) { return StatusCode::FAILURE ; } // RETURN
    00086
    00087   result.SetXYZ ( x->second ,
    00088                   y->second ,
    00089                   z->second ) ;
    00090
    00091   return StatusCode::SUCCESS ;
    00092
    00093 }

template<class SCALAR, unsigned int N>

StatusCode Gaudi::Parsers::parse | ( | ROOT::Math::SVector< SCALAR, N > & | result,
|  | const std::string & | input |
| ) |  |  | `[inline]`

parse SVector

Parameters:

  | result | (output) the parsed vector
  | input | (input) the input string

Returns:
  status code

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-05

Definition at line 47 of file SVectorAsProperty.h.

    00049     {
    00050       std::vector<double> tmp ;
    00051       StatusCode sc = parse ( tmp , input ) ;
    00052       if ( sc.isFailure()  ) { return sc                  ; } // RETURN
    00053       if ( N != tmp.size() ) { return StatusCode::FAILURE ; } // RETURN
    00054       std::copy ( tmp.begin() , tmp.end() , result.begin() ) ;
    00055       return StatusCode::SUCCESS ;
    00056     }

StatusCode Gaudi::Parsers::parse | ( | std::vector< Gaudi::StringKey > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the vector of keys from the string

See also:
  Gaudi::Parsers

  Gaudi::Parsers::parse

  Gaudi::StringKey

Attention:
  : this function is needed to use it as property

Parameters:

  | result | (OUTPUT) the parsing result
  | input | the input string

Returns:
  status code

Definition at line 99 of file StringKey.cpp.

    00101 {
    00102   result.clear() ;
    00103   typedef std::vector<std::string> Strings ;
    00104   Strings _result ;
    00105   StatusCode sc = parse ( _result , input ) ;
    00106   if ( sc.isFailure() ) { return sc ; }                              // RETURN
    00107   result.reserve ( _result.size() ) ;
    00108   //
    00109   std::copy ( _result.begin() ,
    00110               _result.end  () , std::back_inserter ( result ) ) ;
    00111   //
    00112   return StatusCode::SUCCESS ;
    00113 }

StatusCode Gaudi::Parsers::parse | ( | Gaudi::StringKey & | result,
|  | const std::string & | input |
| ) |  |  |

parse the key from the string

See also:
  Gaudi::Parsers

  Gaudi::Parsers::parse

  Gaudi::StringKey

Attention:
  : this function is needed to use it as property

Parameters:

  | result | (OUTPUT) the parsing result
  | input | the input string

Returns:
  status code

Definition at line 79 of file StringKey.cpp.

    00081 {
    00082   std::string _result ;
    00083   StatusCode sc = parse ( _result , input ) ;
    00084   result = Gaudi::StringKey ( _result ) ;
    00085   return sc ;
    00086 }

template<unsigned int N>

StatusCode Gaudi::Parsers::parse | ( | char(&) | result[N],
|  | const std::string & | input |
| ) |  |  | `[inline]`

parser function for C-strings

Parameters:

  | params | C-string
  | input | the string to be parsed

Returns:
  status code

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-15

Definition at line 672 of file Parsers.h.

    00673     {
    00674       // clear the string
    00675       std::fill_n ( result , N , ' ' ) ;
    00676       // create the temporary string
    00677       std::string tmp ;
    00678       StatusCode sc = parse ( tmp , input ) ;
    00679       if ( sc.isFailure()  ) { return sc                 ; }  //  RETURN
    00680       if       ( N     == tmp.size() )
    00681       { std::copy ( tmp.begin() , tmp.end() , result ) ; }
    00682       else if  ( N + 2    == tmp.size()                 &&
    00683                  ( '\''   == tmp[0] || '\"' == tmp[0] ) &&
    00684                  ( tmp[0] == tmp[tmp.size()-1]          ))
    00685       { std::copy ( tmp.begin() + 1 , tmp.end() -1 , result ) ; }
    00686       else { return StatusCode::FAILURE ; }
    00687       //
    00688       return StatusCode::SUCCESS ;                            //  RETURN
    00689     }

template<class T, unsigned int N>

StatusCode Gaudi::Parsers::parse | ( | T(&) | result[N],
|  | const std::string & | input |
| ) |  |  | `[inline]`

parser function for C-arrays

Parameters:

  | params | C-array
  | input | the string to be parsed

Returns:
  status code

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-15

Definition at line 650 of file Parsers.h.

    00651     {
    00652       typedef std::vector<T> _Vct ;
    00653       // create the temporary vector
    00654       _Vct tmp ;
    00655       StatusCode sc = parse ( tmp , input ) ;
    00656       if ( sc.isFailure()  ) { return sc                  ; }  //  RETURN
    00657       if ( N != tmp.size() ) { return StatusCode::FAILURE ; }  //  RETURN
    00658       //
    00659       std::copy ( tmp.begin() , tmp.end() , result ) ;
    00660       //
    00661       return StatusCode::SUCCESS ;                            //  RETURN
    00662     }

StatusCode Gaudi::Parsers::parse | ( | std::map< std::string, std::pair< double, double > > & | params,
|  | const std::string & | input |
| ) |  |  |

helper function, needed for implementation of map of pairs It is very useful construction for monitoring to represent the value and error or the allowed range for some parameter

Parameters:

  | params | the map of pair
  | input | the string to be parsed

Returns:
  status code

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

  Alexander MAZUROV Alexander.Mazurov@gmail.com

Date:
  2009-05-19

Definition at line 217 of file ParseMaps.cpp.

    00219     {
    00220       typedef PairGrammar< RealGrammar<double> , RealGrammar <double> > PG ;
    00221       MapGrammar < StringGrammar , PG > g ;
    00222       return parse
    00223         ( createIterator(input),
    00224           IteratorT(),
    00225           g[var(params)=arg1],
    00226           SkipperGrammar()).full;
    00227     }

StatusCode Gaudi::Parsers::parse | ( | std::map< std::string, Gaudi::Histo1DDef > & | histos,
|  | const std::string & | input |
| ) |  |  |

helper function, needed for implementation of "Histogram Property"

Parameters:

  | histos | the map of the histogram descriptions (output)
  | input | the string to be parsed

Returns:
  status code

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

  Alexander MAZUROV Alexander.Mazurov@gmail.com

Date:
  2007-09-17

Parameters:

  | histos | the map of the histogram descriptions (output)
  | input | the string to be parsed

Returns:
  status code

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

  Alexander MAZUROV Alexander.Mazurov@gmail.com

Date:
  2007-09-17

Definition at line 127 of file ParseHistos.cpp.

    00129 {
    00130   MapGrammar<StringGrammar,Histo1DGrammar> g;
    00131   const bool full = boost::spirit::parse
    00132     ( createIterator(input),
    00133       IteratorT()     ,
    00134       g[var(histos)=arg1],
    00135       SkipperGrammar() ).full;
    00136   //
    00137   if ( !full ) { return StatusCode::FAILURE ; }                 // RETURN
    00138   //
    00139   for ( std::map<std::string,Gaudi::Histo1DDef>::const_iterator
    00140           ih = histos.begin() ; histos.end() != ih ; ++ih )
    00141   { if ( !ih->second.ok() ) { return StatusCode::FAILURE ; } }  // RETURN
    00142   //
    00143   return StatusCode::SUCCESS ;                                  // RETURN
    00144 }

StatusCode Gaudi::Parsers::parse | ( | Gaudi::Histo1DDef & | histo,
|  | const std::string & | input |
| ) |  |  |

helper function, needed for implementation of "Histogram Property"

Parameters:

  | histo | the histogram description (output)
  | input | the string to be parsed

Returns:
  status code

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

  Alexander MAZUROV Alexander.Mazurov@gmail.com

Date:
  2007-09-17

Definition at line 103 of file ParseHistos.cpp.

    00105 {
    00106   Histo1DGrammar g;
    00107   const bool full =
    00108     boost::spirit::parse
    00109     ( createIterator(input),
    00110       IteratorT(),
    00111       g[var(histo)=arg1],
    00112       SkipperGrammar()).full;
    00113   //
    00114   return full && histo.ok() ? StatusCode::SUCCESS : StatusCode::FAILURE ;
    00115 }

StatusCode Gaudi::Parsers::parse | ( | std::string & | name,
|  | std::string & | value,
|  | const std::string & | input |
| ) |  |  |

parse the pair expression (map-component) " 'name' :value"

      const std::string input = "'PackageName':GaudiKernel" ;
      std::string name  ;
      std::string value ;
      StatusCode sc = Gaudi::Parsers::parse ( name , value , input ) ;
      if ( sc.isFailure() ) { ... }
      std::cout <<  "\tParsed name  is " << name
                <<  "\tParsed value is " << value << std::endl

Parameters:

  | name | (output) the parsed name of the component, defined as 'name' or "name" before the column symbol ":", the leading and trailing blans are omitted
  | value | (output) the parsed value of the component, defined as everything after the column symbol ":" till the end of the string
  | input | (input) string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 156 of file ParseMaps.cpp.

    00157     {
    00158       return parse
    00159         ( input.c_str(),
    00160           (
    00161            ch_p('"' ) >> (+(anychar_p-ch_p('"' )))[assign_a(name)] >> ch_p('"' )
    00162            |
    00163            ch_p('\'') >> (+(anychar_p-ch_p('\'')))[assign_a(name)] >> ch_p('\'')
    00164            )
    00165           >> ":"
    00166           >> (+anychar_p)[assign_a(value)], space_p).full;
    00167     }

StatusCode Gaudi::Parsers::parse | ( | std::map< std::string, unsigned int > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<unsigned int,std::string> >` objects

See also:
  Gaudi::Parsers::MapGrammar

Definition at line 194 of file ParseMaps.cpp.

    00196     {
    00197       MapGrammar<StringGrammar,IntGrammar<unsigned int> > g;
    00198       return parse
    00199         ( createIterator(input),
    00200           IteratorT(),
    00201           g[var(result)=arg1],
    00202           SkipperGrammar()).full;
    00203     }

StatusCode Gaudi::Parsers::parse | ( | std::map< unsigned int, std::string > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<unsigned int,std::string> >` objects

See also:
  Gaudi::Parsers::MapGrammar

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

  Alexander MAZUROV Alexander.Mazurov@gmail.com

Date:
  2007-12-06

Definition at line 182 of file ParseMaps.cpp.

    00184     {
    00185       MapGrammar<IntGrammar<unsigned int>,StringGrammar> g;
    00186       return parse
    00187         ( createIterator(input),
    00188           IteratorT(),
    00189           g[var(result)=arg1],
    00190           SkipperGrammar()).full;
    00191     }

StatusCode Gaudi::Parsers::parse | ( | std::map< int, std::string > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<int,std::string> >` objects

See also:
  Gaudi::Parsers::MapGrammar

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

  Alexander MAZUROV Alexander.Mazurov@gmail.com

Date:
  2007-12-06

Definition at line 170 of file ParseMaps.cpp.

    00172     {
    00173       MapGrammar<IntGrammar<int>,StringGrammar> g;
    00174       return parse
    00175         ( createIterator(input),
    00176           IteratorT(),
    00177           g[var(result)=arg1],
    00178           SkipperGrammar()).full;
    00179     }

StatusCode Gaudi::Parsers::parse | ( | std::map< std::string, std::vector< double > > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<std::string , std::vector<double> >` value

See also:
  Gaudi::Parsers::MapGrammar

  Gaudi::Parsers::StringGrammar

  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::RealGrammar

Parameters:

  | result | (output) map with string value and vector of doubles as value
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 118 of file ParseMaps.cpp.

    00120     {
    00121       MapGrammar<StringGrammar,VectorGrammar<RealGrammar<double> > > g;
    00122       return parse
    00123         ( createIterator(input),
    00124           IteratorT(),
    00125           g[var(result)=arg1],
    00126           SkipperGrammar()).full;
    00127     }

StatusCode Gaudi::Parsers::parse | ( | std::map< std::string, std::vector< int > > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<std::string , std::vector<int> >` value

See also:
  Gaudi::Parsers::MapGrammar

  Gaudi::Parsers::StringGrammar

  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::IntGrammar

Parameters:

  | result | (output) map with string value and vector of integers as value
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 106 of file ParseMaps.cpp.

    00108     {
    00109       MapGrammar<StringGrammar,VectorGrammar<IntGrammar<int> > > g;
    00110       return parse
    00111         ( createIterator(input),
    00112           IteratorT(),
    00113           g[var(result)=arg1],
    00114           SkipperGrammar()).full;
    00115     }

StatusCode Gaudi::Parsers::parse | ( | std::map< std::string, std::vector< std::string > > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<std::string , std::vector<std::string> >` value

See also:
  Gaudi::Parsers::MapGrammar

  Gaudi::Parsers::StringGrammar

  Gaudi::Parsers::VectorGrammar

Parameters:

  | result | (output) map with string value and vector of strings as value
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 94 of file ParseMaps.cpp.

    00096     {
    00097       MapGrammar<StringGrammar,VectorGrammar<StringGrammar> > g;
    00098       return parse
    00099         ( createIterator(input),
    00100           IteratorT(),
    00101           g[var(result)=arg1],
    00102           SkipperGrammar()).full;
    00103     }

StatusCode Gaudi::Parsers::parse | ( | std::map< std::string, double > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<std::string , double>` value

See also:
  Gaudi::Parsers::MapGrammar

  Gaudi::Parsers::StringGrammar

  Gaudi::Parsers::RealGrammar

Parameters:

  | result | (output) map with string key and integer value
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 58 of file ParseMaps.cpp.

    00060     {
    00061       MapGrammar<StringGrammar,RealGrammar<double> > g;
    00062       return parse
    00063         ( createIterator(input),
    00064           IteratorT(),
    00065           g[var(result)=arg1],
    00066           SkipperGrammar()).full;
    00067     }

StatusCode Gaudi::Parsers::parse | ( | std::map< std::string, int > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<std::string , int>` value

See also:
  Gaudi::Parsers::MapGrammar

  Gaudi::Parsers::StringGrammar

  Gaudi::Parsers::IntGrammar

Parameters:

  | result | (output) map with string key and integer value
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 82 of file ParseMaps.cpp.

    00084     {
    00085       MapGrammar<StringGrammar,IntGrammar<int> > g;
    00086       return parse
    00087         ( createIterator(input),
    00088           IteratorT(),
    00089           g[var(result)=arg1],
    00090           SkipperGrammar()).full;
    00091     }

StatusCode Gaudi::Parsers::parse | ( | std::map< std::string, std::string > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<std::string , std::string>` value

See also:
  Gaudi::Parsers::MapGrammar

  Gaudi::Parsers::StringGrammar

Parameters:

  | result | (output) map with string key and value
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 70 of file ParseMaps.cpp.

    00072     {
    00073       MapGrammar<StringGrammar,StringGrammar> g;
    00074       return parse
    00075         ( createIterator(input),
    00076           IteratorT(),
    00077           g[var(result)=arg1],
    00078           SkipperGrammar()).full;
    00079     }

StatusCode Gaudi::Parsers::parse | ( | std::map< int, double > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<int , double>` value

See also:
  Gaudi::Parsers::MapGrammar

  Gaudi::Parsers::IntGrammar

  Gaudi::Parsers::RealGrammar

Parameters:

  | result | (output) map with integer key and double value
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 46 of file ParseMaps.cpp.

    00048     {
    00049       MapGrammar< IntGrammar<int> , RealGrammar<double> > g;
    00050       return parse
    00051         ( createIterator(input),
    00052           IteratorT(),
    00053           g[var(result)=arg1],
    00054           SkipperGrammar()).full;
    00055     }

StatusCode Gaudi::Parsers::parse | ( | std::map< int, int > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::map<int , int>` value

See also:
  Gaudi::Parsers::MapGrammar

  Gaudi::Parsers::IntGrammar

Parameters:

  | result | (output) map with integer key and double value
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 34 of file ParseMaps.cpp.

    00036     {
    00037       MapGrammar< IntGrammar<int> , IntGrammar<int> > g;
    00038       return parse
    00039         ( createIterator(input)  ,
    00040           IteratorT()            ,
    00041           g[var(result)=arg1],
    00042           SkipperGrammar()).full;
    00043     }

StatusCode Gaudi::Parsers::parse | ( | std::vector< std::vector< double > > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::vector<std::vector<double> >` value

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::RealGrammar

Parameters:

  | result | (output) vector with vectors of doubles
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 48 of file ParseVectorsVector.cpp.

    00050     {
    00051       VectorGrammar< VectorGrammar< RealGrammar< double > > > g;
    00052       return parse
    00053         ( createIterator(input),
    00054           IteratorT(),
    00055           g[var(result)=arg1],
    00056           SkipperGrammar()).full;
    00057     }

StatusCode Gaudi::Parsers::parse | ( | std::vector< std::vector< std::string > > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::vector<std::vector<std::string> >` value

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::StringGrammar

Parameters:

  | result | (output) vector with vectors of strings
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 36 of file ParseVectorsVector.cpp.

    00038     {
    00039       VectorGrammar< VectorGrammar<StringGrammar> > g;
    00040       return parse
    00041         ( createIterator(input),
    00042           IteratorT(),
    00043           g[var(result)=arg1],
    00044           SkipperGrammar()).full ;
    00045     }

StatusCode Gaudi::Parsers::parse | ( | std::vector< std::pair< int, int > > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::vector<std::pair<int,int> >` value

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::PairGrammar

  Gaudi::Parsers::IntGrammar

Parameters:

  | result | (output) vector with pairs of int
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 72 of file ParseVectorsVector.cpp.

    00074     {
    00075       VectorGrammar<PairGrammar<IntGrammar<int>,IntGrammar<int> > > g;
    00076       return parse
    00077         ( createIterator(input),
    00078           IteratorT(),
    00079           g[var(result)=arg1],
    00080           SkipperGrammar()).full;
    00081     }

StatusCode Gaudi::Parsers::parse | ( | std::vector< std::pair< double, double > > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::vector<std::pair<double,double> >` value

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::PairGrammar

  Gaudi::Parsers::RealGrammar

Parameters:

  | result | (output) vector with pairs of doubles
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 60 of file ParseVectorsVector.cpp.

    00062     {
    00063       VectorGrammar<PairGrammar<RealGrammar<double>,RealGrammar<double> > > g;
    00064       return parse
    00065         ( createIterator(input),
    00066           IteratorT(),
    00067           g[var(result)=arg1],
    00068           SkipperGrammar()).full;
    00069     }

StatusCode Gaudi::Parsers::parse | ( | std::pair< int, int > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::pair<int,int>` value

See also:
  Gaudi::Parsers::PairGrammar

  Gaudi::Parsers::IntGrammar

Parameters:

  | result | (output) pair of integers
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 45 of file ParsePairs.cpp.

    00046     {
    00047       return parse
    00048         ( createIterator(input),
    00049           IteratorT(),
    00050           PairGrammar < IntGrammar<int> , IntGrammar <int> >()[var(result)=arg1],
    00051           SkipperGrammar()).full;
    00052     }

StatusCode Gaudi::Parsers::parse | ( | std::pair< double, double > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::pair<double,double>` value

See also:
  Gaudi::Parsers::PairGrammar

  Gaudi::Parsers::RealGrammar

Parameters:

  | result | (output) pair of doubles
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 35 of file ParsePairs.cpp.

    00036     {
    00037       return parse
    00038         ( createIterator(input),
    00039           IteratorT(),
    00040           PairGrammar < RealGrammar<double> , RealGrammar <double> >()
    00041           [var(result)=arg1],
    00042           SkipperGrammar()).full;
    00043     }

StatusCode Gaudi::Parsers::parse | ( | std::vector< std::string > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::vector<std::string>` value

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::StringGrammar

Parameters:

  | result | (output) vector with string elements
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 35 of file ParseVectorsString.cpp.

    00037     {
    00038       VectorGrammar<StringGrammar> g;
    00039       return parse(
    00040           createIterator(input),
    00041           IteratorT(),
    00042           g[var(result)=arg1],
    00043           SkipperGrammar()).full;
    00044     }

StatusCode Gaudi::Parsers::parse | ( | std::vector< long double > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<double>& ,const std::string& );

Definition at line 43 of file ParseVectorsReal.cpp.

    00045     { return parse_real_vector    ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< float > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<double>& ,const std::string& );

Definition at line 35 of file ParseVectorsReal.cpp.

    00037     { return parse_real_vector    ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< double > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::vector<double>` value

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::RealGrammar

Parameters:

  | result | (output) vector with double elements
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 39 of file ParseVectorsReal.cpp.

    00041     { return parse_real_vector    ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< unsigned long long > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<int>& ,const std::string& );

Definition at line 63 of file ParseVectorsInteger.cpp.

    00065     { return parse_integer_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< long long > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<int>& ,const std::string& );

Definition at line 59 of file ParseVectorsInteger.cpp.

    00061     { return parse_integer_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< unsigned long > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<int>& ,const std::string& );

Definition at line 55 of file ParseVectorsInteger.cpp.

    00057     { return parse_integer_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< long > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<int>& ,const std::string& );

Definition at line 51 of file ParseVectorsInteger.cpp.

    00053     { return parse_integer_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< unsigned int > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<int>& ,const std::string& );

Definition at line 47 of file ParseVectorsInteger.cpp.

    00049     { return parse_integer_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< unsigned short > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<int>& ,const std::string& );

Definition at line 39 of file ParseVectorsInteger.cpp.

    00041     { return parse_integer_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< short > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<int>& ,const std::string& );

Definition at line 35 of file ParseVectorsInteger.cpp.

    00037     { return parse_integer_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< int > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::vector<int>` value

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::IntGrammar

Parameters:

  | result | (output) vector with integer elements
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 43 of file ParseVectorsInteger.cpp.

    00045     { return parse_integer_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< signed char > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<char>& ,const std::string& );

Definition at line 43 of file ParseVectorsChar.cpp.

    00045     { return parse_char_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< unsigned char > & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  parse( std::vector<char>& ,const std::string& );

Definition at line 39 of file ParseVectorsChar.cpp.

    00041     { return parse_char_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< char > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::vector<char>` value

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::CharGrammar

Parameters:

  | result | (output) vector with char elements
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 35 of file ParseVectorsChar.cpp.

    00037     { return parse_char_vector ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | std::vector< bool > & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::vector<bool>` value

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::BoolGrammar

Parameters:

  | result | (output) vector with boolean elements
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 35 of file ParseVectorsBool.cpp.

    00037     {
    00038       VectorGrammar<BoolGrammar> g;
    00039       return parse(
    00040             createIterator(input),
    00041             IteratorT(),
    00042             g[var(result)=arg1],
    00043             SkipperGrammar()).full;
    00044     }

StatusCode Gaudi::Parsers::parse | ( | std::string & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `std::string` value

See also:
  Gaudi::Parsers::StringGrammar

Parameters:

  | result | (output) string result
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Attention:
  always!!!

Definition at line 101 of file ParseAtomic.cpp.

    00103     {
    00104       StringGrammar g;
    00105       if ( !parse(
    00106               createIterator(input),
    00107               IteratorT(),
    00108               g[var(result)=arg1]).full ){ result = input ; }
    00110       return true ;
    00111     }

StatusCode Gaudi::Parsers::parse | ( | long double & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser( double&, const std::string& )

Definition at line 97 of file ParseAtomic.cpp.

    00099     { return parse_real ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | float & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser( double&, const std::string& )

Definition at line 89 of file ParseAtomic.cpp.

    00091     { return parse_real ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | double & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `double` value

See also:
  Gaudi::Parsers::RealGrammar

Parameters:

  | result | (output) double result
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 93 of file ParseAtomic.cpp.

    00095     { return parse_real ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | unsigned long long & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser( int&, const std::string& )

Definition at line 75 of file ParseAtomic.cpp.

    00077     { return parse_integer ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | long long & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser( int&, const std::string& )

Definition at line 71 of file ParseAtomic.cpp.

    00073     { return parse_integer ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | unsigned long & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser( int&, const std::string& )

Definition at line 67 of file ParseAtomic.cpp.

    00069     { return parse_integer ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | long & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser( int&, const std::string& )

Definition at line 63 of file ParseAtomic.cpp.

    00065     { return parse_integer ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | unsigned int & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser( int&, const std::string& )

Definition at line 59 of file ParseAtomic.cpp.

    00061     { return parse_integer ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | unsigned short & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser( int&, const std::string& )

Definition at line 51 of file ParseAtomic.cpp.

    00053     { return parse_integer ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | short & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser( int&, const std::string& )

Definition at line 47 of file ParseAtomic.cpp.

    00049     { return parse_integer ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | int & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `int` value

See also:
  Gaudi::Parsers::IntGrammar

Parameters:

  | result | (output) integer result
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 55 of file ParseAtomic.cpp.

    00057     { return parse_integer ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | signed char & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser(char&,std::string&)

Definition at line 43 of file ParseAtomic.cpp.

    00045     { return parse_char    ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | unsigned char & | result,
|  | const std::string & | input |
| ) |  |  |

See also:
  Gaudi::Parsers::parser(char&,std::string&)

Definition at line 39 of file ParseAtomic.cpp.

    00041     { return parse_char    ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | char & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `char` value

See also:
  Gaudi::Parsers::CharGrammar

Parameters:

  | result | (output) boolean result
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 35 of file ParseAtomic.cpp.

    00037     { return parse_char    ( result , input ) ; }

StatusCode Gaudi::Parsers::parse | ( | bool & | result,
|  | const std::string & | input |
| ) |  |  |

parse the `bool` value

See also:
  Gaudi::Parsers::BoolGrammar

Parameters:

  | result | (output) boolean result
  | input | (input) the string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 79 of file ParseAtomic.cpp.

    00081     {
    00082       BoolGrammar g;
    00083       return parse(
    00084           createIterator(input),
    00085           IteratorT(),
    00086           g[var(result)=arg1]).full;
    00087     }

template<class TYPE, std::size_t N>

StatusCode Gaudi::Parsers::parse | ( | boost::array< TYPE, N > & | result,
|  | const std::string & | input |
| ) |  |  | `[inline]`

parse class boost::array from the string

Parameters:

  | result | (OUTPUT) the actual result
  | input | (INPUT) the input string

Returns:
  status code

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-16

Definition at line 84 of file BoostArrayAsProperty.h.

    00085     {
    00086       typedef std::vector<TYPE> _Vct ;
    00087       // create the temporaty vector
    00088       _Vct tmp ;
    00089       // parse the string
    00090       StatusCode sc = parse ( tmp , input ) ;
    00091       if ( sc.isFailure () ) { return sc ; }                         // RETURN
    00092       if ( N != tmp.size() )
    00093       { return StatusCode ( StatusCode::FAILURE , true ) ; }         // RETURN
    00094       // copy vector into array
    00095       std::copy ( tmp.begin() , tmp.end() , result.begin() ) ;
    00096       //
    00097       return StatusCode::SUCCESS ;
    00098     }

template<typename CharT>

StatusCode Gaudi::Parsers::parse_char | ( | CharT & | result,
|  | const string & | input |
| ) |  |  | `[inline]`

helper function to "merge" the implementation of all parsers for "char-like" quantities into one templated grammar

See also:
  Gaudi::Parsers::CharGrammar

Parameters:

  | result | (output) parsing result
  | input | (input) string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 138 of file Parsers.icpp.

    00139     {
    00140       CharGrammar<CharT> g;
    00141       return parse
    00142         ( createIterator(input),
    00143           IteratorT(),
    00144           g[var(result)=arg1]).full;
    00145     }

template<typename CharT>

StatusCode Gaudi::Parsers::parse_char_vector | ( | std::vector< CharT > & | result,
|  | const string & | input |
| ) |  |  | `[inline]`

helper function to "merge" the implementation of all parsers for vector of 'char-like' quantities into the combination of templated grammars

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::CharGrammar

  Gaudi::Parsers::SkipperGrammar

Parameters:

  | result | (output) parsing result
  | input | (input) string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 165 of file Parsers.icpp.

    00166     {
    00167       VectorGrammar<CharGrammar<CharT> > g;
    00168       return parse
    00169         ( createIterator(input),
    00170           IteratorT(),
    00171           g[var(result)=arg1],
    00172           SkipperGrammar()).full;
    00173     }

template<typename IntegerT>

StatusCode Gaudi::Parsers::parse_integer | ( | IntegerT & | result,
|  | const string & | input |
| ) |  |  | `[inline]`

helper function to "merge" the implementation of all parsers for integer-like quantities into one templated grammar

See also:
  Gaudi::Parsers::IntGrammar

Parameters:

  | result | (output) parsing result
  | input | (input) string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 86 of file Parsers.icpp.

    00087     {
    00088       IntGrammar<IntegerT> g;
    00089       return parse
    00090         ( createIterator(input),
    00091           IteratorT(),
    00092           g[var(result)=arg1]).full;
    00093     }

template<typename IntegerT>

StatusCode Gaudi::Parsers::parse_integer_vector | ( | std::vector< IntegerT > & | result,
|  | const string & | input |
| ) |  |  | `[inline]`

helper function to "merge" the implementation of all parsers for vector of integer-like quantities into the combination of templated grammars

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::IntGrammar

  Gaudi::Parsers::SkipperGrammar

Parameters:

  | result | (output) parsing result
  | input | (input) string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 113 of file Parsers.icpp.

    00114     {
    00115       VectorGrammar<IntGrammar<IntegerT> > g;
    00116       return parse
    00117         ( createIterator(input),
    00118           IteratorT(),
    00119           g[var(result)=arg1],
    00120           SkipperGrammar()).full;
    00121     }

template<typename RealT>

StatusCode Gaudi::Parsers::parse_real | ( | RealT & | result,
|  | const string & | input |
| ) |  |  | `[inline]`

helper function to "merge" the implementation of all parsers for "float-like" quantities into one templated grammar

See also:
  Gaudi::Parsers::RealGrammar

Parameters:

  | result | (output) parsing result
  | input | (input) string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 189 of file Parsers.icpp.

    00190     {
    00191       RealGrammar<RealT> g;
    00192       return parse
    00193         ( createIterator(input),
    00194           IteratorT(),
    00195           g[var(result)=arg1],
    00196           SkipperGrammar()).full;
    00197     }

template<typename RealT>

StatusCode Gaudi::Parsers::parse_real_vector | ( | std::vector< RealT > & | result,
|  | const string & | input |
| ) |  |  | `[inline]`

helper function to "merge" the implementation of all parsers for vector of 'char-like' quantities into the combination of templated grammars

See also:
  Gaudi::Parsers::VectorGrammar

  Gaudi::Parsers::RealGrammar

  Gaudi::Parsers::SkipperGrammar

Parameters:

  | result | (output) parsing result
  | input | (input) string to be parsed

Returns:
  status code

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 217 of file Parsers.icpp.

    00218     {
    00219       VectorGrammar< RealGrammar<RealT> > g;
    00220       return parse
    00221         ( createIterator(input),
    00222           IteratorT(),
    00223           g[var(result)=arg1],
    00224           SkipperGrammar()).full;
    00225     }

template<class T, typename IT>

phoenix::actor<PushBackRefImpl<T,IT> > Gaudi::Parsers::PushBack | ( | T & | x,
|  | IT | it |
| ) |  |  | `[inline]`

Definition at line 91 of file ParserActions.h.

    00091                                                                               {
    00092       return PushBackRefImpl<T,IT> (x,it);
    00093     }

template<class T>

phoenix::actor<PushBackImpl<T> > Gaudi::Parsers::PushBack | ( | T & | x | ) | `[inline]`

Definition at line 87 of file ParserActions.h.

    00087                                                                   {
    00088       return PushBackImpl<T> (x);
    00089     }