CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Object.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_OBJECT_H
2 #define INCLUDE_ORA_OBJECT_H
3 
4 //
5 #include <typeinfo>
6 // externals
7 #include "Reflex/Type.h"
8 
9 namespace ora {
10 
11  class Object {
12  public:
13  Object();
14  Object( const void* ptr, const Reflex::Type& type );
15  Object( const Object& rhs);
16  virtual ~Object();
17  Object& operator=( const Object& rhs);
18  bool operator==( const Object& rhs) const;
19  bool operator!=( const Object& rhs) const;
20  void* address() const;
21  const Reflex::Type& type() const;
22  std::string typeName() const;
23  void* cast( const std::type_info& asType ) const;
24  template <typename T> T* cast() const;
25  void destruct();
26  private:
27  void* m_ptr;
29  };
30 }
31 
32 template <typename T>
33 inline
34 T*
36  const std::type_info& typeInfo = typeid(T);
37  return static_cast<T*>( cast( typeInfo ) );
38 }
39 
40 #endif
41 
type
Definition: HCALResponse.h:22
Reflex::Type m_type
Definition: Object.h:28
std::string typeName() const
Definition: Object.cc:49
void * address() const
Definition: Object.cc:41
void * m_ptr
Definition: Object.h:27
bool operator==(const Object &rhs) const
Definition: Object.cc:31
Object()
Definition: Object.cc:7
Object & operator=(const Object &rhs)
Definition: Object.cc:25
T * cast() const
Definition: Object.h:35
virtual ~Object()
Definition: Object.cc:22
bool operator!=(const Object &rhs) const
Definition: Object.cc:37
const Reflex::Type & type() const
Definition: Object.cc:45
long double T
void destruct()
Definition: Object.cc:63