8#ifndef HPP_ALIB_BOXING_DETAIL_VTABLE
9#define HPP_ALIB_BOXING_DETAIL_VTABLE 1
11#if !defined(HPP_ALIB_BOXING_BOXING)
12# error "ALib sources with ending '.inl' must not be included from outside."
15namespace alib {
namespace boxing {
70 template<
typename TFDecl>
71 typename TFDecl::Signature
72 Get(
bool isInvocation )
const;
94 return reinterpret_cast<typename TFDecl::Signature
>(
getCustom(
typeid(TFDecl)
ALIB_DBG(, isInvocation ) ) );
110 template<
typename TFDecl>
111 void Set(
typename TFDecl::Signature implementation );
132 Set(
typename TFDecl::Signature impl )
134 return setCustom(
typeid(TFDecl),
reinterpret_cast<void*
>( impl ) );
142 #if defined(ALIB_DOX)
154 ALIB_DBG( ,
bool isInvocation ))
const;
259 const std::type_info& elementType,
261 unsigned int placeholderUsage )
356template<
typename TPlainOrArray,
typename TMapped>
358 ,
public Singleton< VTableTT<TPlainOrArray, TMapped> >
360 #if !defined(ALIB_DOX)
374 : typeid(TMapped[1]),
391 #if ALIB_DEBUG_BOXING
398#if ALIB_DEBUG_BOXING || defined(ALIB_DOX)
449template<
typename TMapping>
477#define ALIB_BOXING_VTABLE_DECLARE( TMapped, Identifier ) \
478namespace alib::boxing::detail { \
479extern ALIB_API VTable SNGLTN_ ## Identifier; \
480template<> struct T_VTableFactory< TMappedTo<TMapped> > \
481{ static constexpr VTable* Get() { return &SNGLTN_ ## Identifier; } }; } \
483#define ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( TMapped, Identifier ) \
484namespace alib::boxing::detail { \
485extern ALIB_API VTable SNGLTN_ ## Identifier; \
486template<> struct T_VTableFactory< TMappedToArrayOf<TMapped> > \
487{ static constexpr VTable* Get() { return &SNGLTN_ ## Identifier; } }; } \
490#define ALIB_BOXING_VTABLE_DEFINE( TMapped, Identifier ) \
491alib::boxing::detail::VTable alib::boxing::detail::SNGLTN_ ## Identifier \
492( typeid(TMapped), typeid(void) , \
493 std::is_pointer<TMapped>::value \
494 ? VTable::MappingType::Pointer \
495 : std::is_enum<TMapped>::value \
496 ? VTable::MappingType::Enum \
497 : VTable::MappingType::Value , \
498 alib::boxing::T_SizeInPlaceholder<TMapped>::value); \
500#define ALIB_BOXING_VTABLE_DEFINE_ARRAYTYPE( TMapped, Identifier ) \
501alib::boxing::detail::VTable alib::boxing::detail::SNGLTN_ ## Identifier \
502(typeid(TMapped[1]) , typeid(TMapped), VTable::MappingType(sizeof(TMapped)), sizeof(Placeholder)); \
506# define ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER( Identifier ) \
507DbgRegisterVTable( &alib::boxing::detail::SNGLTN_ ## Identifier, \
508 alib::boxing::detail::VTable::DbgFactoryType::Static );
510# define ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER( Identifier )
static TDerivedClass & GetSingleton()
#define ALIB_IF_STRINGS(...)
#define ATMP_VOID_IF(Cond)
#define ALIB_IF_MONOMEM(...)
#define ATMP_EQ( T, TEqual)
#define ATMP_T_IF(T, Cond)
ALIB_API void DbgCheckRegistration(detail::VTable *vtable, bool increaseUsageCounter)
ALIB_API void DbgCheckIsInitialized()
void DbgRegisterVTable(detail::VTable *vtable, detail::VTable::DbgFactoryType productionType)
FunctionTable DEFAULT_FUNCTIONS
boxing::FIsLess FIsLess
Type alias in namespace alib.
lang::uinteger uinteger
Type alias in namespace alib.
boxing::FClone FClone
Type alias in namespace alib.
boxing::FIsNotNull FIsNotNull
Type alias in namespace alib.
boxing::FEquals FEquals
Type alias in namespace alib.
boxing::FIsTrue FIsTrue
Type alias in namespace alib.
boxing::FHashcode FHashcode
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
void(*)(const Box &self, strings::TAString< TChar > &target) Signature
uinteger DbgCntInvocationsFHashcode
Debug-compilation counter for the number of invocations.
uinteger DbgCntInvocationsFIsNotNull
Debug-compilation counter for the number of invocations.
FIsLess::Signature fIsLess
Entry for built-in function FIsLess .
TFDecl::Signature Get(bool isInvocation) const
ALIB_API void * getCustom(const std::type_info &rtti, bool isInvocation) const
uinteger DbgCntInvocationsFIsLess
Debug-compilation counter for the number of invocations.
uinteger DbgCntInvocationsFClone
Debug-compilation counter for the number of invocations.
void Set(typename TFDecl::Signature implementation)
uinteger DbgCntInvocationsFAppend
Debug-compilation counter for the number of invocations.
uinteger DbgCntInvocationsFIsTrue
Debug-compilation counter for the number of invocations.
ALIB_API void setCustom(const std::type_info &rtti, void *implementation)
uinteger DbgCntInvocationsFEquals
Debug-compilation counter for the number of invocations.
FClone::Signature fClone
Entry for built-in function FClone .
FHashcode::Signature fHashcode
Entry for built-in function FHashcode .
FIsTrue::Signature fIsTrue
Entry for built-in function FIsTrue .
FAppend< character >::Signature fAppend
Entry for built-in function FAppend .
FEquals::Signature fEquals
Entry for built-in function FEquals .
FIsNotNull::Signature fIsNotNull
Entry for built-in function FIsNotNull .
static constexpr VTable * Get()
VTable(const std::type_info &type, const std::type_info &elementType, MappingType mapping, unsigned int placeholderUsage)
DbgFactoryType DbgProduction
const std::type_info & Type
@ Static
A static VTable is in place.
@ Unregistered
Not registered, yet.
@ Dynamic
The VTable is created dynamically from templated type VTableTT.
const unsigned int PlaceholderUsage
const MappingType Mapping
const std::type_info & ElementType