8 #ifndef OBJECTWRAPPERT_HPP_ 9 #define OBJECTWRAPPERT_HPP_ 16 template <
typename DataType>
18 : _dataObjPtr(dataObjPtr), _dataObjSharedPtr(nullptr) {}
20 template <
typename DataType>
24 template <
typename DataType>
28 template <
typename DataType>
35 return std::is_polymorphic<DataType>::value;
40 template <
typename DataType>
41 std::unique_ptr<ObjectWrapperBase>
44 return std::make_unique<ObjectWrapperT<DataType, void>>(
47 return std::make_unique<ObjectWrapperT<DataType, void>>(
51 template <
typename DataType>
54 static const std::string routineName(
55 std::string(
"ObjectWrapperTImpl<").append(Demangler::ClassName<DataType>()).append(
">::WrapObject"));
57 if (isPolymorphic != std::is_polymorphic<DataType>::value) {
58 COUT(
ERROR) <<
"The value for the \"isPolymorphic\" argument does not match the one for class \"" 59 << Demangler::ClassName<DataType>() <<
"\"" <<
ENDL;
62 if (isConst && !std::is_const<DataType>::value) {
64 <<
"\" object with a wrapper for non-const \"" << Demangler::ClassName<DataType>() <<
"\" objects " 75 << Demangler::ClassName<DataType>() <<
"\"" <<
ENDL;
bool IsConst()
Test for const wrapped object.
Definition: ObjectWrapperT.hpp:38
ObjectWrapperTImpl(observer_ptr< DataType > dataObjPtr)
Constructor.
Definition: ObjectWrapperT.hpp:17
bool IsPolymorphic()
Test for polymorphic wrapped object.
Definition: ObjectWrapperT.hpp:34
#define COUT(level)
Definition: SmartLog.h:88
std::string ClassName(const T &obj)
Function which returns the name of the class.
Definition: Demangler.h:30
Wrapper class for non-copy-constructible objects.
Definition: ObjectWrapperT.h:211
IncludeFileExc.h IncludeFileExc class declaration.
Definition: Algorithm.h:21
std::shared_ptr< DataType > _dataObjSharedPtr
Definition: ObjectWrapperT.h:122
bool WrapObject(void *address, const std::type_info &type, bool own, bool isPolymorphic, bool isConst)
Wrap the object at the given address.
Definition: ObjectWrapperT.hpp:52
#define ENDL
Definition: SmartLog.h:117
virtual std::unique_ptr< ObjectWrapperBase > CloneObject()=0
Clones the wrapped object and wraps it.
observer_ptr< DataType > _dataObjPtr
Definition: ObjectWrapperT.h:121
observer_ptr< DataType > GetObj()
Data object getter method.
Definition: ObjectWrapperT.hpp:32
bool InheritsFrom(const std::type_info &type, const std::type_info &baseType)
Check if a given type inherits from a given class.
Definition: InheritsFrom.cpp:20
Aliased object is an alias.
Wrapper for data objects.
Definition: ObjectWrapperT.h:26