ALib C++ Library
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
vtable.inl
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header-file is part of module \alib_boxing of the \aliblong.
4///
5/// \emoji :copyright: 2013-2025 A-Worx GmbH, Germany.
6/// Published under \ref mainpage_license "Boost Software License".
7//==================================================================================================
9
10/// This namespace implements internals of namespace #alib::boxing.
11namespace detail {
12
13//==================================================================================================
14/// This struct is used internally with \alib_boxing_nl to provide run-time type information
15/// and virtual method invocations to boxed values.
16/// A singleton instance of a derived type of this class is attached to each \alib{boxing;Box}.
17/// Such derived type is generated using templated derived struct \alib{boxing::detail;VTable}.
18//==================================================================================================
20{
21 //################################################################################################
22 // Fields
23 //################################################################################################
24 FHashcode ::Signature fHashcode = nullptr; ///< Entry for built-in function \alib{boxing;FHashcode}.
25 FIsNotNull ::Signature fIsNotNull= nullptr; ///< Entry for built-in function \alib{boxing;FIsNotNull}.
26 FEquals ::Signature fEquals = nullptr; ///< Entry for built-in function \alib{boxing;FEquals}.
27 FIsLess ::Signature fIsLess = nullptr; ///< Entry for built-in function \alib{boxing;FIsLess}.
28 FIsTrue ::Signature fIsTrue = nullptr; ///< Entry for built-in function \alib{boxing;FIsTrue}.
29 #if ALIB_MONOMEM
30 FClone ::Signature fClone = nullptr; ///< Entry for built-in function \alib{boxing;FClone}.
31 #endif
32 #if ALIB_STRINGS
33 FAppend<character,lang::HeapAllocator> ///< Entry for built-in function \alib{boxing;FAppend}.
34 ::Signature fAppend = nullptr;
35 #endif
36 #if ALIB_DEBUG
37 mutable uinteger DbgCntInvocationsFHashcode =0; ///< Debug-compilation counter for the number of invocations.
38 mutable uinteger DbgCntInvocationsFIsNotNull=0; ///< Debug-compilation counter for the number of invocations.
39 mutable uinteger DbgCntInvocationsFEquals =0; ///< Debug-compilation counter for the number of invocations.
40 mutable uinteger DbgCntInvocationsFIsLess =0; ///< Debug-compilation counter for the number of invocations.
41 mutable uinteger DbgCntInvocationsFIsTrue =0; ///< Debug-compilation counter for the number of invocations.
42 #if ALIB_MONOMEM
43 mutable uinteger DbgCntInvocationsFClone =0; ///< Debug-compilation counter for the number of invocations.
44 #endif
45 #if ALIB_STRINGS
46 mutable uinteger DbgCntInvocationsFAppend =0; ///< Debug-compilation counter for the number of invocations.
47#endif
48#endif
49
50 //################################################################################################
51 // Get
52 //################################################################################################
53 #if DOXYGEN
54 /// Receives the function of type \p{TFDecl}.
55 ///
56 /// @tparam TFDecl The function type to get.
57 /// @param isInvocation If \c true, the invocation counter is increased.
58 /// This parameter is defined only in debug-compilations.
59 /// @return The function found, or \c nullptr in case it was not defined.
60 template<typename TFDecl>
61 typename TFDecl::Signature
62 Get( bool isInvocation ) const;
63 #else
64 template<typename TFDecl> requires std::same_as<TFDecl, FHashcode > FHashcode ::Signature Get(ALIB_DBG( bool isInvocation )) const { ALIB_DBG( if(isInvocation) ++DbgCntInvocationsFHashcode ; ) return fHashcode ; }
65 template<typename TFDecl> requires std::same_as<TFDecl, FIsNotNull> FIsNotNull::Signature Get(ALIB_DBG( bool isInvocation )) const { ALIB_DBG( if(isInvocation) ++DbgCntInvocationsFIsNotNull; ) return fIsNotNull; }
66 template<typename TFDecl> requires std::same_as<TFDecl, FEquals > FEquals ::Signature Get(ALIB_DBG( bool isInvocation )) const { ALIB_DBG( if(isInvocation) ++DbgCntInvocationsFEquals ; ) return fEquals ; }
67 template<typename TFDecl> requires std::same_as<TFDecl, FIsLess > FIsLess ::Signature Get(ALIB_DBG( bool isInvocation )) const { ALIB_DBG( if(isInvocation) ++DbgCntInvocationsFIsLess ; ) return fIsLess ; }
68 template<typename TFDecl> requires std::same_as<TFDecl, FIsTrue > FIsTrue ::Signature Get(ALIB_DBG( bool isInvocation )) const { ALIB_DBG( if(isInvocation) ++DbgCntInvocationsFIsTrue ; ) return fIsTrue ; }
69 #if ALIB_MONOMEM
70 template<typename TFDecl> requires std::same_as<TFDecl, FClone > FClone ::Signature Get(ALIB_DBG( bool isInvocation )) const { ALIB_DBG( if(isInvocation) ++DbgCntInvocationsFClone ; ) return fClone ; }
71 #endif
72 #if ALIB_STRINGS
73 template<typename TFDecl> requires std::same_as<TFDecl, FAppend<character,lang::HeapAllocator>>
74 FAppend<character,lang::HeapAllocator> ::Signature Get(ALIB_DBG( bool isInvocation )) const { ALIB_DBG( if(isInvocation) ++DbgCntInvocationsFAppend ; ) return fAppend ; }
75 #endif
76
77 template<typename TFDecl> requires ( !std::same_as<TFDecl, FHashcode >
78 && !std::same_as<TFDecl, FIsNotNull>
79 && !std::same_as<TFDecl, FEquals >
80 && !std::same_as<TFDecl, FIsLess >
81 && !std::same_as<TFDecl, FIsTrue >
82 #if ALIB_MONOMEM
83 && !std::same_as<TFDecl, FClone >
84 #endif
85 #if ALIB_STRINGS
86 && !std::same_as<TFDecl, FAppend<character,lang::HeapAllocator>>
87 #endif
88 ) typename TFDecl::Signature Get(ALIB_DBG( bool isInvocation )) const {
89return reinterpret_cast<typename TFDecl::Signature>( getCustom( typeid(TFDecl) ALIB_DBG(, isInvocation ) ) );
90}
91 #endif
92
93
94
95 //################################################################################################
96 // Set
97 //################################################################################################
98 #if DOXYGEN
99 /// Registers an implementation of the function of type \p{TFDecl}.
100 ///
101 /// @tparam TFDecl The function type to register.
102 /// @param implementation The implementation of the function.
103 template<typename TFDecl>
104 void Set( typename TFDecl::Signature implementation );
105 #else
106 template<typename TFDecl> requires std::same_as<TFDecl, FHashcode > void Set( FHashcode ::Signature impl) { fHashcode = impl; }
107 template<typename TFDecl> requires std::same_as<TFDecl, FIsNotNull> void Set( FIsNotNull::Signature impl) { fIsNotNull= impl; }
108 template<typename TFDecl> requires std::same_as<TFDecl, FEquals > void Set( FEquals ::Signature impl) { fEquals = impl; }
109 template<typename TFDecl> requires std::same_as<TFDecl, FIsLess > void Set( FIsLess ::Signature impl) { fIsLess = impl; }
110 template<typename TFDecl> requires std::same_as<TFDecl, FIsTrue > void Set( FIsTrue ::Signature impl) { fIsTrue = impl; }
111 #if ALIB_MONOMEM
112 template<typename TFDecl> requires std::same_as<TFDecl, FClone > void Set( FClone ::Signature impl) { fClone = impl; }
113 #endif
114 #if ALIB_STRINGS
115 template<typename TFDecl> requires std::same_as<TFDecl,
117 ::Signature impl) { fAppend = impl; }
118 #endif
119
120 template<typename TFDecl> requires ( !std::same_as<TFDecl, FHashcode >
121 && !std::same_as<TFDecl, FIsNotNull>
122 && !std::same_as<TFDecl, FEquals >
123 && !std::same_as<TFDecl, FIsLess >
124 && !std::same_as<TFDecl, FIsTrue >
125 #if ALIB_MONOMEM
126 && !std::same_as<TFDecl, FClone >
127 #endif
128 #if ALIB_STRINGS
129 && !std::same_as<TFDecl, FAppend<character,lang::HeapAllocator> >
130 #endif
131 )
132 void Set( typename TFDecl::Signature impl )
133 { return setCustom( typeid(TFDecl), reinterpret_cast<void*>( impl ) ); }
134 #endif
135
136 //################################################################################################
137 // Cleanup (needed for debug-builds in shutdown)
138 //################################################################################################
139 #if (ALIB_MONOMEM && ALIB_CONTAINERS && ALIB_DEBUG) || DOXYGEN
140 /// Needs to be called only in debug versions to shut down internal hashtables cleanly.
141 ALIB_DLL static void Shutdown();
142 #else
143 inline static void Shutdown() {}
144 #endif
145
146
147 //################################################################################################
148 // internals
149 //################################################################################################
150 protected:
151 #if DOXYGEN
152 /// Non-inline implementation of #Get used in the case of non-built-in functions.
153 /// @param rtti The \c typeid of the function to get.
154 /// @param isInvocation If \c true, the invocation counter is increased.
155 /// This parameter is defined only in debug-compilations.
156 /// @return The pointer to the box-function.
157 ALIB_DLL void* getCustom( const std::type_info& rtti, bool isInvocation ) const;
158 #else
159
160 ALIB_DLL void* getCustom( const std::type_info& rtti
161 ALIB_DBG( , bool isInvocation )) const;
162 #endif
163
164 /// Non-inline implementation of #Set #Get used in the case of non-built-in functions.
165 /// @param rtti The \c typeid of the function to register.
166 /// @param implementation The implementation of the function.
167 ALIB_DLL void setCustom( const std::type_info& rtti, void* implementation );
168
169}; // FunctionTable
170
171//==================================================================================================
172/// The default box-functions set.
173//==================================================================================================
175
176//==================================================================================================
177/// The custom function hash
178//==================================================================================================
179#if !DOXYGEN
180struct CustomFunctionKey {
181 const FunctionTable* Parent;
182 const std::type_info& Type;
183 CustomFunctionKey( const FunctionTable* parent, const std::type_info& type )
184 : Parent(parent), Type (type ) {}
185};
186
187struct CustomFunctionMapped {
188 void* Implementation;
189 ALIB_DBG(uinteger DbgCntInvocations; )
190
191 CustomFunctionMapped( void* implementation ): Implementation (implementation)
192ALIB_DBG(,DbgCntInvocations (0 ) ) {}
193};
194
195struct CustomFunctionHash {
196 std::size_t operator()(const CustomFunctionKey& key) const {
197 size_t result= reinterpret_cast<size_t>(key.Parent)
198 ^ key.Type.hash_code();
199 result^= (result << 21 );
200 result^= (result >> 11);
201 return result;
202 }};
203
204struct CustomFunctionEqualTo {
205 bool operator()(const CustomFunctionKey& lhs, const CustomFunctionKey& rhs) const {
206 return lhs.Parent == rhs.Parent
207 && lhs.Type == rhs.Type;
208 }};
209
210#if ALIB_MONOMEM && ALIB_CONTAINERS
211extern HashMap < MonoAllocator,
212 CustomFunctionKey, CustomFunctionMapped,
213 CustomFunctionHash,
214 CustomFunctionEqualTo > customFunctionMap;
215#else
216extern std::unordered_map< CustomFunctionKey, CustomFunctionMapped,
217 CustomFunctionHash,
218 CustomFunctionEqualTo > customFunctionMap;
219#endif
220#endif //!DOXYGEN
221
222//==================================================================================================
223/// This struct is used internally with \alib_boxing_nl to provide run-time type information
224/// and virtual method invocations to boxed values.
225/// A singleton instance of this struct is attached to each \alib{boxing;Box}.
226//==================================================================================================
227struct VTable
228{
229 /// Denotes if the mapped type is a value type, a pointer type, an enum or an array.
230 /// The latter is not specified by an enum element, but rather is \c true for all enum
231 /// elements that have a value greater than \c 0. The value in this case provides the size
232 /// of the array's element type.
234 {
235 Value = 0, ///< Value boxing.
236 Pointer = -1, ///< Pointer boxing.
237 Enum = -2, ///< Enum type boxing
238 };
239
240 /// Information about the encapsulated type. In the case of arrays, this field is
241 /// equal to \c typeid(void).
242 const std::type_info& Type;
243
244 /// In case of array types, information about the element type. Otherwise this field is
245 /// equal to \c typeid(void).
246 const std::type_info& ElementType;
247
248 /// Denotes if the mapped type is a value type, a pointer type, an enum or an array.
249 /// In the case of array types, the enum element value provides the size of the array's element
250 /// type (a value greater than \c 0).
252
253 /// The number of relevant bytes used in the placeholder.
254 /// \see
255 /// The documentation of \alib{boxing;SizeTraits} provides details on
256 /// and rationals for the existence of this property.
257 const unsigned int PlaceholderUsage;
258
259 /// Box-functions attached with \alib{boxing;BootstrapRegister}.
261
262 #if ALIB_DEBUG
263 /// These flags are available in debug-compilations only. Denotes whether this vtable
264 /// is statically or dynamically created. In the case of \b Unregistered, a customized
265 /// vtable was not properly registered on bootstrap.
266 enum class DbgFactoryType
267 {
268 Unregistered, ///< Not registered, yet.
269 Static , ///< A static VTable is in place.
270 Dynamic , ///< The VTable is created dynamically from the templated type
271 ///< \b VTableUnoptimized.
272 };
273
274 /// Debug information.
276
277 /// Counter for the number of unbox operations and function invocations made on boxes
278 /// that used this \e vtable. Precisely, the counter is increased with invocations of
279 /// \alib{boxing;Box::Unbox},
280 /// \alib{boxing;Box::UnboxArray},
281 /// \alib{boxing;Box::UnboxElement},
282 /// \alib{boxing;Box::TypeID} and
283 /// \alib{boxing;Box::GetFunction}.
284 ///
285 /// Available only with debug-builds.
287 #endif
288
289 /// Constructor.
290 ///
291 /// @param type Type information of the derived \b VTable type.
292 /// @param elementType Type information of the elements of the boxed array.
293 /// @param mapping The type of boxing: value, pointer, enum or arrays.
294 /// @param placeholderUsage The size of elements of the boxed array.
295 VTable( const std::type_info& type,
296 const std::type_info& elementType,
297 MappingType mapping,
298 unsigned int placeholderUsage )
299 : Type ( type )
300 , ElementType ( elementType )
301 , Mapping ( mapping )
302 , PlaceholderUsage( placeholderUsage ) {}
303
304
305 /// Virtual destructor.<br>
306 /// Note: This is not really needed and empty. Because derived class \b %VTable derives from
307 /// virtual type \alib{singletons;Singleton}, having this destructor allows cleaning memory
308 /// on termination "more precisely" and reduce warnings raised by analytics tools like
309 /// \b valgrind.
310 virtual ~VTable() {}
311
312 /// Returns \c true if this vtable represents boxed array types. In this case, method
313 /// \ref alib::boxing::Box::UnboxLength "Box::UnboxLength"
314 /// will return the length of the array and
315 /// \ref alib::boxing::Box::UnboxElement "Box::UnboxElement" may be used to
316 /// access elements of the array.
317 ///
318 /// @return \c true if this vtable is representing an array type, \c false otherwise.
319 bool IsArray() const { return Mapping > 0; }
320
321 /// Returns \c true if this vtable represents mapped pointer type.
322 ///
323 /// @return \c true if this vtable is representing a pointer type, \c false otherwise.
324 bool IsPointer() const { return Mapping == MappingType::Pointer; }
325
326 /// Returns \c true if this vtable represents a scoped or non-scoped enum type.
327 ///
328 /// @return \c true if this vtable is representing an enum type, \c false otherwise.
329 bool IsEnum() const { return Mapping == MappingType::Enum; }
330}; // struct VTable
331
332#if ALIB_DEBUG
333} namespace debug {
334
335/// Registers a virtual table for debug purposes.
336/// This function is invoked internally, when a dynamic \e vtable is created and
337/// when a static \e vtable is registered.
338///
339/// Statically created \e vtables have to be registered during bootstrap in debug-compilations.
340/// For this, macro \ref ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER is available, which is empty
341/// in release compilations.
342///
343/// \see
344/// Macros ALIB_BOXING_VTABLE_DECLARE and \ref alib_mod_boxing "Programmer's Manual" chapter
345/// \ref alib_boxing_more_opt_staticvt.
346///
347/// @param vtable The vtable to register.
348/// @param productionType Denotes whether the \p{vtable} is a static constexpr object or
349/// dynamically created from template type \b VTableUnoptimized.
351void DbgRegisterVTable( detail::VTable* vtable, detail::VTable::DbgFactoryType productionType );
352#endif
353
354} namespace detail {
355
356
357//==================================================================================================
358/// This is a templated derivate of class \b VTable. It is necessary to create singletons for
359/// arbitrary mapped types.
360///
361/// \see
362/// Chapter \ref alib_boxing_more_opt_staticvt_bg
363/// of the \alib_boxing "Programmer's Manual" of module \alib_boxing_nl.
364///
365/// ## Friends ##
366/// class \alib{singletons;Singleton;Singleton< VTableUnoptimized<TMapped, TIsArray> >}
367///
368/// @tparam TMapped The mapped type.
369/// @tparam TIsArray Denotes whether array-boxing is performed or not.
370//==================================================================================================
371template<typename TMapped, bool TIsArray>
373 , public Singleton< VTableUnoptimized<TMapped, TIsArray> >
374{
375 #if !DOXYGEN
377 #endif
378
379 private:
380 /// Constructor. Passes parameters as expected by parent class \b VTable.
381 ///
382 /// This constructor is private, and class \b %Singleton is a friend, which makes each
383 /// template instance of this class being a 'strict' singleton (only that singleton instance
384 /// exists).
386 : VTable( !TIsArray ? typeid(TMapped)
387 : typeid(TMapped[1]),
388
389 !TIsArray ? typeid(void)
390 : typeid(TMapped),
391
392 TIsArray ? VTable::MappingType(sizeof(TMapped))
393 : std::is_pointer_v<TMapped>
395 : std::is_enum_v<TMapped>
398
399 !TIsArray ? SizeTraits<TMapped>
400 : sizeof(Placeholder) ) {
401 #if ALIB_DEBUG_BOXING
403 #endif
404 }
405};
406
407} namespace debug {
408#if ALIB_DEBUG_BOXING || DOXYGEN
409
410/// Checks if \alib_boxing_nl was correctly initialized.
411/// This is done with the creation of \ref alib_boxing_more_opt_staticvt "dynamic vtables",
412/// to detect global or static box objects which are initialized with data that is mapped to
413/// a type that no static \e vtable is defined for.
414///
415/// Available and used only in debug-compilations.
416///
417/// \see
418/// Manual chapter \ref alib_boxing_more_static_instances.
420
421/// Checks for doubly-defined \e vtables, as well as for unregistered
422/// \ref alib_boxing_more_opt_staticvt "static vtables".
423///
424/// Available and used only in debug-compilations.
425/// @param vtable The \e vtable to check.
426/// @param increaseUsageCounter Denotes if this is a use of the vtable or just a check.
427ALIB_DLL void DbgCheckRegistration( detail::VTable* vtable, bool increaseUsageCounter );
428#else
429inline void DbgCheckIsInitialized() {}
430inline void DbgCheckRegistration (detail::VTable*, bool ) {}
431#endif
432
433} // namespace alib::boxing[::debug]
434
435//==================================================================================================
436/// Method #Get of the default version of this struct creates a \alib{boxing::detail;VTable}
437/// dynamically.
438/// For this, a corresponding templated \alib{singletons;Singleton} of type
439/// \alib{boxing::detail;VTableUnoptimized<TMapped, TIsArray>} is returned.
440///
441/// For optimization purposes (code size as well as execution performance), this struct might
442/// be specialized for selected mapped types to return a static singleton object.
443///
444/// Specializations can be performed with preprocessor macros
445/// - \ref ALIB_BOXING_VTABLE_DECLARE,
446/// - \ref ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE, and
447/// - \ref ALIB_BOXING_VTABLE_DEFINE.
448///
449/// Furthermore, with debug-compilations, such spezializations should be "registered" during
450/// bootstrap using macro \ref ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER.
451///
452/// Specializations for all C++ fundamental types are given. Furthermore, various different
453/// \alibmods provide such specializations for types they introduced and that are boxed.
454///
455/// \see
456/// - Chapter \ref alib_boxing_more_opt_staticvt_howto of the Programmer's Manual
457/// of \alib_boxing_nl.
458///
459/// @tparam TMapped The mapped type to receive a \e vtable for.
460/// @tparam TIsArray Denotes if this is array-boxing or not.
461//==================================================================================================
462template<typename TMapped, bool TIsArray>
464{
465 /// Functor to return the \b vtable singleton.
466 /// @return The requested \e vtable singleton.
467 static constexpr detail::VTable* Get() {
470 debug::DbgCheckRegistration( result, false );
471 return result;
472 }
473};
474
475
476
477#if ALIB_DEBUG && !DOXYGEN
478namespace debug {
479# if ALIB_MONOMEM && ALIB_CONTAINERS
483# else
484 extern std::unordered_set< lang::TypeFunctors::Key, lang::TypeFunctors::Hash, lang::TypeFunctors::EqualTo> DbgKnownCustomFunctions;
485 extern std::unordered_map< lang::TypeFunctors::Key, detail::VTable*, lang::TypeFunctors::Hash, lang::TypeFunctors::EqualTo> DbgKnownVTables;
486 extern std::unordered_map< lang::TypeFunctors::Key, detail::VTable*, lang::TypeFunctors::Hash, lang::TypeFunctors::EqualTo> DbgKnownVTablesArray;
487# endif
488extern ALIB_DLL void DbgLockMaps( bool doLock );
489} // namespace alib::boxing[::debug]
490#endif
491
492} // namespace [alib::boxing]
493
494// VTables for character arrays. We need them before the constructors of class Box are defined.
495// Therefore, declaring them in "boxingcustoms.inl.inl." would be too late.
496DOX_MARKER([DOX_BOXING_OPTIMIZE_DECLARE_2])
497ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( char, vt_arr_char )
498DOX_MARKER([DOX_BOXING_OPTIMIZE_DECLARE_2])
499ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( wchar_t , vt_arr_wchar_t )
500ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( char8_t , vt_arr_char8_t )
501ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( char16_t , vt_arr_char16_t)
502ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( char32_t , vt_arr_char32_t)
#define ALIB_DLL
Definition alib.inl:503
#define ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE(TMapped, Identifier)
#define ALIB_EXPORT
Definition alib.inl:497
#define ALIB_DBG(...)
Definition alib.inl:853
ALIB_DLL void DbgCheckIsInitialized()
void DbgRegisterVTable(detail::VTable *vtable, detail::VTable::DbgFactoryType productionType)
ALIB_DLL void DbgCheckRegistration(detail::VTable *vtable, bool increaseUsageCounter)
This namespace implements internals of namespace alib::boxing.
Definition vtable.cpp:43
FunctionTable DEFAULT_FUNCTIONS
The default box-functions set.
Definition vtable.cpp:95
constexpr unsigned SizeTraits
std::conditional_t< ArrayTraits< T, nchar >::Access !=Policy::NONE, nchar, std::conditional_t< ArrayTraits< T, wchar >::Access !=Policy::NONE, wchar, std::conditional_t< ArrayTraits< T, xchar >::Access !=Policy::NONE, xchar, void > > > Type
containers::HashSet< TAllocator, T, THash, TEqual, THashCaching, TRecycling > HashSet
Type alias in namespace alib. See type definition alib::containers::HashSet.
singletons::Singleton< T > Singleton
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
Definition integers.inl:149
containers::HashMap< TAllocator, TKey, TMapped, THash, TEqual, THashCaching, TRecycling > HashMap
Type alias in namespace alib.
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
lang::uinteger uinteger
Type alias in namespace alib.
Definition integers.inl:152
boxing::FAppend< TChar, TAllocator > FAppend
Type alias in namespace alib.
bool(*)(const Box &self) Signature
static constexpr detail::VTable * Get()
Definition vtable.inl:467
ALIB_DLL void setCustom(const std::type_info &rtti, void *implementation)
Definition vtable.cpp:123
uinteger DbgCntInvocationsFHashcode
Debug-compilation counter for the number of invocations.
Definition vtable.inl:37
uinteger DbgCntInvocationsFIsTrue
Debug-compilation counter for the number of invocations.
Definition vtable.inl:41
void Set(typename TFDecl::Signature implementation)
TFDecl::Signature Get(bool isInvocation) const
FIsNotNull::Signature fIsNotNull
Entry for built-in function FIsNotNull.
Definition vtable.inl:25
FAppend< character, lang::HeapAllocator > ::Signature fAppend
< Entry for built-in function FAppend.
Definition vtable.inl:34
uinteger DbgCntInvocationsFIsLess
Debug-compilation counter for the number of invocations.
Definition vtable.inl:40
FIsTrue::Signature fIsTrue
Entry for built-in function FIsTrue.
Definition vtable.inl:28
FIsLess::Signature fIsLess
Entry for built-in function FIsLess.
Definition vtable.inl:27
ALIB_DLL void * getCustom(const std::type_info &rtti, bool isInvocation) const
Definition vtable.cpp:109
FEquals::Signature fEquals
Entry for built-in function FEquals.
Definition vtable.inl:26
uinteger DbgCntInvocationsFIsNotNull
Debug-compilation counter for the number of invocations.
Definition vtable.inl:38
uinteger DbgCntInvocationsFEquals
Debug-compilation counter for the number of invocations.
Definition vtable.inl:39
FClone::Signature fClone
Entry for built-in function FClone.
Definition vtable.inl:30
uinteger DbgCntInvocationsFClone
Debug-compilation counter for the number of invocations.
Definition vtable.inl:43
uinteger DbgCntInvocationsFAppend
Debug-compilation counter for the number of invocations.
Definition vtable.inl:46
FHashcode::Signature fHashcode
Entry for built-in function FHashcode.
Definition vtable.inl:24
static ALIB_DLL void Shutdown()
Needs to be called only in debug versions to shut down internal hashtables cleanly.
Definition vtable.cpp:98
The custom function hash.
Definition vtable.inl:228
FunctionTable Functions
Box-functions attached with BootstrapRegister.
Definition vtable.inl:260
const unsigned int PlaceholderUsage
Definition vtable.inl:257
const std::type_info & ElementType
Definition vtable.inl:246
VTable(const std::type_info &type, const std::type_info &elementType, MappingType mapping, unsigned int placeholderUsage)
Definition vtable.inl:295
DbgFactoryType DbgProduction
Debug information.
Definition vtable.inl:275
const MappingType Mapping
Definition vtable.inl:251
@ Pointer
Pointer boxing.
Definition vtable.inl:236
@ Enum
Enum type boxing.
Definition vtable.inl:237
@ Static
A static VTable is in place.
Definition vtable.inl:269
const std::type_info & Type
Definition vtable.inl:242