DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BasicGrammar.cpp
Go to the documentation of this file.
1 // $Id: $
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 
15 // Framework include files
16 #include "DD4hep/Primitives.h"
17 #include "DD4hep/Exceptions.h"
18 #include "DD4hep/BasicGrammar.h"
19 
20 // C/C++ include files
21 #include <stdexcept>
22 
25 }
26 
29 }
30 
32 void DD4hep::BasicGrammar::invalidConversion(const std::string& value, const std::type_info& to) {
33  std::string to_name = typeName(to);
34  throw unrelated_value_error(to,
35  "Data conversion of " + value + " to type '" +
36  to_name + "' is not defined.");
37 }
38 
40 void DD4hep::BasicGrammar::invalidConversion(const std::type_info& from, const std::type_info& to) {
41  std::string to_name = typeName(to);
42  std::string from_name = typeName(from);
43  throw unrelated_type_error(from, to,
44  "Data conversion from '" + from_name +
45  "' to '" + to_name + "' is not implemented.");
46 }
std::string typeName(const std::type_info &type)
ABI information about type names.
Definition: Primitives.cpp:186
static void invalidConversion(const std::type_info &from, const std::type_info &to)
Error callback on invalid conversion.
virtual ~BasicGrammar()
Default destructor.
Exception class to signal operations on unrelated classes.
Definition: Exceptions.h:31
Exception class to signal operations on unrelated types of values.
Definition: Exceptions.h:44
BasicGrammar()
Default constructor.