| The Gaudi Framework v29r0 (ff2e7097)

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

- Namespace List
- Namespace Members

Namespaces | Classes | Typedefs | Functions
Gaudi::Parsers Namespace Reference

## Namespaces
| Utils

## Classes
struct | BoolGrammar
class | Catalog
struct | CharGrammar
class | EdgeGrammar
struct | FileGrammar
struct | Grammar_
struct | Grammar_< Iterator, GaudiUtils::VectorMap< KeyT, ValueT, KeyCompareT, AllocatorT >, Skipper >
struct | Grammar_< Iterator, ROOT::Math::DisplacementVector3D< T1, T2 >, Skipper >
struct | Grammar_< Iterator, ROOT::Math::LorentzVector< T1 >, Skipper >
struct | Grammar_< Iterator, ROOT::Math::PositionVector3D< T1, T2 >, Skipper >
struct | Grammar_< Iterator, std::list< InnerT, AllocatorT >, Skipper >
struct | Grammar_< Iterator, std::map< KeyT, ValueT, KeyCompareT, AllocatorT >, Skipper >
struct | Grammar_< Iterator, std::pair< KeyT, ValueT >, Skipper >
struct | Grammar_< Iterator, std::set< InnerT, CompareT, AllocatorT >, Skipper >
struct | Grammar_< Iterator, std::tuple< Args... >, Skipper >
struct | Grammar_< Iterator, std::vector< InnerT, AllocatorT >, Skipper >
struct | Grammar_< Iterator, T, Skipper, typename boost::enable_if< boost::is_floating_point< T > >::type >
struct | Grammar_< Iterator, T, Skipper, typename boost::enable_if< boost::is_integral< T > >::type >
class | H1Grammar
class | H2Grammar
struct | Histo1DGrammar
struct | IdentifierGrammar
class | IncludedFiles
struct | InterpolGrammar
struct | IntGrammar
struct | KeyValueGrammar
struct | MapGrammar
class | Messages
class | Node
class | NodeOperations
struct | PairGrammar
struct | Pnt3DGrammar
struct | Pnt4DGrammar
class | Position
class | PositionalPropertyValueException
class | PragmaOptions
class | Property
class | PropertyName
class | PropertyValue
class | PropertyValueException
struct | RealGrammar
struct | SkipperGrammar
struct | StringGrammar
struct | tuple_get_first_type
struct | tuple_get_first_type< std::tuple< T, Ts... > >
struct | tuple_remove_first_type
struct | tuple_remove_first_type< std::tuple< T, Ts... > >
struct | TupleGrammar
struct | TupleInnerGrammar
struct | TupleInnerGrammar< Iterator, TupleT, 1, Skipper >
class | Units
struct | UnitsGrammar
struct | VectorGrammar

## Typedefs
typedef std::string::const_iterator | DefaultIterator
typedef enc::space_type | DefaultSkipper
typedef std::string::const_iterator | IteratorT
typedef SkipperGrammar< IteratorT > | Skipper

## Functions
template<typename K , typename V >
StatusCode | parse (GaudiUtils::HashMap< K, V > &result, const std::string &input)
| Basic parser for the types of HashMap used in DODBasicMapper. More...
bool | ReadOptions (const std::string &filename, const std::string &search_path, Messages *messages, Catalog *catalog, Units *units, PragmaOptions *pragma, Node *root)
| Parse and analyze filename, save all messages and properties. More...
std::ostream & | operator<< (std::ostream &o, const Catalog &c)
| printout operator More...
bool | Parse (const std::string &filename, const std::string &search_path, IncludedFiles *included, Messages *messages, Node *root)
bool | Parse (const Position &from, const std::string &filename, const std::string &search_path, IncludedFiles *included, Messages *messages, Node *root)
bool | ParseUnits (const Position &from, const std::string &filename, const std::string &search_path, IncludedFiles *included, Messages *messages, Node *root)
| REGISTER_GRAMMAR (GaudiMath::Interpolation::Type, InterpolGrammar)
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 More...
StatusCode | parse (DataObjectHandleBase &, const std::string &)
StatusCode | parse (DataObjID &, const std::string &)
StatusCode | parse (DataObjIDColl &, const std::string &)
| REGISTER_GRAMMAR (std::string, StringGrammar)
| REGISTER_GRAMMAR (Gaudi::StringKey, StringGrammar)
| REGISTER_GRAMMAR (char, CharGrammar)
| REGISTER_GRAMMAR (bool, BoolGrammar)
| REGISTER_GRAMMAR (Gaudi::Histo1DDef, Histo1DGrammar)
GAUDI_API StatusCode | parse (std::vector< std::pair< double, double >> &result, const std::string &input)
| parse the `bool` value More...
GAUDI_API StatusCode | parse (std::vector< std::pair< int, int >> &result, const std::string &input)
| parse the `std::vector<std::pair<int,int> >` value More...
GAUDI_API StatusCode | parse (std::vector< std::vector< std::string >> &result, const std::string &input)
| parse the `std::vector<std::vector<std::string> >` value More...
GAUDI_API StatusCode | parse (std::vector< std::vector< double >> &result, const std::string &input)
| parse the `std::vector<std::vector<double> >` value More...
GAUDI_API StatusCode | parse (std::map< int, int > &result, const std::string &input)
| parse the `std::map<int , int>` value More...
GAUDI_API StatusCode | parse (std::map< int, double > &result, const std::string &input)
| parse the `std::map<int , double>` value More...
GAUDI_API StatusCode | parse (std::map< std::string, std::string > &result, const std::string &input)
| parse the `std::map<std::string , std::string>` value More...
GAUDI_API StatusCode | parse (std::map< std::string, int > &result, const std::string &input)
| parse the `std::map<std::string , int>` value More...
GAUDI_API StatusCode | parse (std::map< std::string, double > &result, const std::string &input)
| parse the `std::map<std::string , double>` value More...
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 More...
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 More...
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 More...
GAUDI_API StatusCode | parse (std::map< int, std::string > &result, const std::string &input)
| parse the `std::map<int,std::string> >` objects More...
GAUDI_API StatusCode | parse (std::map< unsigned int, std::string > &result, const std::string &input)
| parse the `std::map<unsigned int,std::string> >` objects More...
GAUDI_API StatusCode | parse (std::map< std::string, unsigned int > &result, const std::string &input)
| parse the `std::map<unsigned int,std::string> >` objects More...
template<typename K , typename V , typename M >
GAUDI_API StatusCode | parse (GaudiUtils::Map< K, V, M > &result, const std::string &input)
| parse the `GaudiUtils::Map<K, V, M>` objects More...
GAUDI_API StatusCode | parse (std::string &name, std::string &value, const std::string &input)
| parse the pair expression (map-component) " 'name' :value" More...
GAUDI_API StatusCode | parse (Gaudi::Histo1DDef &histo, const std::string &input)
| helper function, needed for implementation of "Histogram Property" More...
GAUDI_API StatusCode | parse (std::map< std::string, Gaudi::Histo1DDef > &histos, const std::string &input)
| helper function, needed for implementation of "Histogram Property" More...
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 More...
template<class T , unsigned int N>
StatusCode | parse (T(&result)[N], const std::string &input)
| parser function for C-arrays More...
template<unsigned int N>
StatusCode | parse (char(&result)[N], const std::string &input)
| parser function for C-strings More...
template<typename ResultT >
StatusCode | parse_ (ResultT &result, const std::string &input)
template<>
StatusCode | parse_ (std::string &result, const std::string &input)
template<typename ResultT >
StatusCode | parse (ResultT &result, const std::string &input)
template<class TYPE , std::size_t N>
StatusCode | parse (std::array< TYPE, N > &result, const std::string &input)
| parse class std::array from the string More...
GAUDI_API StatusCode | parse (Gaudi::StringKey &result, const std::string &input)
| parse the key from the string More...
GAUDI_API StatusCode | parse (std::vector< Gaudi::StringKey > &result, const std::string &input)
| parse the vector of keys from the string More...
template<class SCALAR , unsigned int N>
StatusCode | parse (ROOT::Math::SVector< SCALAR, N > &result, const std::string &input)
| parse SVector More...
GAUDI_API StatusCode | parse (GaudiUtils::VectorMap< std::string, double > &result, const std::string &input)
| parse the key from the string More...
GAUDI_API StatusCode | parse (GaudiUtils::VectorMap< Gaudi::StringKey, double > &result, const std::string &input)
| parse the vector of keys from the string More...
GAUDI_API StatusCode | parse (Gaudi::XYZPoint &result, const std::string &input)
| parse 3D-point More...
GAUDI_API StatusCode | parse (Gaudi::XYZVector &result, const std::string &input)
| parse 3D-vector More...
GAUDI_API StatusCode | parse (Gaudi::LorentzVector &result, const std::string &input)
| parse LorentzVector More...
GAUDI_API StatusCode | parse (std::vector< Gaudi::XYZPoint > &result, const std::string &input)
| parse the vector of points More...
GAUDI_API StatusCode | parse (std::vector< Gaudi::XYZVector > &result, const std::string &input)
| parse the vector of vectors More...
GAUDI_API StatusCode | parse (std::vector< Gaudi::LorentzVector > &result, const std::string &input)
| parse the vector of vectors More...
template<typename T1 , typename T2 >
StatusCode | parse_ (ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
GAUDI_API StatusCode | parse (TH1D &result, const std::string &input)
| parse ROOT histogram from text representation More...
GAUDI_API StatusCode | parse (TH2D &result, const std::string &input)
| parse ROOT histogram from text representation More...
GAUDI_API StatusCode | parse (TH1F &result, const std::string &input)
| parse ROOT histogram from text representation More...
GAUDI_API StatusCode | parse (TH2F &result, const std::string &input)
| parse ROOT histogram from text representation More...
GAUDI_API StatusCode | parse (AIDA::IHistogram1D &result, const std::string &input)
| parse AIDA histogram from text representation More...
GAUDI_API StatusCode | parse (AIDA::IHistogram2D &result, const std::string &input)
| parse AIDA histogram from text representation More...
GAUDI_API StatusCode | parse (TH1D *&result, const std::string &input)
| parse ROOT histogram from text representation More...
GAUDI_API StatusCode | parse (TH2D *&result, const std::string &input)
| parse ROOT histogram from text representation More...
| REGISTER_GRAMMAR (Edges, EdgeGrammar)
| REGISTER_GRAMMAR (H1, H1Grammar)
| REGISTER_GRAMMAR (H2, H2Grammar)

## Typedef Documentation

typedef std::string::const_iterator Gaudi::Parsers::DefaultIterator

Definition at line 57 of file GrammarsV2.h.

typedef enc::space_type Gaudi::Parsers::DefaultSkipper

Definition at line 58 of file GrammarsV2.h.

typedef std::string::const_iterator Gaudi::Parsers::IteratorT

Definition at line 28 of file ParsersFactory.h.

typedef SkipperGrammar<IteratorT> Gaudi::Parsers::Skipper

Definition at line 30 of file ParsersFactory.h.

## Function Documentation

std::ostream& Gaudi::Parsers::operator<< | ( | std::ostream & | o,
|  | const Catalog & | c
| ) |  |
| inline

printout operator

Definition at line 61 of file Catalog.h.

61 { return c.fillStream( o ); }
gaudirun.c
c
Definition: gaudirun.py:407
template<typename K , typename V >

StatusCode Gaudi::Parsers::parse | ( | GaudiUtils::HashMap< K, V > & | result,
|  | const std::string & | input
| ) |  |

Basic parser for the types of HashMap used in DODBasicMapper.

Delegates to the parser of map<string,string>.

Definition at line 13 of file DODBasicMapper.cpp.

14 {
15 std::map<std::string, std::string> tmp;
16 StatusCode sc = parse( tmp, input );
17 if ( sc.isSuccess() ) {
18 result.clear();
19 result.insert( tmp.begin(), tmp.end() );
20 }
21 return sc;
22 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
std::map::end
T end(T...args)
std::map< std::string, std::string >
GaudiUtils::Map::insert
std::pair< iterator, bool > insert(ValueType &&val)
Definition: Map.h:174
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
std::map::begin
T begin(T...args)
GaudiUtils::Map::clear
void clear()
Definition: Map.h:195

bool Gaudi::Parsers::Parse | ( | const std::string & | filename,
|  | const std::string & | search_path,
|  | IncludedFiles * | included,
|  | Messages * | messages,
|  | Node * | root
| ) |  |

Definition at line 120 of file Parser.cpp.

122 {
123 return Parse( Position(), filename, search_path, included, messages, root );
124 }
Gaudi::Parsers::Parse
bool Parse(const std::string &filename, const std::string &search_path, IncludedFiles *included, Messages *messages, Node *root)
Definition: Parser.cpp:120
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:18

bool Gaudi::Parsers::Parse | ( | const Position & | from,
|  | const std::string & | filename,
|  | const std::string & | search_path,
|  | IncludedFiles * | included,
|  | Messages * | messages,
|  | Node * | root
| ) |  |

Definition at line 126 of file Parser.cpp.

128 {
129 using Grammar = FileGrammar<Iterator, SkipperGrammar<Iterator>>;
130 return ParseFile<Grammar>( from, filename, search_path, included, messages, root );
131 }
graphanalysis.filename
string filename
Definition: graphanalysis.py:117
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:18

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

parse ROOT histogram from text representation

Parameters

  result | (OUTPUT) the histogram
  input | (INPUT) the input to be parsed

Returns
  status code

Definition at line 305 of file HistoParsers.cpp.

306 {
307 // 1) check the parsing
308 std::string name;
309 //
310 auto h1 = _parse_1D<TH1D>( input, name );
311 if ( h1 ) {
312 result.Reset();
313 h1->Copy( result ); // ASSIGN
314 result.SetName( name.c_str() );
315 return StatusCode::SUCCESS; // RETURN
316 }
317 //
318 // XML-like text?
319 return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
320 : StatusCode::FAILURE;
321 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:202
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
StatusCode::FAILURE
Definition: StatusCode.h:31
std::string
STL class.
std::string::c_str
T c_str(T...args)
template<class SCALAR , unsigned int N>

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

parse SVector

Parameters

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

Returns
  status code

Author
  Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-05

Definition at line 44 of file SVectorAsProperty.h.

45 {
46 std::vector<double> tmp;
47 StatusCode sc = parse( tmp, input );
48 if ( sc.isFailure() ) {
49 return sc;
50 } // RETURN
51 if ( N != tmp.size() ) {
52 return StatusCode::FAILURE;
53 } // RETURN
54 #ifdef WIN32
55 // Disable warning
56 // C4996: 'std::copy': Function call with parameters that may be unsafe
57 // The parameters are checked
58 #pragma warning( push )
59 #pragma warning( disable : 4996 )
60 #endif
61 std::copy( tmp.begin(), tmp.end(), result.begin() );
62 #ifdef WIN32
63 #pragma warning( pop )
64 #endif
65 return StatusCode::SUCCESS;
66 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
std::copy
T copy(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::Parsers::parse
StatusCode parse(ROOT::Math::SVector< SCALAR, N > &result, const std::string &input)
parse SVector
Definition: SVectorAsProperty.h:44
std::vector::end
T end(T...args)
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
IOTest.N
int N
Definition: IOTest.py:101
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
std::vector::size
T size(T...args)
std::vector< double >
std::vector::begin
T begin(T...args)

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

parse ROOT histogram from text representation

Parameters

  result | (OUTPUT) the histogram
  input | (INPUT) the input to be parsed

Returns
  status code

Definition at line 353 of file HistoParsers.cpp.

354 {
355 // 1) check the parsing
356 std::string name;
357 auto h2 = _parse_2D<TH2D>( input, name );
358 if ( h2 ) {
359 result.Reset();
360 h2->Copy( result ); // ASSIGN
361 result.SetName( name.c_str() );
362 return StatusCode::SUCCESS; // RETURN
363 }
364 //
365 // XML-like text?
366 return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
367 : StatusCode::FAILURE;
368 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:202
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
StatusCode::FAILURE
Definition: StatusCode.h:31
std::string
STL class.
std::string::c_str
T c_str(T...args)

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

parse ROOT histogram from text representation

Parameters

  result | (OUTPUT) the histogram
  input | (INPUT) the input to be parsed

Returns
  status code

Definition at line 329 of file HistoParsers.cpp.

330 {
331 // 1) check the parsing
332 std::string name;
333 //
334 auto h1 = _parse_1D<TH1F>( input, name );
335 if ( h1 ) {
336 result.Reset();
337 h1->Copy( result ); // ASSIGN
338 result.SetName( name.c_str() );
339 return StatusCode::SUCCESS; // RETURN
340 }
341 //
342 // XML-like text?
343 return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
344 : StatusCode::FAILURE;
345 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:202
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
StatusCode::FAILURE
Definition: StatusCode.h:31
std::string
STL class.
std::string::c_str
T c_str(T...args)
template<typename ResultT >

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

Definition at line 55 of file ParsersFactory.h.

56 {
57
58 return parse_( result, input );
59 }
Gaudi::Parsers::parse_
StatusCode parse_(std::string &result, const std::string &input)
Definition: ParsersFactory.h:42

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

parse ROOT histogram from text representation

Parameters

  result | (OUTPUT) the histogram
  input | (INPUT) the input to be parsed

Returns
  status code

Definition at line 376 of file HistoParsers.cpp.

377 {
378 // 1) check the parsing
379 std::string name;
380 auto h2 = _parse_2D<TH2F>( input, name );
381 if ( h2 ) {
382 result.Reset();
383 h2->Copy( result ); // ASSIGN
384 result.SetName( name.c_str() );
385 return StatusCode::SUCCESS; // RETURN
386 }
387 //
388 // XML-like text?
389 if ( std::string::npos != input.find( '<' ) ) {
390 return Gaudi::Utils::Histos::fromXml( result, input );
391 }
392 //
393 return StatusCode::FAILURE;
394 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:202
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
StatusCode::FAILURE
Definition: StatusCode.h:31
std::string
STL class.
std::string::c_str
T c_str(T...args)
template<class TYPE , std::size_t N>

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

parse class std::array from the string

Parameters

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

Returns
  status code

Author
  Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-16

Definition at line 64 of file StdArrayAsProperty.h.

65 {
66 typedef std::vector<TYPE> _Vct;
67 // create the temporaty vector
68 _Vct tmp;
69 // parse the string
70 StatusCode sc = parse( tmp, input );
71 if ( sc.isFailure() ) {
72 return sc;
73 } // RETURN
74 if ( N != tmp.size() ) {
75 return StatusCode( StatusCode::FAILURE, true );
76 } // RETURN
77 // copy vector into array
78 std::copy( tmp.begin(), tmp.end(), result.begin() );
79 //
80 return StatusCode::SUCCESS;
81 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
std::copy
T copy(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:31
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
IOTest.N
int N
Definition: IOTest.py:101
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Gaudi::Parsers::parse
StatusCode parse(std::array< TYPE, N > &result, const std::string &input)
parse class std::array from the string
Definition: StdArrayAsProperty.h:64
std::vector
STL class.
std::array::begin
T begin(T...args)

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

parse AIDA histogram from text representation

Parameters

  result | (OUTPUT) the histogram
  input | (INPUT) the input to be parsed

Returns
  status code

Definition at line 454 of file HistoParsers.cpp.

455 {
456 // 1) convert to ROOT
457 auto root = Gaudi::Utils::Aida2ROOT::aida2root( &result );
458 // 2) read ROOT histogram
459 return root ? parse( *root, input ) : StatusCode::FAILURE;
460 }
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
GaudiPython.Bindings.FAILURE
FAILURE
Definition: Bindings.py:57
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:73
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:18

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..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-05

Definition at line 51 of file ParsersVct.cpp.

51 { return parse_( result, input ); }
Gaudi::Parsers::parse_
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:38

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

parse AIDA histogram from text representation

Parameters

  result | (OUTPUT) the histogram
  input | (INPUT) the input to be parsed

Returns
  status code

Definition at line 468 of file HistoParsers.cpp.

469 {
470 // 1) convert to ROOT
471 auto root = Gaudi::Utils::Aida2ROOT::aida2root( &result );
472 // 2) read ROOT histogram
473 return root ? parse( *root, input ) : StatusCode::FAILURE;
474 }
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
GaudiPython.Bindings.FAILURE
FAILURE
Definition: Bindings.py:57
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:73
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:18
template<class TYPE , std::size_t N>

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

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..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-16

Definition at line 78 of file BoostArrayAsProperty.h.

79 {
80 typedef std::vector<TYPE> _Vct;
81 // create the temporaty vector
82 _Vct tmp;
83 // parse the string
84 StatusCode sc = parse( tmp, input );
85 if ( sc.isFailure() ) {
86 return sc;
87 } // RETURN
88 if ( N != tmp.size() ) {
89 return StatusCode( StatusCode::FAILURE, true );
90 } // RETURN
91 // copy vector into array
92 std::copy( tmp.begin(), tmp.end(), result.begin() );
93 //
94 return StatusCode::SUCCESS;
95 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
std::copy
T copy(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::Parsers::parse
StatusCode parse(boost::array< TYPE, N > &result, const std::string &input)
parse class boost::array from the string
Definition: BoostArrayAsProperty.h:78
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
IOTest.N
int N
Definition: IOTest.py:101
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
std::vector
STL class.

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

parse ROOT histogram from text representation

Parameters

  result | (OUTPUT) the histogram
  input | (INPUT) the input to be parsed

Returns
  status code

Definition at line 402 of file HistoParsers.cpp.

403 {
404 if ( result ) {
405 return parse( *result, input );
406 } // RETURN
407
408 // 1) check the parsing
409 std::string name;
410 auto h1 = _parse_1D<TH1D>( input, name );
411 if ( h1 ) {
412 result = h1.release();
413 result->SetName( name.c_str() );
414 return StatusCode::SUCCESS; // RETURN
415 }
416 //
417 // XML-like text?
418 return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
419 : StatusCode::FAILURE;
420 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:202
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
std::string
STL class.
std::string::c_str
T c_str(T...args)

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

parse ROOT histogram from text representation

Parameters

  result | (OUTPUT) the histogram
  input | (INPUT) the input to be parsed

Returns
  status code

Definition at line 428 of file HistoParsers.cpp.

429 {
430 if ( result ) {
431 return parse( *result, input );
432 } // RETURN
433
434 // 1) check the parsing
435 std::string name;
436 auto h2 = _parse_2D<TH2D>( input, name );
437 if ( h2 ) {
438 result = h2.release();
439 result->SetName( name.c_str() );
440 return StatusCode::SUCCESS; // RETURN
441 }
442 //
443 // XML-like text?
444 return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
445 : StatusCode::FAILURE;
446 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:202
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
std::string
STL class.
std::string::c_str
T c_str(T...args)

StatusCode Gaudi::Parsers::parse | ( | DataObjectHandleBase & | v,
|  | const std::string & | s
| ) |  |

Definition at line 14 of file DataObjectHandleProperty.cpp.

15 {
16 std::string prop;
17 auto sc = Gaudi::Parsers::parse( prop, s );
18 if ( sc ) v.setKey( DataObjID( s ) );
19 return sc;
20 }
DataObjID
Definition: DataObjID.h:37
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
Gaudi::DataHandle::setKey
virtual void setKey(const DataObjID &key) const
Definition: DataHandle.h:46
std::string
STL class.

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..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-05

Definition at line 61 of file ParsersVct.cpp.

62 {
63
64 Gaudi::XYZPoint point;
65 StatusCode sc = parse( point, input );
66 if ( sc.isFailure() ) {
67 return sc;
68 } // RETURN
69 result = point;
70 return StatusCode::SUCCESS; // RETURN
71 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
ROOT::Math::PositionVector3D
Definition: IMagneticFieldSvc.h:17
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28

StatusCode Gaudi::Parsers::parse | ( | DataObjID & | v,
|  | const std::string & | s
| ) |  |

Definition at line 20 of file DataObjIDProperty.cpp.

21 {
22 // default values
23 StatusCode sc( StatusCode::FAILURE );
24 std::string prop;
25 sc = Gaudi::Parsers::parse( prop, s );
26
27 if ( sc.isSuccess() ) {
28 // split the string in 1 or 2 words:
29 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
30 boost::char_separator<char> sep( "(), " );
31 tokenizer tokens( prop, sep );
32 int nToks( distance( tokens.begin(), tokens.end() ) );
33 auto it = tokens.begin();
34
35 if ( nToks == 1 ) {
36 // Gaudi style /path/to/object
37 std::string k = *it;
38 boost::erase_all( k, "'" );
39 v = DataObjID( k );
40
41 } else if ( nToks == 2 ) {
42 // ATLAS style (clid, 'key') or ('ClassName', 'key')
43 CLID c( 0 );
44 std::string cn( *it );
45 DataObjID id;
46
47 try {
48 c = std::stoi( *it );
49 } catch ( const std::invalid_argument& /*e*/ ) {
50 // not a number
51 boost::erase_all( cn, "'" );
52 c = 0;
53 }
54
55 ++it;
56 std::string k = *it;
57 boost::erase_all( k, "'" );
58 ++it;
59
60 if ( c != 0 ) {
61 v = DataObjID( c, k );
62 } else {
63 v = DataObjID( cn, k );
64 }
65 } else {
66 std::cerr << "Unable to instantiate a DataObjID from a Property " << s << " :: Format is bad" << std::endl;
67 sc = StatusCode::FAILURE;
68 return sc;
69 }
70 }
71 return sc;
72 }
std::distance
T distance(T...args)
gaudirun.c
c
Definition: gaudirun.py:407
StatusCode::FAILURE
Definition: StatusCode.h:31
DataObjID
Definition: DataObjID.h:37
std::endl
T endl(T...args)
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
std::cerr
std::stoi
T stoi(T...args)
std::invalid_argument
STL class.

StatusCode Gaudi::Parsers::parse | ( | DataObjIDColl & | v,
|  | const std::string & | s
| ) |  |

Definition at line 76 of file DataObjIDProperty.cpp.

77 {
78 // default values
79 StatusCode sc( StatusCode::FAILURE );
80 std::string prop;
81 sc = Gaudi::Parsers::parse( prop, s );
82
83 if ( sc.isSuccess() ) {
84
85 // Reset Collection
86 v.clear();
87
88 bool isGaudi( true );
89
90 // Gaudi style [ '/path/to/data', '/other/data' ] or
91 // ATLAS style [ ('ClassName', 'key') , (ClassID, 'key2') ]
92 if ( s.find( "(" ) != std::string::npos ) {
93 isGaudi = false;
94 }
95
96 // split the string in 1 or 2 words:
97 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
98 boost::char_separator<char> sep( "[](), " );
99 tokenizer tokens( prop, sep );
100 auto it = tokens.begin();
101
102 CLID c( 0 );
103 std::string cn;
104
105 while ( it != tokens.end() ) {
106
107 if ( isGaudi ) {
108
109 std::string k = *it;
110 boost::erase_all( k, "'" );
111 v.emplace( DataObjID( k ) );
112 ++it;
113
114 } else {
115
116 try {
117 c = std::stoi( *it );
118 } catch ( const std::invalid_argument& /*e*/ ) {
119 // class name, not ClassID
120 cn = *it;
121 boost::erase_all( cn, "'" );
122 c = 0;
123 }
124
125 ++it;
126 std::string k = *it;
127 boost::erase_all( k, "'" );
128 ++it;
129
130 if ( c != 0 ) {
131 v.emplace( DataObjID( c, k ) );
132 } else {
133 v.emplace( DataObjID( cn, k ) );
134 }
135 }
136 }
137 }
138 return sc;
139 }
gaudirun.c
c
Definition: gaudirun.py:407
StatusCode::FAILURE
Definition: StatusCode.h:31
DataObjID
Definition: DataObjID.h:37
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
std::unordered_set::clear
T clear(T...args)
std::string::find
T find(T...args)
std::unordered_set::emplace
T emplace(T...args)
std::stoi
T stoi(T...args)
std::invalid_argument
STL class.

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..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-05

Definition at line 73 of file ParsersVct.cpp.

73 { return parse_( result, input ); }
Gaudi::Parsers::parse_
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:38

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..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-05

Definition at line 83 of file ParsersVct.cpp.

84 {
85 result.clear();
86 return parse_( result, input );
87 }
std::vector::clear
T clear(T...args)
Gaudi::Parsers::parse_
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:38

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..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-05

Definition at line 96 of file ParsersVct.cpp.

97 {
98 result.clear();
99 return parse_( result, input );
100 }
std::vector::clear
T clear(T...args)
Gaudi::Parsers::parse_
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:38

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..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-05

Definition at line 111 of file ParsersVct.cpp.

112 {
113 return parse_( result, input );
114 }
Gaudi::Parsers::parse_
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:38

StatusCode Gaudi::Parsers::parse | ( | std::vector< std::pair< double, double >> & | 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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-12parse 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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-12

See also
  Gaudi::Parsers::parser(char&,std::string&)
  Gaudi::Parsers::parser(char&,std::string&) parse the `int` value
  Gaudi::Parsers::IntGrammar

Parameters

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

Returns
  status code

Author
  Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

See also
  Gaudi::Parsers::parser( int&, const std::string& )
  Gaudi::Parsers::parser( int&, const std::string& )
  Gaudi::Parsers::parser( int&, const std::string& )
  Gaudi::Parsers::parser( int&, const std::string& )
  Gaudi::Parsers::parser( int&, const std::string& )
  Gaudi::Parsers::parser( int&, const std::string& )
  Gaudi::Parsers::parser( int&, const std::string& ) parse the `double` value
  Gaudi::Parsers::RealGrammar

Parameters

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

Returns
  status code

Author
  Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

See also
  Gaudi::Parsers::parser( double&, const std::string& )
  Gaudi::Parsers::parser( double&, const std::string& ) parse the `std::string` value
  Gaudi::Parsers::StringGrammar

Parameters

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

Returns
  status code

Author
  Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14parse 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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14parse 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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14parse 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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 13 of file ParsersStandardMisc1.cpp.

14 {
15 return Gaudi::Parsers::parse_( result, input );
16 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 18 of file ParsersStandardMisc1.cpp.

19 {
20 return Gaudi::Parsers::parse_( result, input );
21 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 23 of file ParsersStandardMisc1.cpp.

24 {
25 return Gaudi::Parsers::parse_( result, input );
26 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 3 of file ParsersStandardMisc2.cpp.

4 {
5 return Gaudi::Parsers::parse_( result, input );
6 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 75 of file StringKey.cpp.

76 {
77 std::string _result;
78 StatusCode sc = parse( _result, input );
79 result = Gaudi::StringKey( _result );
80 return sc;
81 }
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
Gaudi::StringKey
The helper class to represent the efficient "key" for access.
Definition: StringKey.h:35
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28

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 93 of file StringKey.cpp.

94 {
95 result.clear();
96 typedef std::vector<std::string> Strings;
97 Strings _result;
98 StatusCode sc = parse( _result, input );
99 if ( sc.isFailure() ) {
100 return sc;
101 } // RETURN
102 result.reserve( _result.size() );
103 //
104 std::copy( _result.begin(), _result.end(), std::back_inserter( result ) );
105 //
106 return StatusCode::SUCCESS;
107 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
std::copy
T copy(T...args)
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:13
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
std::vector::clear
T clear(T...args)
std::vector< std::string >
std::back_inserter
T back_inserter(T...args)
std::vector::reserve
T reserve(T...args)

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 8 of file ParsersStandardMisc2.cpp.

9 {
10 return Gaudi::Parsers::parse_( result, input );
11 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 13 of file ParsersStandardMisc2.cpp.

14 {
15 return Gaudi::Parsers::parse_( result, input );
16 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 18 of file ParsersStandardMisc2.cpp.

19 {
20 return Gaudi::Parsers::parse_( result, input );
21 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 3 of file ParsersStandardMisc3.cpp.

4 {
5 return Gaudi::Parsers::parse_( result, input );
6 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 13 of file ParsersStandardMisc3.cpp.

14 {
15 return Gaudi::Parsers::parse_( result, input );
16 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 18 of file ParsersStandardMisc3.cpp.

19 {
20 return Gaudi::Parsers::parse_( result, input );
21 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 3 of file ParsersStandardMisc4.cpp.

4 {
5 return Gaudi::Parsers::parse_( result, input );
6 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-14

Definition at line 8 of file ParsersStandardMisc4.cpp.

9 {
10 return Gaudi::Parsers::parse_( result, input );
11 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
  Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com

Date
  2007-12-06

Definition at line 13 of file ParsersStandardMisc4.cpp.

14 {
15 return Gaudi::Parsers::parse_( result, input );
16 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
  Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com

Date
  2007-12-06

Definition at line 3 of file ParsersStandardMisc5.cpp.

4 {
5 return Gaudi::Parsers::parse_( result, input );
6 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 8 of file ParsersStandardMisc3.cpp.

9 {
10 return Gaudi::Parsers::parse_( result, input );
11 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33
template<typename K , typename V , typename M >

GAUDI_API StatusCode Gaudi::Parsers::parse | ( | GaudiUtils::Map< K, V, M > & | result,
|  | const std::string & | input
| ) |  |

parse the `GaudiUtils::Map<K, V, M>` objects

See also
  Gaudi::Parsers::MapGrammar

Definition at line 420 of file Parsers.h.

421 {
422 return parse( (M&)result, input );
423 }
Gaudi::Parsers::parse
StatusCode parse(char(&result)[N], const std::string &input)
parser function for C-strings
Definition: Parsers.h:520

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 Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-12

Definition at line 8 of file ParsersStandardMisc5.cpp.

9 {
10 Skipper skipper;
11 KeyValueGrammar<IteratorT, Skipper> g;
12 KeyValueGrammar<IteratorT, Skipper>::ResultT result;
13 auto iter = input.begin();
14 bool parse_result = qi::phrase_parse( iter, input.end(), g, skipper, result ) && ( iter == input.end() );
15 if ( parse_result ) {
16 name = result.first;
17 value = result.second;
18 }
19 return parse_result;
20 }
Gaudi::Parsers::Skipper
SkipperGrammar< IteratorT > Skipper
Definition: ParsersFactory.h:30
std::string::end
T end(T...args)
std::string::begin
T begin(T...args)
gaudirun.g
dictionary g
Definition: gaudirun.py:439

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 ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
  Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com

Date
  2007-09-17

Definition at line 8 of file ParsersHistograms.cpp.

9 {
10 return Gaudi::Parsers::parse_( result, input );
11 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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 ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
  Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com

Date
  2007-09-17

Definition at line 13 of file ParsersHistograms.cpp.

14 {
15 return Gaudi::Parsers::parse_( result, input );
16 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
  Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com

Date
  2009-05-19

Definition at line 22 of file ParsersStandardMisc5.cpp.

23 {
24 return Gaudi::Parsers::parse_( result, input );
25 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33
template<class T , unsigned int N>

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

parser function for C-arrays

Parameters

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

Returns
  status code

Author
  Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-15

Definition at line 494 of file Parsers.h.

495 {
496 typedef std::vector<T> _Vct;
497 // create the temporary vector
498 _Vct tmp;
499 StatusCode sc = parse( tmp, input );
500 if ( sc.isFailure() ) {
501 return sc;
502 } // RETURN
503 if ( N != tmp.size() ) {
504 return StatusCode::FAILURE;
505 } // RETURN
506 //
507 std::copy( tmp.begin(), tmp.end(), result );
508 //
509 return StatusCode::SUCCESS; // RETURN
510 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Parsers::parse
StatusCode parse(char(&result)[N], const std::string &input)
parser function for C-strings
Definition: Parsers.h:520
std::copy
T copy(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:31
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
IOTest.N
int N
Definition: IOTest.py:101
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
std::vector
STL class.
template<unsigned int N>

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

parser function for C-strings

Parameters

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

Returns
  status code

Author
  Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl

Date
  2009-09-15

Definition at line 520 of file Parsers.h.

521 {
522 // clear the string
523 std::fill_n( result, N, ' ' );
524 // create the temporary string
525 std::string tmp;
526 StatusCode sc = parse( tmp, input );
527 if ( sc.isFailure() ) {
528 return sc;
529 } // RETURN
530 if ( N == tmp.size() ) {
531 std::copy( tmp.begin(), tmp.end(), result );
532 } else if ( N + 2 == tmp.size() && ( '\'' == tmp[0] || '\"' == tmp[0] ) && ( tmp[0] == tmp[tmp.size() - 1] ) ) {
533 std::copy( tmp.begin() + 1, tmp.end() - 1, result );
534 } else {
535 return StatusCode::FAILURE;
536 }
537 //
538 return StatusCode::SUCCESS; // RETURN
539 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Parsers::parse
StatusCode parse(char(&result)[N], const std::string &input)
parser function for C-strings
Definition: Parsers.h:520
std::copy
T copy(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:31
std::string::end
T end(T...args)
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
std::string
STL class.
IOTest.N
int N
Definition: IOTest.py:101
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
std::string::size
T size(T...args)
std::string::begin
T begin(T...args)
std::fill_n
T fill_n(T...args)

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

parse the key from the string

See also
  Gaudi::Parsers
  Gaudi::Parsers::parse
  Gaudi::VectorMap

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 9 of file ParsersCollections.cpp.

10 {
11 return Gaudi::Parsers::parse_( result, input );
12 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33

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

parse the vector of keys from the string

See also
  Gaudi::Parsers
  Gaudi::Parsers::parse
  Gaudi::VectorMap
  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 14 of file ParsersCollections.cpp.

15 {
16 return Gaudi::Parsers::parse_( result, input );
17 }
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: ParsersFactory.h:33
template<typename ResultT >

StatusCode Gaudi::Parsers::parse_ | ( | ResultT & | result,
|  | const std::string & | input
| ) |  |
| inline

Definition at line 33 of file ParsersFactory.h.

34 {
35 Skipper skipper;
36 typename Grammar_<IteratorT, ResultT, Skipper>::Grammar g;
37 IteratorT iter = input.begin(), end = input.end();
38 return qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end );
39 }
Gaudi::Parsers::Skipper
SkipperGrammar< IteratorT > Skipper
Definition: ParsersFactory.h:30
std::string::end
T end(T...args)
Gaudi::Parsers::IteratorT
std::string::const_iterator IteratorT
Definition: ParsersFactory.h:28
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64
std::string::begin
T begin(T...args)
gaudirun.g
dictionary g
Definition: gaudirun.py:439
template<typename T1 , typename T2 >

StatusCode Gaudi::Parsers::parse_ | ( | ROOT::Math::PositionVector3D< T1, T2 > & | result,
|  | const std::string & | input
| ) |  |
| inline

Definition at line 38 of file ParsersVct.cpp.

39 {
40 Skipper skipper;
41 typename Grammar_<IteratorT, ROOT::Math::PositionVector3D<T1, T2>, Skipper>::Grammar g;
42 IteratorT iter = input.begin(), end = input.end();
43 if ( qi::phrase_parse( iter, end, g, skipper, result ) ) {
44 return StatusCode::SUCCESS;
45 }
46 //@attention always
47 return true;
48 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Parsers::Skipper
SkipperGrammar< IteratorT > Skipper
Definition: ParsersFactory.h:30
std::string::end
T end(T...args)
Gaudi::Parsers::IteratorT
std::string::const_iterator IteratorT
Definition: ParsersFactory.h:28
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64
std::string::begin
T begin(T...args)
gaudirun.g
dictionary g
Definition: gaudirun.py:439
template<>

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

Definition at line 42 of file ParsersFactory.h.

43 {
44 Skipper skipper;
45 Grammar_<IteratorT, std::string, Skipper>::Grammar g;
46 IteratorT iter = input.begin(), end = input.end();
47 if ( !( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ) ) {
48 result = input;
49 }
50 //@attention always
51 return true;
52 }
Gaudi::Parsers::Skipper
SkipperGrammar< IteratorT > Skipper
Definition: ParsersFactory.h:30
std::string::end
T end(T...args)
Gaudi::Parsers::IteratorT
std::string::const_iterator IteratorT
Definition: ParsersFactory.h:28
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64
std::string::begin
T begin(T...args)
gaudirun.g
dictionary g
Definition: gaudirun.py:439

bool Gaudi::Parsers::ParseUnits | ( | const Position & | from,
|  | const std::string & | filename,
|  | const std::string & | search_path,
|  | IncludedFiles * | included,
|  | Messages * | messages,
|  | Node * | root
| ) |  |

Definition at line 134 of file Parser.cpp.

136 {
137 using Grammar = UnitsGrammar<Iterator, SkipperGrammar<Iterator>>;
138 return ParseFile<Grammar>( from, filename, search_path, included, messages, root );
139 }
graphanalysis.filename
string filename
Definition: graphanalysis.py:117
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:18

bool Gaudi::Parsers::ReadOptions | ( | const std::string & | filename,
|  | const std::string & | search_path,
|  | Messages * | messages,
|  | Catalog * | catalog,
|  | Units * | units,
|  | PragmaOptions * | pragma,
|  | Node * | root
| ) |  |

Parse and analyze filename, save all messages and properties.

Also output AST tree (http://en.wikipedia.org/wiki/Abstract_syntax_tree). Returns true if there were no errors during analysis.

Definition at line 392 of file Analyzer.cpp.

394 {
395 // Extract Path
396 IncludedFiles included;
397 bool result = Parse( filename, search_path, &included, messages, root );
398 if ( !result ) return false;
399
400 bool result1 = Analyze( root, search_path, &included, messages, catalog, units, pragma );
401 bool result2 = Unreference( *catalog, messages );
402 return result1 && result2;
403 }
Gaudi::Parsers::Parse
bool Parse(const std::string &filename, const std::string &search_path, IncludedFiles *included, Messages *messages, Node *root)
Definition: Parser.cpp:120
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:18
Unreference
bool Unreference(gp::Catalog &catalog, gp::Messages *messages)
Definition: Analyzer.cpp:370

Gaudi::Parsers::REGISTER_GRAMMAR | ( | GaudiMath::Interpolation::Type | ,
|  | InterpolGrammar |
| ) |  |

Gaudi::Parsers::REGISTER_GRAMMAR | ( | Edges | ,
|  | EdgeGrammar |
| ) |  |

Gaudi::Parsers::REGISTER_GRAMMAR | ( | std::string | ,
|  | StringGrammar |
| ) |  |

Gaudi::Parsers::REGISTER_GRAMMAR | ( | Gaudi::StringKey | ,
|  | StringGrammar |
| ) |  |

Gaudi::Parsers::REGISTER_GRAMMAR | ( | char | ,
|  | CharGrammar |
| ) |  |

Gaudi::Parsers::REGISTER_GRAMMAR | ( | H1 | ,
|  | H1Grammar |
| ) |  |

Gaudi::Parsers::REGISTER_GRAMMAR | ( | bool | ,
|  | BoolGrammar |
| ) |  |

Gaudi::Parsers::REGISTER_GRAMMAR | ( | H2 | ,
|  | H2Grammar |
| ) |  |

Gaudi::Parsers::REGISTER_GRAMMAR | ( | Gaudi::Histo1DDef | ,
|  | Histo1DGrammar |
| ) |  |