The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
CommonParsers.h File Reference

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. More...

#include <GaudiKernel/HistoDef.h>
#include <GaudiKernel/Map.h>
#include <GaudiKernel/StatusCode.h>
#include <list>
#include <map>
#include <set>
#include <string>
#include <unordered_set>
#include <vector>
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

namespace  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.
 
namespace  Gaudi::Parsers
 

Macros

#define PARSERS_DECL_FOR_SINGLE(Type)
 
#define PARSERS_DECL_FOR_PAIR(FirstType, SecondType)
 
#define PARSERS_DECL_FOR_LIST(InnerType)
 
#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
 
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
 
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
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::vector< std::vector< double > > &result, std::string_view input)
 parse the std::vector<std::vector<double> > value
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::vector< std::vector< int > > &result, std::string_view input)
 parse the std::vector<std::vector<int> > value
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< int, int > &result, std::string_view input)
 parse the std::map<int , int> value
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< int, double > &result, std::string_view input)
 parse the std::map<int , double> value
 
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
 
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
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< std::string, double > &result, std::string_view input)
 parse the std::map<std::string , double> value
 
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
 
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
 
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
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::map< int, std::string > &result, std::string_view input)
 parse the std::map<int,std::string> > objects
 
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
 
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
 
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
 
GAUDI_API StatusCode Gaudi::Parsers::parse (std::string &name, std::string &value, std::string_view input)
 parse the pair expression (map-component) " 'name' :value"
 
GAUDI_API StatusCode Gaudi::Parsers::parse (Gaudi::Histo1DDef &histo, std::string_view input)
 helper function, needed for implementation of "Histogram Property"
 
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"
 
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
 
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
 
template<class T, unsigned int N>
StatusCode Gaudi::Parsers::parse (T(&result)[N], std::string_view input)
 parser function for C-arrays
 
template<unsigned int N>
StatusCode Gaudi::Parsers::parse (char(&result)[N], std::string_view input)
 parser function for C-strings
 

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 = ... ;
std::vector<std::string> result ;
// parse the input
StatusCode sc = parse ( result , input ) ;
if ( sc.isFailure() )
{
// error here ...
}
std::cout << "vector size " << result.size() << std::endl ;
StatusCode parse(DataObjID &dest, std::string_view src)
Definition DataObjID.cpp:58
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
bool isFailure() const
Definition StatusCode.h:129
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)
Value:
GAUDI_API StatusCode parse( std::vector<InnerType>& result, std::string_view input );
#define GAUDI_API
Definition Kernel.h:49

Definition at line 28 of file CommonParsers.h.

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

◆ PARSERS_DECL_FOR_PAIR

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

Definition at line 25 of file CommonParsers.h.

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

◆ 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 31 of file CommonParsers.h.

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

◆ PARSERS_DECL_FOR_SINGLE

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

Definition at line 23 of file CommonParsers.h.