This struct is used internally with ALib Boxing to provide run-time type information and virtual method invocations to boxed values. A singleton instance of a this struct is attached to each Box .
Definition at line 177 of file vtable.inl.
Public Type Index: | |
enum class | DbgFactoryType { Unregistered , Static , Dynamic } |
enum | MappingType : integer { Value = 0 , Pointer = -1 , Enum = -2 } |
Public Field Index: | |
uinteger | DbgCntUsage = 0 |
DbgFactoryType | DbgProduction = DbgFactoryType::Unregistered |
const std::type_info & | ElementType |
FunctionTable | Functions |
const MappingType | Mapping |
const unsigned int | PlaceholderUsage |
const std::type_info & | Type |
Public Method Index: | |
VTable (const std::type_info &type, const std::type_info &elementType, MappingType mapping, unsigned int placeholderUsage) | |
virtual | ~VTable () |
bool | IsArray () const |
bool | IsEnum () const |
bool | IsPointer () const |
|
strong |
These flags are available in debug-compilations only. Denotes whether this vtable is statically or dynamically created. In case of Unregistered, a customized vtable was not properly registered on bootstrap.
Enumerator | |
---|---|
Unregistered | Not registered, yet. |
Static | A static VTable is in place. |
Dynamic | The VTable is created dynamically from templated type VTableTT. |
Definition at line 225 of file vtable.inl.
enum MappingType : integer |
Denotes if the mapped type is value type, a pointer type, an enum or an array. The latter is not specified by an enum element, but rather is true
for all enum elements that have a value greater than 0
. The value in this case provides the size of the array's element type.
Enumerator | |
---|---|
Value | Value boxing. |
Pointer | Pointer boxing. |
Enum | Enum type boxing. |
Definition at line 185 of file vtable.inl.
uinteger DbgCntUsage = 0 |
Counter for the number of unbox operations and function invocations made on boxes that used this vtable. Precisely, the counter is increased with invocations of Box::Unbox , Box::UnboxArray , Box::UnboxElement , Box::TypeID and Box::GetFunction .
Available only with debug builds.
Definition at line 247 of file vtable.inl.
DbgFactoryType DbgProduction = DbgFactoryType::Unregistered |
Debug information.
Definition at line 233 of file vtable.inl.
const std::type_info& ElementType |
In case of array types, information about the element type. Otherwise this field is equal to typeid(void)
.
Definition at line 198 of file vtable.inl.
FunctionTable Functions |
Box-functions attached with BootstrapRegister .
Definition at line 217 of file vtable.inl.
const MappingType Mapping |
Denotes if the mapped type is value type, a pointer type, an enum or an array. In case of array types, the enum element value provides the size of the array's element type (a value greater than 0
).
Definition at line 205 of file vtable.inl.
const unsigned int PlaceholderUsage |
The number of relevant bytes used in the placeholder.
Definition at line 214 of file vtable.inl.
const std::type_info& Type |
Information about the encapsulated type. In case of arrays, this field is equal to typeid(void)
.
Definition at line 194 of file vtable.inl.
|
inline |
Constructor.
type | Type information of the derived VTable type. |
elementType | Type information of the elements of the boxed array. |
mapping | The type of boxing: value, pointer, enum or arrays. |
placeholderUsage | The size of elements of the boxed array. |
Definition at line 258 of file vtable.inl.
|
inlinevirtual |
Virtual destructor.
Note: This is not really needed and empty. Because derived class VTable derives from virtual type Singleton , having this destructor allows to clean memory on termination "more precisely" and reduce warnings raised by analytics tools like valgrind.
Definition at line 276 of file vtable.inl.
|
inline |
Returns true
if this vtable represents boxed array types. In this case, method Box::UnboxLength will return the length of the array and Box::UnboxElement may be used to access elements of the array.
true
if this vtable is representing an array type, false
otherwise. Definition at line 288 of file vtable.inl.
|
inline |
Returns true
if this vtable represents a scoped or non-scoped enum type.
true
if this vtable is representing an enum type, false
otherwise. Definition at line 308 of file vtable.inl.
|
inline |
Returns true
if this vtable represents mapped pointer type.
true
if this vtable is representing a pointer type, false
otherwise. Definition at line 298 of file vtable.inl.