2 #ifndef GAUDIKERNEL_IINSPECTOR_H
3 #define GAUDIKERNEL_IINSPECTOR_H
21 enum { MUTABLE = 1<<1, CONST = 1<<2};
34 void*
ptr() {
return m_P; }
35 const void*
ptr()
const {
return m_P; }
36 virtual long size()
const = 0;
37 virtual void construct(
void* buffer)
const = 0;
46 Tag(
long f,
const std::type_info&
s) : first(f), second(s) { }
47 Tag(
const Tag& t) : first(t.first), second(t.second) { }
56 _V(
const T& v) : m_O(v) { m_P = &m_O; }
58 virtual long size()
const {
return sizeof(T); }
64 template <
class T>
class _TT :
public Tag {
65 public:
_TT() :
Tag(sizeof(T), typeid(T)) { }
71 virtual StatusCode inspectByRef(
const void* pObj,
const Tag& typ,
void* pOwner,
const Tag& otag,
const std::string& comment,
long flag) = 0;
73 virtual StatusCode inspectByValue(IValue* pObj,
const Tag& typ,
void* pOwner,
const Tag& oTag,
const std::string& comment) = 0;
75 virtual StatusCode inspectContByRef(
const void* pObj,
const Tag& tag,
const Tag& rtag,
const Tag& vtag,
const void* pOwner,
const Tag& otag,
const std::string& comment,
long flags) = 0;
77 virtual StatusCode inspectContByValue(IValue* pObj,
const Tag& tag,
const Tag& rtag,
const Tag& vtag,
const void* pOwner,
const Tag& otag,
const std::string& comment) = 0;
82 template <
class T,
class O >
84 return inspectByRef(pObj,
_TT<T>(), (
void*)pOwner,
_TT<O>(), comment, flag);
87 template <
class T,
class O >
89 return inspectByValue(
new _V<T>(obj),
_TT<T>(), (
void*)pOwner,
_TT<O>(), comment);
92 template <
class T,
class O >
94 typedef typename T::value_type _VVV;
95 typedef typename T::value_type _TTT;
101 template <
class T,
class O >
103 typedef typename T::value_type _VVV;
104 typedef typename T::value_type _TTT;
110 #endif // GAUDIKERNEL_IINSPECTOR_H
StatusCode inspectByRef(const T *pObj, const O *pOwner, const std::string &comment, long flag=MUTABLE)
Inspect single item by its reference (mutable and const)
StatusCode inspectByValue(const T &obj, const O *pOwner, const std::string &comment)
Inspect single item by its value (const)
Tag(long f, const std::type_info &s)
StatusCode inspectContByValue(const T &obj, const O *pOwner, const std::string &comment)
Inspect container of object items by its value (const)
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
#define DeclareInterfaceID(name, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
StatusCode inspectContByRef(const T *pObj, const O *pOwner, const std::string &comment, long flag=MUTABLE)
Inspect container of object items by its reference (mutable and const)
const std::type_info & second
virtual long size() const
void construct(void *b) const