Warning, /include/Parsers/detail/Dimension.inl is written in an unsupported language. File is not indexed.
0001 //==========================================================================
0002 // AIDA Detector description implementation
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author : M.Frank
0011 //
0012 //==========================================================================
0013
0014 /**
0015 * Note: Do NEVER include this file directly!
0016 *
0017 * Also NO header guards!
0018 * Include XML/XMLDimension.h or JSON/Dimension.h !
0019 */
0020
0021
0022 #define XML_ATTR_NS_ACCESSOR(type,ns,name) type ns::name() const { return m_element.attr<type>(_dd4hep_Unicode_Item(name)); }
0023
0024 #define XML_ATTR_NS_ACCESSOR_DEFAULT(type,ns,name,dressing) \
0025 type ns::name(type default_val) const { \
0026 const XmlChar* val = m_element.attr_value_nothrow(_dd4hep_Unicode_Item(name)); \
0027 return val ? dressing(val) : default_val; }
0028
0029 #define XML_ATTR_NS_ACCESSOR_DOUBLE(ns,name) \
0030 XML_ATTR_NS_ACCESSOR(double,ns,name) \
0031 XML_ATTR_NS_ACCESSOR_DEFAULT(double,ns,name,dd4hep:: DD4HEP_DIMENSION_NS ::_toDouble)
0032
0033 #define XML_ATTR_NS_ACCESSOR_INT(ns,name) \
0034 XML_ATTR_NS_ACCESSOR(int,ns,name) \
0035 XML_ATTR_NS_ACCESSOR_DEFAULT(int,ns,name,dd4hep:: DD4HEP_DIMENSION_NS ::_toInt)
0036
0037 #define XML_ATTR_NS_ACCESSOR_STRING(ns,name) \
0038 XML_ATTR_NS_ACCESSOR(std::string,ns,name) \
0039 XML_ATTR_NS_ACCESSOR_DEFAULT(std::string,ns,name,dd4hep:: DD4HEP_DIMENSION_NS ::_toString)
0040
0041
0042 #define XML_ATTR_ACCESSOR(type,name) XML_ATTR_NS_ACCESSOR(type,dd4hep:: DD4HEP_DIMENSION_NS ::Dimension,name)
0043 #define XML_ATTR_ACCESSOR_DEFAULT(name,type,dressing) XML_ATTR_NS_ACCESSOR_DEFAULT(type,dd4hep:: DD4HEP_DIMENSION_NS ::Dimension,name,dressing)
0044 #define XML_ATTR_ACCESSOR_DOUBLE(name) XML_ATTR_NS_ACCESSOR_DOUBLE(dd4hep:: DD4HEP_DIMENSION_NS ::Dimension,name)
0045
0046 #define XML_ATTR_ACCESSOR_INT(name) XML_ATTR_NS_ACCESSOR_DEFAULT(int,dd4hep:: DD4HEP_DIMENSION_NS ::Dimension,name,_toInt)
0047 #define XML_ATTR_ACCESSOR_BOOL(name) XML_ATTR_NS_ACCESSOR_DEFAULT(bool,dd4hep:: DD4HEP_DIMENSION_NS ::Dimension,name,_toBool)
0048
0049 #define XML_CHILD_ACCESSOR_XML_DIM(name) \
0050 dd4hep:: DD4HEP_DIMENSION_NS ::Dimension dd4hep:: DD4HEP_DIMENSION_NS ::Dimension::name(bool throw_if_not_present) const { \
0051 return m_element.child(_dd4hep_Unicode_Item(name),throw_if_not_present); }