1 #ifndef GAUDIKERNEL_IINSPECTOR_H
2 #define GAUDIKERNEL_IINSPECTOR_H
20 enum { Mutable = 1<<1, Const = 1<<2 };
29 virtual ~
IValue() =
default;
31 void*
ptr() {
return m_P; }
32 const void*
ptr()
const {
return m_P; }
33 virtual long size()
const = 0;
34 virtual void construct(
void* buffer)
const = 0;
47 _V(
const T& v) : m_O(v) { m_P = &m_O; }
48 virtual ~
_V() =
default;
49 virtual long size()
const {
return sizeof(T); }
50 virtual void construct(
void* b)
const { ::new(b) T(); }
53 template <
class T>
class _TT :
public Tag {
54 public:
_TT() :
Tag(sizeof(T), typeid(T)) { }
60 virtual StatusCode inspectByRef(
const void* pObj,
const Tag& typ,
void* pOwner,
const Tag& otag,
const std::string& comment,
long flag) = 0;
62 virtual StatusCode inspectByValue(IValue* pObj,
const Tag& typ,
void* pOwner,
const Tag& oTag,
const std::string& comment) = 0;
64 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;
66 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;
71 template <
class T,
class O >
73 return inspectByRef(pObj,
_TT<T>(), (
void*)pOwner,
_TT<O>(), comment, flag);
76 template <
class T,
class O >
78 return inspectByValue(
new _V<T>(obj),
_TT<T>(), (
void*)pOwner,
_TT<O>(), comment);
81 template <
class T,
class O >
83 typedef typename T::value_type _VVV;
84 typedef typename T::value_type _TTT;
90 template <
class T,
class O >
92 typedef typename T::value_type _VVV;
93 typedef typename T::value_type _TTT;
99 #endif // GAUDIKERNEL_IINSPECTOR_H
StatusCode inspectByValue(const T &obj, const O *pOwner, const std::string &comment)
Inspect single item by its value (const)
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)
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 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.
virtual void construct(void *b) const
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
const std::type_info & second
virtual long size() const
Tag(long f, const std::type_info &s)