11 #ifndef GAUDIKERNEL_IINSPECTOR_H 12 #define GAUDIKERNEL_IINSPECTOR_H 30 enum { Mutable = 1 << 1, Const = 1 << 2 };
39 virtual ~
IValue() =
default;
41 void*
ptr() {
return m_P; }
42 const void*
ptr()
const {
return m_P; }
43 virtual long size()
const = 0;
44 virtual void construct(
void* buffer )
const = 0;
59 _V(
const T& v ) : m_O( v ) { m_P = &m_O; }
60 virtual long size()
const {
return sizeof( T ); }
61 virtual void construct(
void* b )
const { ::new ( b ) T(); }
67 _TT() :
Tag( sizeof( T ), typeid( T ) ) {}
73 virtual StatusCode inspectByRef(
const void* pObj,
const Tag& typ,
void* pOwner,
const Tag& otag,
76 virtual StatusCode inspectByValue( IValue* pObj,
const Tag& typ,
void* pOwner,
const Tag& oTag,
79 virtual StatusCode inspectContByRef(
const void* pObj,
const Tag& tag,
const Tag& rtag,
const Tag& vtag,
80 const void* pOwner,
const Tag& otag,
const std::string& comment,
83 virtual StatusCode inspectContByValue( IValue* pObj,
const Tag& tag,
const Tag& rtag,
const Tag& vtag,
84 const void* pOwner,
const Tag& otag,
const std::string& comment ) = 0;
89 template <
class T,
class O>
91 return inspectByRef( pObj,
_TT<T>(), (
void*)pOwner,
_TT<O>(), comment, flag );
94 template <
class T,
class O>
96 return inspectByValue(
new _V<T>( obj ),
_TT<T>(), (
void*)pOwner,
_TT<O>(), comment );
99 template <
class T,
class O>
101 typedef typename T::value_type _VVV;
102 typedef typename T::value_type _TTT;
108 template <
class T,
class O>
110 typedef typename T::value_type _VVV;
111 typedef typename T::value_type _TTT;
117 #endif // GAUDIKERNEL_IINSPECTOR_H constexpr auto size(const T &, Args &&...) noexcept
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)
virtual void construct(void *b) 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 long size() 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
Tag(long f, const std::type_info &s)