CMS 3D CMS Logo

ObjectWithDict.h
Go to the documentation of this file.
1 #ifndef FWCore_Reflection_ObjectWithDict_h
2 #define FWCore_Reflection_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 
22  public:
23  static ObjectWithDict byType(TypeWithDict const&);
24 
25  public:
27  explicit ObjectWithDict(TypeWithDict const&, void* address);
28  explicit ObjectWithDict(std::type_info const&, void* address);
29  explicit operator bool() const;
30  void* address() const;
31  TypeWithDict typeOf() const;
32  TypeWithDict dynamicType() const;
34  ObjectWithDict get(std::string const& memberName) const;
35  //ObjectWithDict construct() const;
36  void destruct(bool dealloc) const;
37  template <typename T>
39  return *reinterpret_cast<T*>(address_);
40  }
41  };
42 
43 } // namespace edm
44 
45 #endif // FWCore_Reflection_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_