Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Gaudi::Parsers Namespace Reference

Namespaces

 Utils
 

Classes

struct  BoolGrammar
 
class  Catalog
 
struct  CharGrammar
 
struct  DataObjIDGrammar
 
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::unordered_map< KeyT, ValueT, HashT, KeyCompareT, AllocatorT >, Skipper >
 
struct  Grammar_< Iterator, std::unordered_set< InnerT, HashT, CompareT, AllocatorT >, 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  InputData
 Helper class to enable ADL for parsers. More...
 
struct  InterpolGrammar
 
struct  IntGrammar
 
struct  KeyValueGrammar
 
struct  MapGrammar
 
class  Messages
 
struct  Node
 
struct  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 IteratorT
 
typedef SkipperGrammar< IteratorTSkipper
 
typedef std::string::const_iterator DefaultIterator
 
typedef enc::space_type DefaultSkipper
 

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::ostreamoperator<< (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)
 
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)
 
 REGISTER_GRAMMAR (std::string, StringGrammar)
 
 REGISTER_GRAMMAR (Gaudi::StringKey, StringGrammar)
 
 REGISTER_GRAMMAR (char, CharGrammar)
 
 REGISTER_GRAMMAR (bool, BoolGrammar)
 
 REGISTER_GRAMMAR (Gaudi::Histo1DDef, Histo1DGrammar)
 
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 &)
 
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...
 
 REGISTER_GRAMMAR (DataObjID, DataObjIDGrammar)
 
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 56 of file Grammars.h.

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

Definition at line 57 of file Grammars.h.

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

Definition at line 24 of file Factory.h.

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

Definition at line 26 of file Factory.h.

Function Documentation

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

printout operator

Definition at line 58 of file Catalog.h.

58 { return c.fillStream( o ); }
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 11 of file DODBasicMapper.cpp.

11  {
13  StatusCode sc = parse( tmp, input );
14  if ( sc.isSuccess() ) {
15  result.clear();
16  result.insert( tmp.begin(), tmp.end() );
17  }
18  return sc;
19  }
bool isSuccess() const
Definition: StatusCode.h:267
T end(T...args)
std::pair< iterator, bool > insert(ValueType &&val)
Definition: Map.h:168
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
T begin(T...args)
void clear()
Definition: Map.h:185
bool Gaudi::Parsers::Parse ( const std::string filename,
const std::string search_path,
IncludedFiles included,
Messages messages,
Node root 
)

Definition at line 114 of file Parser.cpp.

115  {
116  return Parse( Position(), filename, search_path, included, messages, root );
117 }
bool Parse(const std::string &filename, const std::string &search_path, IncludedFiles *included, Messages *messages, Node *root)
Definition: Parser.cpp:114
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 119 of file Parser.cpp.

120  {
121  using Grammar = FileGrammar<Iterator, SkipperGrammar<Iterator>>;
122  return ParseFile<Grammar>( from, filename, search_path, included, messages, root );
123 }
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 284 of file HistoParsers.cpp.

284  {
285  // 1) check the parsing
287  //
288  auto h1 = _parse_1D<TH1D>( input, name );
289  if ( h1 ) {
290  result.Reset();
291  h1->Copy( result ); // ASSIGN
292  result.SetName( name.c_str() );
293  return StatusCode::SUCCESS; // RETURN
294  }
295  //
296  // XML-like text?
297  return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
299 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:187
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
STL class.
T c_str(T...args)
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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 38 of file StdArrayAsProperty.h.

38  {
40  StatusCode sc = parse( tmp, input );
41  if ( sc.isFailure() ) return sc; // RETURN
42  if ( N != tmp.size() ) return StatusCode( StatusCode::FAILURE, true );
43  std::copy( tmp.begin(), tmp.end(), result.begin() );
44  return StatusCode::SUCCESS;
45  }
T copy(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
T end(T...args)
bool isFailure() const
Definition: StatusCode.h:130
int N
Definition: IOTest.py:99
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
T size(T...args)
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
STL class.
T begin(T...args)
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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 42 of file SVectorAsProperty.h.

42  {
44  StatusCode sc = parse( tmp, input );
45  if ( sc.isFailure() ) { return sc; } // RETURN
46  if ( N != tmp.size() ) { return StatusCode::FAILURE; } // RETURN
47 #ifdef WIN32
48 // Disable warning
49 // C4996: 'std::copy': Function call with parameters that may be unsafe
50 // The parameters are checked
51 # pragma warning( push )
52 # pragma warning( disable : 4996 )
53 #endif
54  std::copy( tmp.begin(), tmp.end(), result.begin() );
55 #ifdef WIN32
56 # pragma warning( pop )
57 #endif
58  return StatusCode::SUCCESS;
59  }
T copy(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
T end(T...args)
bool isFailure() const
Definition: StatusCode.h:130
int N
Definition: IOTest.py:99
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
T size(T...args)
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
T begin(T...args)
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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 330 of file HistoParsers.cpp.

330  {
331  // 1) check the parsing
333  auto h2 = _parse_2D<TH2D>( input, name );
334  if ( h2 ) {
335  result.Reset();
336  h2->Copy( result ); // ASSIGN
337  result.SetName( name.c_str() );
338  return StatusCode::SUCCESS; // RETURN
339  }
340  //
341  // XML-like text?
342  return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
344 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:187
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
STL class.
T c_str(T...args)
constexpr static const auto FAILURE
Definition: StatusCode.h:86
template<typename ResultT >
StatusCode Gaudi::Parsers::parse ( ResultT &  result,
const std::string input 
)
inline

Definition at line 48 of file Factory.h.

48  {
49  return parse_( result, input );
50  }
StatusCode parse_(std::string &result, const std::string &input)
Definition: Factory.h:38
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 307 of file HistoParsers.cpp.

307  {
308  // 1) check the parsing
310  //
311  auto h1 = _parse_1D<TH1F>( input, name );
312  if ( h1 ) {
313  result.Reset();
314  h1->Copy( result ); // ASSIGN
315  result.SetName( name.c_str() );
316  return StatusCode::SUCCESS; // RETURN
317  }
318  //
319  // XML-like text?
320  return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
322 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:187
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
STL class.
T c_str(T...args)
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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 352 of file HistoParsers.cpp.

352  {
353  // 1) check the parsing
355  auto h2 = _parse_2D<TH2F>( input, name );
356  if ( h2 ) {
357  result.Reset();
358  h2->Copy( result ); // ASSIGN
359  result.SetName( name.c_str() );
360  return StatusCode::SUCCESS; // RETURN
361  }
362  //
363  // XML-like text?
364  if ( std::string::npos != input.find( '<' ) ) { return Gaudi::Utils::Histos::fromXml( result, input ); }
365  //
366  return StatusCode::FAILURE;
367 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:187
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
STL class.
T c_str(T...args)
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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 421 of file HistoParsers.cpp.

421  {
422  // 1) convert to ROOT
423  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &result );
424  // 2) read ROOT histogram
425  return root ? parse( *root, input ) : StatusCode::FAILURE;
426 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:71
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
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 42 of file ParsersVct.cpp.

42 { return parse_( result, input ); }
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:32
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 434 of file HistoParsers.cpp.

434  {
435  // 1) convert to ROOT
436  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &result );
437  // 2) read ROOT histogram
438  return root ? parse( *root, input ) : StatusCode::FAILURE;
439 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:71
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
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 73 of file BoostArrayAsProperty.h.

73  {
74  typedef std::vector<TYPE> _Vct;
75  // create the temporaty vector
76  _Vct tmp;
77  // parse the string
78  StatusCode sc = parse( tmp, input );
79  if ( sc.isFailure() ) { return sc; } // RETURN
80  if ( N != tmp.size() ) { return StatusCode( StatusCode::FAILURE, true ); } // RETURN
81  // copy vector into array
82  std::copy( tmp.begin(), tmp.end(), result.begin() );
83  //
84  return StatusCode::SUCCESS;
85  }
T copy(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
bool isFailure() const
Definition: StatusCode.h:130
int N
Definition: IOTest.py:99
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
STL class.
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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 375 of file HistoParsers.cpp.

375  {
376  if ( result ) { return parse( *result, input ); } // RETURN
377 
378  // 1) check the parsing
380  auto h1 = _parse_1D<TH1D>( input, name );
381  if ( h1 ) {
382  result = h1.release();
383  result->SetName( name.c_str() );
384  return StatusCode::SUCCESS; // RETURN
385  }
386  //
387  // XML-like text?
388  return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
390 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:187
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
STL class.
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
T c_str(T...args)
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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 398 of file HistoParsers.cpp.

398  {
399  if ( result ) { return parse( *result, input ); } // RETURN
400 
401  // 1) check the parsing
403  auto h2 = _parse_2D<TH2D>( input, name );
404  if ( h2 ) {
405  result = h2.release();
406  result->SetName( name.c_str() );
407  return StatusCode::SUCCESS; // RETURN
408  }
409  //
410  // XML-like text?
411  return ( std::string::npos != input.find( '<' ) ) ? Gaudi::Utils::Histos::fromXml( result, input )
413 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:187
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
STL class.
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
T c_str(T...args)
constexpr static const auto FAILURE
Definition: StatusCode.h:86
StatusCode Gaudi::Parsers::parse ( DataObjectHandleBase v,
const std::string s 
)

Definition at line 11 of file DataObjectHandleProperty.cpp.

11  {
12  DataObjID id;
13  auto sc = parse( id, s );
14  if ( sc ) v.setKey( std::move( id ) );
15  return sc;
16  }
virtual void setKey(const DataObjID &key) const
Definition: DataHandle.h:44
T move(T...args)
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
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 52 of file ParsersVct.cpp.

52  {
53 
54  Gaudi::XYZPoint point;
55  StatusCode sc = parse( point, input );
56  if ( sc.isFailure() ) { return sc; } // RETURN
57  result = point;
58  return StatusCode::SUCCESS; // RETURN
59  }
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
bool isFailure() const
Definition: StatusCode.h:130
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
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 61 of file ParsersVct.cpp.

61 { return parse_( result, input ); }
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:32
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 71 of file ParsersVct.cpp.

71  {
72  result.clear();
73  return parse_( result, input );
74  }
T clear(T...args)
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:32
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 83 of file ParsersVct.cpp.

83  {
84  result.clear();
85  return parse_( result, input );
86  }
T clear(T...args)
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:32
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 97 of file ParsersVct.cpp.

97  {
98  return parse_( result, input );
99  }
StatusCode parse_(ROOT::Math::PositionVector3D< T1, T2 > &result, const std::string &input)
Definition: ParsersVct.cpp:32
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&, const std::string& )
Gaudi::Parsers::parser( char&, const 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 11 of file ParsersStandardMisc1.cpp.

11  {
12  return Gaudi::Parsers::parse_( result, input );
13 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 15 of file ParsersStandardMisc1.cpp.

15  {
16  return Gaudi::Parsers::parse_( result, input );
17 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 19 of file ParsersStandardMisc1.cpp.

19  {
20  return Gaudi::Parsers::parse_( result, input );
21 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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
inputthe input string
Returns
status code

Definition at line 74 of file StringKey.cpp.

74  {
75  std::string _result;
76  StatusCode sc = parse( _result, input );
77  result = Gaudi::StringKey( _result );
78  return sc;
79 }
The helper class to represent the efficient "key" for access.
Definition: StringKey.h:34
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
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.

3  {
4  return Gaudi::Parsers::parse_( result, input );
5 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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
inputthe input string
Returns
status code

Definition at line 91 of file StringKey.cpp.

91  {
92  result.clear();
93  typedef std::vector<std::string> Strings;
94  Strings _result;
95  StatusCode sc = parse( _result, input );
96  if ( sc.isFailure() ) { return sc; } // RETURN
97  result.reserve( _result.size() );
98  //
99  std::copy( _result.begin(), _result.end(), std::back_inserter( result ) );
100  //
101  return StatusCode::SUCCESS;
102 }
T copy(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
bool isFailure() const
Definition: StatusCode.h:130
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
T clear(T...args)
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
T back_inserter(T...args)
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 7 of file ParsersStandardMisc2.cpp.

7  {
8  return Gaudi::Parsers::parse_( result, input );
9 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 11 of file ParsersStandardMisc2.cpp.

11  {
12  return Gaudi::Parsers::parse_( result, input );
13 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 15 of file ParsersStandardMisc2.cpp.

15  {
16  return Gaudi::Parsers::parse_( result, input );
17 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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.

3  {
4  return Gaudi::Parsers::parse_( result, input );
5 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 11 of file ParsersStandardMisc3.cpp.

11  {
12  return Gaudi::Parsers::parse_( result, input );
13 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 15 of file ParsersStandardMisc3.cpp.

15  {
16  return Gaudi::Parsers::parse_( result, input );
17 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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.

3  {
4  return Gaudi::Parsers::parse_( result, input );
5 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 7 of file ParsersStandardMisc4.cpp.

7  {
8  return Gaudi::Parsers::parse_( result, input );
9 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 11 of file ParsersStandardMisc4.cpp.

11  {
12  return Gaudi::Parsers::parse_( result, input );
13 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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.

3  {
4  return Gaudi::Parsers::parse_( result, input );
5 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 7 of file ParsersStandardMisc3.cpp.

7  {
8  return Gaudi::Parsers::parse_( result, input );
9 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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 416 of file CommonParsers.h.

416  {
417  return parse( (M&)result, input );
418  }
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
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 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 7 of file ParsersStandardMisc5.cpp.

7  {
8  Skipper skipper;
9  KeyValueGrammar<IteratorT, Skipper> g;
10  KeyValueGrammar<IteratorT, Skipper>::ResultT result;
11  auto iter = input.begin();
12  bool parse_result = qi::phrase_parse( iter, input.end(), g, skipper, result ) && ( iter == input.end() );
13  if ( parse_result ) {
14  name = result.first;
15  value = result.second;
16  return StatusCode::SUCCESS;
17  }
18  return StatusCode::FAILURE;
19 }
SkipperGrammar< IteratorT > Skipper
Definition: Factory.h:26
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
T end(T...args)
T begin(T...args)
dictionary g
Definition: gaudirun.py:516
constexpr static const auto FAILURE
Definition: StatusCode.h:86
StatusCode Gaudi::Parsers::parse ( Gaudi::Histo1DDef histo,
const std::string input 
)

helper function, needed for implementation of "Histogram Property"

Parameters
histothe histogram description (output)
inputthe 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.

8  {
9  return Gaudi::Parsers::parse_( result, input );
10 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
StatusCode Gaudi::Parsers::parse ( std::map< std::string, Gaudi::Histo1DDef > &  histos,
const std::string input 
)

helper function, needed for implementation of "Histogram Property"

Parameters
histosthe map of the histogram descriptions (output)
inputthe 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 12 of file ParsersHistograms.cpp.

12  {
13  return Gaudi::Parsers::parse_( result, input );
14 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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
paramsthe map of pair
inputthe 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 21 of file ParsersStandardMisc5.cpp.

21  {
22  return Gaudi::Parsers::parse_( result, input );
23 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
template<class T , unsigned int N>
StatusCode Gaudi::Parsers::parse ( T(&)  result[N],
const std::string input 
)

parser function for C-arrays

Parameters
paramsC-array
inputthe 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 489 of file CommonParsers.h.

489  {
490  typedef std::vector<T> _Vct;
491  // create the temporary vector
492  _Vct tmp;
493  StatusCode sc = parse( tmp, input );
494  if ( sc.isFailure() ) { return sc; } // RETURN
495  if ( N != tmp.size() ) { return StatusCode::FAILURE; } // RETURN
496  //
497  std::copy( tmp.begin(), tmp.end(), result );
498  //
499  return StatusCode::SUCCESS; // RETURN
500  }
T copy(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
bool isFailure() const
Definition: StatusCode.h:130
int N
Definition: IOTest.py:99
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
STL class.
constexpr static const auto FAILURE
Definition: StatusCode.h:86
template<unsigned int N>
StatusCode Gaudi::Parsers::parse ( char(&)  result[N],
const std::string input 
)

parser function for C-strings

Parameters
paramsC-string
inputthe 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 510 of file CommonParsers.h.

510  {
511  // clear the string
512  std::fill_n( result, N, ' ' );
513  // create the temporary string
514  std::string tmp;
515  StatusCode sc = parse( tmp, input );
516  if ( sc.isFailure() ) { return sc; } // RETURN
517  if ( N == tmp.size() ) {
518  std::copy( tmp.begin(), tmp.end(), result );
519  } else if ( N + 2 == tmp.size() && ( '\'' == tmp[0] || '\"' == tmp[0] ) && ( tmp[0] == tmp[tmp.size() - 1] ) ) {
520  std::copy( tmp.begin() + 1, tmp.end() - 1, result );
521  } else {
522  return StatusCode::FAILURE;
523  }
524  //
525  return StatusCode::SUCCESS; // RETURN
526  }
T copy(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
T end(T...args)
bool isFailure() const
Definition: StatusCode.h:130
STL class.
int N
Definition: IOTest.py:99
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
T size(T...args)
StatusCode parse(DataObjID &dest, const std::string &src)
Definition: DataObjID.cpp:46
T begin(T...args)
T fill_n(T...args)
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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
inputthe input string
Returns
status code

Definition at line 9 of file ParsersCollections.cpp.

9  {
10  return Gaudi::Parsers::parse_( result, input );
11 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
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
inputthe input string
Returns
status code

Definition at line 13 of file ParsersCollections.cpp.

13  {
14  return Gaudi::Parsers::parse_( result, input );
15 }
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
template<typename ResultT >
StatusCode Gaudi::Parsers::parse_ ( ResultT &  result,
const std::string input 
)
inline

Definition at line 29 of file Factory.h.

29  {
30  Skipper skipper;
31  typename Grammar_<IteratorT, ResultT, Skipper>::Grammar g;
32  IteratorT iter = input.begin(), end = input.end();
33  return ( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ? StatusCode::SUCCESS
35  }
SkipperGrammar< IteratorT > Skipper
Definition: Factory.h:26
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
T end(T...args)
std::string::const_iterator IteratorT
Definition: Factory.h:24
T begin(T...args)
dictionary g
Definition: gaudirun.py:516
constexpr static const auto FAILURE
Definition: StatusCode.h:86
template<typename T1 , typename T2 >
StatusCode Gaudi::Parsers::parse_ ( ROOT::Math::PositionVector3D< T1, T2 > &  result,
const std::string input 
)
inline

Definition at line 32 of file ParsersVct.cpp.

32  {
33  Skipper skipper;
34  typename Grammar_<IteratorT, ROOT::Math::PositionVector3D<T1, T2>, Skipper>::Grammar g;
35  IteratorT iter = input.begin(), end = input.end();
36  if ( qi::phrase_parse( iter, end, g, skipper, result ) ) { return StatusCode::SUCCESS; }
37  //@attention always
38  return StatusCode::SUCCESS;
39  }
SkipperGrammar< IteratorT > Skipper
Definition: Factory.h:26
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
T end(T...args)
std::string::const_iterator IteratorT
Definition: Factory.h:24
T begin(T...args)
dictionary g
Definition: gaudirun.py:516
template<>
StatusCode Gaudi::Parsers::parse_ ( std::string result,
const std::string input 
)
inline

Definition at line 38 of file Factory.h.

38  {
39  Skipper skipper;
40  Grammar_<IteratorT, std::string, Skipper>::Grammar g;
41  IteratorT iter = input.begin(), end = input.end();
42  if ( !( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ) ) { result = input; }
43  //@attention always
44  return StatusCode::SUCCESS;
45  }
SkipperGrammar< IteratorT > Skipper
Definition: Factory.h:26
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
T end(T...args)
std::string::const_iterator IteratorT
Definition: Factory.h:24
T begin(T...args)
dictionary g
Definition: gaudirun.py:516
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 126 of file Parser.cpp.

127  {
128  using Grammar = UnitsGrammar<Iterator, SkipperGrammar<Iterator>>;
129  return ParseFile<Grammar>( from, filename, search_path, included, messages, root );
130 }
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 374 of file Analyzer.cpp.

375  {
376  // Extract Path
377  IncludedFiles included;
378  bool result = Parse( filename, search_path, &included, messages, root );
379  if ( !result ) return false;
380 
381  bool result1 = Analyze( root, search_path, &included, messages, catalog, units, pragma );
382  bool result2 = Unreference( *catalog, messages );
383  return result1 && result2;
384 }
bool Parse(const std::string &filename, const std::string &search_path, IncludedFiles *included, Messages *messages, Node *root)
Definition: Parser.cpp:114
bool Unreference(gp::Catalog &catalog, gp::Messages *messages)
Definition: Analyzer.cpp:353
Gaudi::Parsers::REGISTER_GRAMMAR ( GaudiMath::Interpolation::Type  ,
InterpolGrammar   
)
Gaudi::Parsers::REGISTER_GRAMMAR ( DataObjID  ,
DataObjIDGrammar   
)
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   
)