CMS 3D CMS Logo

ObjectWithDict.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_ObjectWithDict_h
2 #define FWCore_Utilities_ObjectWithDict_h
3 
4 /*----------------------------------------------------------------------
5 
6 ObjectWithDict: A holder for an object and its type information.
7 
8 ----------------------------------------------------------------------*/
9 
10 #include <string>
11 #include <typeinfo>
12 
14 
15 namespace edm {
16 
18 private:
20  void* address_;
21 public:
22  static ObjectWithDict byType(TypeWithDict const&);
23 public:
25  explicit ObjectWithDict(TypeWithDict const&, void* address);
26  explicit ObjectWithDict(std::type_info const&, void* address);
27  explicit operator bool() const;
28  void* address() const;
29  TypeWithDict typeOf() const;
30  TypeWithDict dynamicType() const;
32  ObjectWithDict get(std::string const& memberName) const;
33  //ObjectWithDict construct() const;
34  void destruct(bool dealloc) const;
35  template<typename T>
36  T
38  return *reinterpret_cast<T*>(address_);
39  }
40 };
41 
42 } // namespace edm
43 
44 
45 #endif // FWCore_Utilities_ObjectWithDict_h
static ObjectWithDict byType(TypeWithDict const &)
void * address() const
ObjectWithDict castObject(TypeWithDict const &) const
TypeWithDict dynamicType() const
TypeWithDict typeOf() const
void destruct(bool dealloc) const
HLT enums.
long double T
TypeWithDict type_