diff --git a/DDCore/include/DD4hep/BasicGrammar_inl.h b/DDCore/include/DD4hep/BasicGrammar_inl.h index 9f629aecd5ae9c0a35b95867a178ba60ffbb1300..89e8bb6a1bcb81f0b722c74a62acad1365d53ceb 100644 --- a/DDCore/include/DD4hep/BasicGrammar_inl.h +++ b/DDCore/include/DD4hep/BasicGrammar_inl.h @@ -331,6 +331,14 @@ namespace DD4hep { DD4HEP_DEFINE_PARSER_GRAMMAR_TYPE(x) \ DD4HEP_DEFINE_PARSER_GRAMMAR_EVAL(x,func) +#define DD4HEP_DEFINE_PARSER_GRAMMAR_DUMMY(x,func) \ + PARSERS_DECL_FOR_SINGLE(x) \ + DD4HEP_DEFINE_PARSER_GRAMMAR_TYPE(x) \ + DD4HEP_DEFINE_PARSER_GRAMMAR_EVAL(x,func) \ + namespace DD4hep { namespace Parsers { \ + int parse(x&, const std::string&) { return 1; } \ + }} + #if defined(DD4HEP_HAVE_ALL_PARSERS) #define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT(x,eval_func) \ DD4HEP_DEFINE_PARSER_GRAMMAR(x,eval_func) \ diff --git a/DDCore/include/DD4hep/Parsers.h b/DDCore/include/DD4hep/Parsers.h index a84592709a536be086d9961e8f8662f8e0465118..4ff7529ceaa61b8b142a384caea24eda1e74c303 100644 --- a/DDCore/include/DD4hep/Parsers.h +++ b/DDCore/include/DD4hep/Parsers.h @@ -25,9 +25,16 @@ #include <deque> // ============================================================================ -#define PARSERS_DECL_FOR_SINGLE(Type) \ - namespace DD4hep { namespace Parsers { \ - int parse(Type& result, const std::string& input); }} +#define PARSERS_DECL_FOR_SINGLE(Type) \ + namespace DD4hep { namespace Parsers { \ + int parse(Type& result, const std::string& input); \ + }} + +#define DD4HEP_DEFINE_PARSER_DUMMY(Type) \ + PARSERS_DECL_FOR_SINGLE(Type) \ + namespace DD4hep { namespace Parsers { \ + int parse(Type&, const std::string&) { return 1; } \ + }} #define PARSERS_DECL_FOR_PAIR(FirstType, SecondType) \ namespace DD4hep { namespace Parsers { \ diff --git a/DDCore/include/DD4hep/objects/ConditionsInterna.h b/DDCore/include/DD4hep/objects/ConditionsInterna.h index b700d55e7bf221e605d4dbb7a2183c263cbd8a35..52748fc5a7eddb0463e8cca6288f9e58108f6542 100644 --- a/DDCore/include/DD4hep/objects/ConditionsInterna.h +++ b/DDCore/include/DD4hep/objects/ConditionsInterna.h @@ -242,6 +242,7 @@ namespace DD4hep { } /* End namespace DD4hep */ #define DD4HEP_DEFINE_CONDITIONS_TYPE(x) \ + DD4HEP_DEFINE_OPAQUEDATA_TYPE(x) \ namespace DD4hep { \ namespace Conditions { \ template x& Condition::bind<x>(const std::string& val); \ diff --git a/DDCore/src/AlignmentData.cpp b/DDCore/src/AlignmentData.cpp index 793b7af6c686465f708effb0937669a57a480520..23b3f9c2cd32f1aef35f20d60be44f925a3d091c 100644 --- a/DDCore/src/AlignmentData.cpp +++ b/DDCore/src/AlignmentData.cpp @@ -202,13 +202,16 @@ Alignment AlignmentData::nominal() const { return detector.nominal(); } +#include "DD4hep/Parsers.h" #include "DD4hep/ToStream.h" -#include "DD4hep/objects/ConditionsInterna.h" -DD4HEP_DEFINE_OPAQUEDATA_TYPE(Delta) -DD4HEP_DEFINE_OPAQUEDATA_TYPE(AlignmentData) -DD4HEP_DEFINE_CONDITIONS_TYPE_DUMMY(Delta) -DD4HEP_DEFINE_CONDITIONS_TYPE_DUMMY(AlignmentData) +DD4HEP_DEFINE_PARSER_DUMMY(Delta) +DD4HEP_DEFINE_PARSER_DUMMY(AlignmentData) #include "DD4hep/BasicGrammar_inl.h" +#include "DD4hep/objects/ConditionsInterna.h" DD4HEP_DEFINE_PARSER_GRAMMAR(Delta,eval_none<Delta>) DD4HEP_DEFINE_PARSER_GRAMMAR(AlignmentData,eval_none<AlignmentData>) + +DD4HEP_DEFINE_CONDITIONS_TYPE(Delta) +DD4HEP_DEFINE_CONDITIONS_TYPE(AlignmentData) + diff --git a/DDCore/src/ConditionsData.cpp b/DDCore/src/ConditionsData.cpp index b159d18f75e0955ede57c63159853dfaf75a3e7a..64e683a36034058e1845031f2598c20e35f7844d 100644 --- a/DDCore/src/ConditionsData.cpp +++ b/DDCore/src/ConditionsData.cpp @@ -69,10 +69,10 @@ AbstractMap& AbstractMap::operator=(const AbstractMap& c) { return *this; } +#include "DD4hep/Parsers.h" #include "DD4hep/ToStream.h" -#include "DD4hep/objects/ConditionsInterna.h" -DD4HEP_DEFINE_CONDITIONS_TYPE_DUMMY(AbstractMap) - +DD4HEP_DEFINE_PARSER_DUMMY(AbstractMap) #include "DD4hep/BasicGrammar_inl.h" +#include "DD4hep/objects/ConditionsInterna.h" DD4HEP_DEFINE_PARSER_GRAMMAR(AbstractMap,eval_none<AbstractMap>) - +DD4HEP_DEFINE_CONDITIONS_TYPE(AbstractMap)