7 #ifndef _QITYPE_DETAIL_TYPEINTERFACE_HPP_
8 #define _QITYPE_DETAIL_TYPEINTERFACE_HPP_
10 #include <boost/optional.hpp>
11 #include <boost/type_index.hpp>
24 # pragma warning( push )
25 # pragma warning( disable: 4251 )
34 return boost::typeindex::type_id<T>();
39 return boost::typeindex::type_id_runtime(val);
54 std::string asString()
const;
55 std::string asDemangledString()
const;
58 const char* asCString()
const;
65 boost::optional<TypeIndex> typeIndex;
67 std::string customInfo;
143 virtual void* initializeStorage(
void* ptr =
nullptr) = 0;
155 virtual void* ptrFromStorage(
void**) = 0;
158 virtual void* clone(
void*) = 0;
160 virtual void destroy(
void*) = 0;
175 virtual bool less(
void* a,
void* b) = 0;
178 inline const char*
infoString() {
return info().asCString(); }
189 qi::Signature signature(
void* storage =
nullptr,
bool resolveDynamic =
false);
203 template<
typename T> TypeInterface*
typeOf();
220 # pragma warning( pop )
223 #endif // _QITYPE_DETAIL_TYPEINTERFACE_HPP_
void destroy()
Stop and flush the logging system.
bool registerType(const TypeIndex &typeId, TypeInterface *type)
Runtime Type factory setter.
TypeInterface * getType(const TypeIndex &typeId)
Runtime Type factory getter. Used by typeOf<T>()
dll import/export and compiler message
TypeIndex typeIdRuntime(const T &val)
bool operator==(const Signature &lhs, const Signature &rhs)
TypeInterface * getRegisteredStruct(const qi::Signature &s)
const char * infoString()
void registerStruct(TypeInterface *type)
boost::typeindex::type_index TypeIndex
bool operator<(const AnyReference &a, const AnyReference &b)
bool operator!=(const Signature &lhs, const Signature &rhs)