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 this struct is attached to each Box.
Definition at line 178 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 |
Debug information. | |
const std::type_info & | ElementType |
FunctionTable | Functions |
Box-functions attached with BootstrapRegister. | |
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 218 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 184 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 238 of file vtable.inl.
DbgFactoryType DbgProduction = DbgFactoryType::Unregistered |
Debug information.
Definition at line 226 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 197 of file vtable.inl.
FunctionTable Functions |
Box-functions attached with BootstrapRegister.
Definition at line 212 of file vtable.inl.
const MappingType Mapping |
Denotes if the mapped type is a value type, a pointer type, an enum or an array. In the 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 202 of file vtable.inl.
const unsigned int PlaceholderUsage |
The number of relevant bytes used in the placeholder.
Definition at line 209 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 193 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 249 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 cleaning memory on termination "more precisely" and reduce warnings raised by analytics tools like valgrind.
Definition at line 267 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 279 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 299 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 289 of file vtable.inl.