ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
VTable Struct Reference

Description:


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.

Inheritance diagram for VTable:
[legend]
Collaboration diagram for VTable:
[legend]

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
 

Enumeration Details:

◆ DbgFactoryType

enum class DbgFactoryType
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.

◆ MappingType

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.

Field Details:

◆ DbgCntUsage

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.

◆ DbgProduction

Debug information.

Definition at line 233 of file vtable.inl.

◆ ElementType

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.

◆ Functions

FunctionTable Functions

Box-functions attached with BootstrapRegister .

Definition at line 217 of file vtable.inl.

◆ Mapping

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.

◆ PlaceholderUsage

const unsigned int PlaceholderUsage

The number of relevant bytes used in the placeholder.

See also
The documentation of TMP struct T_SizeInPlaceholder provides details on and rationals for the existence of this property.

Definition at line 214 of file vtable.inl.

◆ Type

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.

Constructor(s) / Destructor Details::

◆ VTable()

VTable ( const std::type_info & type,
const std::type_info & elementType,
MappingType mapping,
unsigned int placeholderUsage )
inline

Constructor.

Parameters
typeType information of the derived VTable type.
elementTypeType information of the elements of the boxed array.
mappingThe type of boxing: value, pointer, enum or arrays.
placeholderUsageThe size of elements of the boxed array.

Definition at line 258 of file vtable.inl.

◆ ~VTable()

virtual ~VTable ( )
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.

Method Details:

◆ IsArray()

bool IsArray ( ) const
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.

Returns
true if this vtable is representing an array type, false otherwise.

Definition at line 288 of file vtable.inl.

◆ IsEnum()

bool IsEnum ( ) const
inline

Returns true if this vtable represents a scoped or non-scoped enum type.

Returns
true if this vtable is representing an enum type, false otherwise.

Definition at line 308 of file vtable.inl.

◆ IsPointer()

bool IsPointer ( ) const
inline

Returns true if this vtable represents mapped pointer type.

Returns
true if this vtable is representing a pointer type, false otherwise.

Definition at line 298 of file vtable.inl.


The documentation for this struct was generated from the following file: