13 #ifndef DD4HEP_PARSERS_H
14 #define DD4HEP_PARSERS_H 1
28 #define PARSERS_DECL_FOR_SINGLE(Type) \
29 int parse(Type& result, const std::string& input);
31 #define PARSERS_DECL_FOR_PAIR(FirstType, SecondType) \
32 int parse(std::pair<FirstType, SecondType >& result,const std::string& input);
34 #if defined(DD4HEP_HAVE_ALL_PARSERS)
35 #define PARSERS_DECL_FOR_LIST(InnerType) \
36 int parse(std::vector<InnerType >& result,const std::string& input); \
37 int parse(std::list<InnerType >& result,const std::string& input); \
38 int parse(std::set<InnerType >& result,const std::string& input); \
39 int parse(std::deque<InnerType >& result,const std::string& input); \
40 int parse(std::map<std::string,InnerType >& result,const std::string& input); \
41 int parse(std::map<int,InnerType >& result,const std::string& input); \
42 int parse(std::map<unsigned long,InnerType >& result,const std::string& input); \
43 int parse(std::pair<std::string,InnerType >& result,const std::string& input); \
44 int parse(std::pair<int,InnerType >& result,const std::string& input); \
45 int parse(std::pair<unsigned long,InnerType >& result,const std::string& input);
49 #define PARSERS_DECL_FOR_LIST(InnerType) \
50 int parse(std::vector<InnerType >& result,const std::string& input); \
51 int parse(std::list<InnerType >& result,const std::string& input); \
52 int parse(std::set<InnerType >& result,const std::string& input); \
53 int parse(std::map<std::string,InnerType >& result,const std::string& input); \
54 int parse(std::map<int,InnerType >& result,const std::string& input); \
55 int parse(std::pair<std::string,InnerType >& result,const std::string& input); \
56 int parse(std::pair<int,InnerType >& result,const std::string& input);
58 #endif // DD4HEP_HAVE_ALL_PARSERS
123 #if defined(DD4HEP_HAVE_ALL_PARSERS)
145 #if defined(DD4HEP_HAVE_ALL_PARSERS)
174 #if defined(DD4HEP_HAVE_ALL_PARSERS)
200 #if defined(DD4HEP_HAVE_ALL_PARSERS)
258 int parse(std::vector<std::pair<double, double> >& result,
const std::string& input);
273 int parse(std::vector<std::pair<int, int> >& result,
const std::string& input);
289 int parse(std::vector<std::vector<std::string> >& result,
const std::string& input);
303 int parse(std::vector<std::vector<double> >& result,
const std::string& input);
319 int parse(std::map<int, int>& result,
const std::string& input);
334 int parse(std::map<int, double>& result,
const std::string& input);
348 int parse(std::map<std::string, std::string>& result,
const std::string& input);
363 int parse(std::map<std::string, int>& result,
const std::string& input);
378 int parse(std::map<std::string, double>& result,
const std::string& input);
394 int parse(std::map<std::string, std::vector<std::string> >& result,
const std::string& input);
411 int parse(std::map<std::string, std::vector<int> >& result,
const std::string& input);
428 int parse(std::map<std::string, std::vector<double> >& result,
const std::string& input);
437 int parse(std::map<int, std::string>& result,
const std::string& input);
447 #if defined(DD4HEP_HAVE_ALL_PARSERS)
448 int parse(std::map<unsigned int, std::string>& result,
const std::string& input);
455 int parse(std::map<std::string, unsigned int>& result,
const std::string& input);
485 int parse(std::string& name, std::string& value,
const std::string& input);
499 int parse(std::map<std::string, std::pair<double, double> >& params,
const std::string& input);
509 template <
class T,
unsigned int N>
510 int parse(
T (&result)[N],
const std::string& input) {
511 typedef std::vector<T> _Vct;
514 int sc =
parse(tmp, input);
518 if (N != tmp.size()) {
522 std::copy(tmp.begin(), tmp.end(), result);
534 template <
unsigned int N>
535 int parse(
char (&result)[N],
const std::string& input) {
537 std::fill_n(result, N,
' ');
540 int sc =
parse(tmp, input);
544 if (N == tmp.size()) {
545 std::copy(tmp.begin(), tmp.end(), result);
547 else if (N + 2 == tmp.size() && (
'\'' == tmp[0] ||
'\"' == tmp[0]) && (tmp[0] == tmp[tmp.size() - 1])) {
548 std::copy(tmp.begin() + 1, tmp.end() - 1, result);
561 #ifndef DD4HEP_PARSERS_NO_ROOT
563 #include "Math/Point3D.h"
564 #include "Math/Vector3D.h"
565 #include "Math/Vector4D.h"
570 bool operator<(
const XYZPoint& a,
const XYZPoint& b);
572 bool operator<(
const XYZVector& a,
const XYZVector& b);
574 bool operator<(
const PxPyPzEVector& a,
const PxPyPzEVector& b);
619 int parse(ROOT::Math::XYZPoint& result,
const std::string& input);
657 int parse( ROOT::Math::XYZVector& result,
const std::string& input);
728 int parse(ROOT::Math::PxPyPzEVector& result,
const std::string& input);
764 #endif // DD4HEP_PARSERS_H
#define PARSERS_DECL_FOR_LIST(InnerType)
#define PARSERS_DECL_FOR_SINGLE(Type)
bool operator<(const XYZPoint &a, const XYZPoint &b)
Allow point insertion of a point in maps.
int parse(Property &result, const std::string &input)
#define PARSERS_DECL_FOR_PAIR(FirstType, SecondType)