LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
maybeCastObj.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Common_detail_maybeCastObj_h
2 #define canvas_Persistency_Common_detail_maybeCastObj_h
3 
4 #include <typeinfo>
5 
6 namespace art {
7  namespace detail {
8  bool upcastAllowed(std::type_info const& tiFrom,
9  std::type_info const& tiTo);
10  template <typename element_type>
11  void const* maybeCastObj(element_type const* address,
12  std::type_info const& tiTo);
13  void const* maybeCastObj(void const* address,
14  std::type_info const& tiFrom,
15  std::type_info const& tiTo);
16  }
17 }
18 
19 template <class element_type>
20 inline void const*
21 art::detail::maybeCastObj(element_type const* address,
22  std::type_info const& tiTo)
23 {
24  static std::type_info const& tiFrom{typeid(element_type)};
25  return maybeCastObj(address, tiFrom, tiTo);
26 }
27 
28 #endif /* canvas_Persistency_Common_detail_maybeCastObj_h */
29 
30 // Local Variables:
31 // mode: c++
32 // End:
void const * maybeCastObj(element_type const *address, std::type_info const &tiTo)
Definition: maybeCastObj.h:21
HLT enums.
bool upcastAllowed(std::type_info const &tiFrom, std::type_info const &tiTo)