LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
WrappedTypeID.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Common_WrappedTypeID_h
2 #define canvas_Persistency_Common_WrappedTypeID_h
3 // vim: set sw=2:
4 //
5 // WrappedTypeID: A unique identifier for a C++ type.
6 //
7 // The identifier is unique within an entire program, but cannot be
8 // persisted across invocations of the program.
9 
13 
15  template <typename T>
16  static WrappedTypeID make();
19 
20 private:
21  WrappedTypeID(std::type_info const& product_type,
22  std::type_info const& wrapped_product_type);
23 };
24 
26  std::type_info const& prod_type,
27  std::type_info const& wrapped_prod_type)
28  : product_type{prod_type}, wrapped_product_type{wrapped_prod_type}
29 {}
30 
31 template <typename T>
34 {
35  return WrappedTypeID{typeid(T), typeid(Wrapper<T>)};
36 }
37 
38 // Local Variables:
39 // mode: c++
40 // End:
41 #endif /* canvas_Persistency_Common_WrappedTypeID_h */
static WrappedTypeID make()
TypeID wrapped_product_type
Definition: WrappedTypeID.h:18
WrappedTypeID(std::type_info const &product_type, std::type_info const &wrapped_product_type)
Definition: WrappedTypeID.h:25