The Gaudi Framework  master (37c0b60a)
CommonParsers.h File Reference
#include <list>
#include <map>
#include <set>
#include <string>
#include <unordered_set>
#include <vector>
#include <GaudiKernel/HistoDef.h>
#include <GaudiKernel/Map.h>
#include <GaudiKernel/StatusCode.h>
Include dependency graph for CommonParsers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Gaudi
 This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from python with a format liks : ( nbins, min, max, title ) where title can be ommited.
 
 Gaudi::Parsers
 

Macros

#define PARSERS_DECL_FOR_SINGLE(Type)   GAUDI_API StatusCode parse( Type& result, std::string_view input );
 
#define PARSERS_DECL_FOR_PAIR(FirstType, SecondType)   GAUDI_API StatusCode parse( std::pair<FirstType, SecondType>& result, std::string_view input );
 
#define PARSERS_DECL_FOR_LIST(InnerType)   GAUDI_API StatusCode parse( std::vector<InnerType>& result, std::string_view input );
 
#define PARSERS_DECL_FOR_SET(InnerType)
 

Functions

GAUDI_API StatusCode Gaudi::Parsers::parse (std::vector< std::pair< double, double >> &result, std::string_view input)
 parse the bool value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::vector< std::pair< int, int >> &result, std::string_view input)
 parse the std::vector<std::pair<int,int> > value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::vector< std::vector< std::string >> &result, std::string_view input)
 parse the std::vector<std::vector<std::string> > value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::vector< std::vector< double >> &result, std::string_view input)
 parse the std::vector<std::vector<double> > value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::vector< std::vector< int >> &result, std::string_view input)
 parse the std::vector<std::vector<int> > value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< int, int > &result, std::string_view input)
 parse the std::map<int , int> value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< int, double > &result, std::string_view input)
 parse the std::map<int , double> value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, std::string > &result, std::string_view input)
 parse the std::map<std::string , std::string> value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, std::string, std::less<>> &result, std::string_view input)
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, int > &result, std::string_view input)
 parse the std::map<std::string , int> value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, double > &result, std::string_view input)
 parse the std::map<std::string , double> value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, std::vector< std::string >> &result, std::string_view input)
 parse the std::map<std::string , std::vector<std::string> > value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, std::vector< int >> &result, std::string_view input)
 parse the std::map<std::string , std::vector<int> > value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, std::vector< double >> &result, std::string_view input)
 parse the std::map<std::string , std::vector<double> > value More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< int, std::string > &result, std::string_view input)
 parse the std::map<int,std::string> > objects More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< unsigned int, std::string > &result, std::string_view input)
 parse the std::map<unsigned int,std::string> > objects More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, unsigned int > &result, std::string_view input)
 parse the std::map<unsigned int,std::string> > objects More...
 
template<typename K , typename V , typename M >
GAUDI_API StatusCode Gaudi::Parsers::parse (GaudiUtils::Map< K, V, M > &result, std::string_view input)
 parse the GaudiUtils::Map<K, V, M> objects More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::string &name, std::string &value, std::string_view input)
 parse the pair expression (map-component) " 'name' :value" More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (Gaudi::Histo1DDef &histo, std::string_view input)
 helper function, needed for implementation of "Histogram Property" More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, Gaudi::Histo1DDef > &histos, std::string_view input)
 helper function, needed for implementation of "Histogram Property" More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, std::pair< double, double >> &params, std::string_view input)
 helper function, needed for implementation of map of pairs More...
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, std::pair< int, int >> &params, std::string_view input)
 helper function, needed for implementation of map of pairs More...
 
template<class T , unsigned int N>
StatusCode Gaudi::Parsers::parse (T(&result)[N], std::string_view input)
 parser function for C-arrays More...
 
template<unsigned int N>
StatusCode Gaudi::Parsers::parse (char(&result)[N], std::string_view input)
 parser function for C-strings More...
 

Detailed Description

The declaration of major parsing functions used e.g for (re)implementation of new extended properties see class Property These function also could be used in a different, much wider contex. all of them have the semantic: StatusCode parse ( TYPE& result , std::string_view input ) where input is the input string to be parsed, and result is the the result of parsing

const std::string input = ... ;
// parse the input
StatusCode sc = parse ( result , input ) ;
if ( sc.isFailure() )
{
// error here ...
}
std::cout << "vector size " << result.size() << std::endl ;
See also
Gaudi::Parsers::parse
Property
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 in file CommonParsers.h.

Macro Definition Documentation

◆ PARSERS_DECL_FOR_LIST

#define PARSERS_DECL_FOR_LIST (   InnerType)    GAUDI_API StatusCode parse( std::vector<InnerType>& result, std::string_view input );

Definition at line 35 of file CommonParsers.h.

◆ PARSERS_DECL_FOR_PAIR

#define PARSERS_DECL_FOR_PAIR (   FirstType,
  SecondType 
)    GAUDI_API StatusCode parse( std::pair<FirstType, SecondType>& result, std::string_view input );

Definition at line 32 of file CommonParsers.h.

◆ PARSERS_DECL_FOR_SET

#define PARSERS_DECL_FOR_SET (   InnerType)
Value:
GAUDI_API StatusCode parse( std::set<InnerType>& result, std::string_view input ); \
GAUDI_API StatusCode parse( std::unordered_set<InnerType>& result, std::string_view input );

Definition at line 38 of file CommonParsers.h.

◆ PARSERS_DECL_FOR_SINGLE

#define PARSERS_DECL_FOR_SINGLE (   Type)    GAUDI_API StatusCode parse( Type& result, std::string_view input );

Definition at line 30 of file CommonParsers.h.

std::string
STL class.
std::unordered_set
STL class.
std::vector< std::string >
std::vector::size
T size(T... args)
StatusCode
Definition: StatusCode.h:65
std::cout
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
std::endl
T endl(T... args)
parse
StatusCode parse(DataObjID &dest, std::string_view src)
Definition: DataObjID.cpp:57
std::set
STL class.
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81