Skip to content
Snippets Groups Projects
Commit c5f6d91f authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Merge branch 'GAUDI-1128' into 'master'

change IInspector enum names to avoid conflicts with Oracle

Changed IInspector::MUTABLE and IInspector::CONST to IInspector::Mutable
and IInspector::Const.

Fixes GAUDI-1128.

See merge request !68
parents 2a28fda4 6e2efa96
No related branches found
No related tags found
No related merge requests found
......@@ -17,12 +17,10 @@ public:
/// InterfaceID
DeclareInterfaceID(IInspector,1,0);
enum { MUTABLE = 1<<1, CONST = 1<<2};
enum { Mutable = 1<<1, Const = 1<<2 };
protected:
/**
*/
class IValue {
protected:
void* m_P;
......@@ -36,8 +34,6 @@ protected:
virtual void construct(void* buffer) const = 0;
};
/**
*/
struct Tag {
long first;
const std::type_info& second;
......@@ -45,8 +41,6 @@ protected:
};
private:
/**
*/
template <class T> class _V : public IValue {
T m_O;
public:
......@@ -56,8 +50,6 @@ private:
virtual void construct(void* b) const { ::new(b) T(); }
};
/**
*/
template <class T> class _TT : public Tag {
public: _TT() : Tag(sizeof(T), typeid(T)) { }
};
......@@ -65,42 +57,42 @@ private:
protected:
// Referenced implementation of the IInspector interface:
/// Inspect object by Reference
virtual StatusCode inspectByRef(const void* pObj, const Tag& typ, void* pOwner, const Tag& otag, const std::string& comment, long flag) = 0;
virtual StatusCode inspectByRef(const void* pObj, const Tag& typ, void* pOwner, const Tag& otag, const std::string& comment, long flag) = 0;
/// Inspect object by Value
virtual StatusCode inspectByValue(IValue* pObj, const Tag& typ, void* pOwner, const Tag& oTag, const std::string& comment) = 0;
virtual StatusCode inspectByValue(IValue* pObj, const Tag& typ, void* pOwner, const Tag& oTag, const std::string& comment) = 0;
/// Inspect container of objects by reference
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;
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;
/// Inspect container of objects by value
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;
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;
public:
// User interface of the IInspector interface
/// Inspect single item by its reference (mutable and const)
template < class T, class O >
StatusCode inspectByRef(const T* pObj, const O* pOwner, const std::string& comment, long flag=MUTABLE) {
return inspectByRef(pObj, _TT<T>(), (void*)pOwner, _TT<O>(), comment, flag);
}
template < class T, class O >
StatusCode inspectByRef(const T* pObj, const O* pOwner, const std::string& comment, long flag=Mutable) {
return inspectByRef(pObj, _TT<T>(), (void*)pOwner, _TT<O>(), comment, flag);
}
/// Inspect single item by its value (const)
template < class T, class O >
template < class T, class O >
StatusCode inspectByValue(const T& obj, const O* pOwner, const std::string& comment) {
return inspectByValue(new _V<T>(obj), _TT<T>(), (void*)pOwner, _TT<O>(), comment);
}
return inspectByValue(new _V<T>(obj), _TT<T>(), (void*)pOwner, _TT<O>(), comment);
}
/// Inspect container of object items by its reference (mutable and const)
template < class T, class O >
StatusCode inspectContByRef( const T* pObj, const O* pOwner, const std::string& comment, long flag=MUTABLE) {
typedef typename T::value_type _VVV;
typedef typename T::value_type _TTT;
// Unfortunately this is not implemented on G++:
// typedef typename T::allocator_type::value_type _TTT;
template < class T, class O >
StatusCode inspectContByRef( const T* pObj, const O* pOwner, const std::string& comment, long flag=Mutable) {
typedef typename T::value_type _VVV;
typedef typename T::value_type _TTT;
// Unfortunately this is not implemented on G++:
// typedef typename T::allocator_type::value_type _TTT;
return inspectContByRef((void*)pObj, _TT<T>(), _TT<_VVV>(), _TT<_TTT>(), (void*)pOwner, _TT<O>(), comment, flag);
}
/// Inspect container of object items by its value (const)
template < class T, class O >
StatusCode inspectContByValue( const T& obj, const O* pOwner, const std::string& comment) {
typedef typename T::value_type _VVV;
typedef typename T::value_type _TTT;
// Unfortunately this is not implemented on G++:
// typedef typename T::allocator_type::value_type _TTT;
template < class T, class O >
StatusCode inspectContByValue( const T& obj, const O* pOwner, const std::string& comment) {
typedef typename T::value_type _VVV;
typedef typename T::value_type _TTT;
// Unfortunately this is not implemented on G++:
// typedef typename T::allocator_type::value_type _TTT;
return inspectContByValue(new _V<T>(obj), _TT<T>(), _TT<_VVV>(), _TT<_TTT>(), (void*)pOwner, _TT<O>(), comment);
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment