ALib C++ Library
Library Version: 2510 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
34 ::Signature fAppend = nullptr; ///< Entry for built-in function \alib{boxing;FAppend}.
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 {
89 return 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 ) { return setCustom( typeid(TFDecl), reinterpret_cast<void*>( impl ) ); }
133#endif
134
135 // #############################################################################################
136 // Cleanup (needed for debug-builds in shutdown)
137 // #############################################################################################
138#if (ALIB_MONOMEM && ALIB_CONTAINERS && ALIB_DEBUG) || DOXYGEN
139 /// Needs to be called only in debug versions to shut down internal hashtables cleanly.
140 ALIB_DLL static void Shutdown();
141#else
142 inline static void Shutdown() {}
143#endif
144
145
146 // #############################################################################################
147 // internals
148 // #############################################################################################
149 protected:
150 #if DOXYGEN
151 /// Non-inline implementation of #Get used in the case of non-built-in functions.
152 /// @param rtti The \c typeid of the function to get.
153 /// @param isInvocation If \c true, the invocation counter is increased.
154 /// This parameter is defined only in debug-compilations.
155 /// @return The pointer to the box-function.
156 ALIB_DLL void* getCustom( const std::type_info& rtti, bool isInvocation ) const;
157 #else
158
159 ALIB_DLL void* getCustom( const std::type_info& rtti
160 ALIB_DBG( , bool isInvocation )) const;
161 #endif
162
163 /// Non-inline implementation of #Set #Get used in the case of non-built-in functions.
164 /// @param rtti The \c typeid of the function to register.
165 /// @param implementation The implementation of the function.
166 ALIB_DLL void setCustom( const std::type_info& rtti, void* implementation );
167
168}; // FunctionTable
169
170//==================================================================================================
171/// The default box-functions set.
172//==================================================================================================
174
175//==================================================================================================
176/// The custom function hash
177//==================================================================================================
178#if !DOXYGEN
179struct CustomFunctionKey {
180 const FunctionTable* Parent;
181 const std::type_info& Type;
182 CustomFunctionKey( const FunctionTable* parent, const std::type_info& type )
183 : Parent(parent), Type (type ) {}
184};
185
186struct CustomFunctionMapped {
187 void* Implementation;
188 ALIB_DBG(uinteger DbgCntInvocations; )
189
190 CustomFunctionMapped( void* implementation ): Implementation (implementation)
191 ALIB_DBG(,DbgCntInvocations (0 ) ) {}
192};
193
194struct CustomFunctionHash {
195 std::size_t operator()(const CustomFunctionKey& key) const {
196 size_t result= reinterpret_cast<size_t>(key.Parent)
197 ^ key.Type.hash_code();
198 result^= (result << 21 );
199 result^= (result >> 11);
200 return result;
201 }};
202
203struct CustomFunctionEqualTo {
204 bool operator()(const CustomFunctionKey& lhs, const CustomFunctionKey& rhs) const {
205 return lhs.Parent == rhs.Parent
206 && lhs.Type == rhs.Type;
207 }};
208
209#if ALIB_MONOMEM && ALIB_CONTAINERS
210extern HashMap < MonoAllocator,
211 CustomFunctionKey, CustomFunctionMapped,
212 CustomFunctionHash,
213 CustomFunctionEqualTo > customFunctionMap;
214#else
215extern std::unordered_map< CustomFunctionKey, CustomFunctionMapped,
216 CustomFunctionHash,
217 CustomFunctionEqualTo > customFunctionMap;
218#endif
219#endif //!DOXYGEN
220
221//==================================================================================================
222/// This struct is used internally with \alib_boxing_nl to provide run-time type information
223/// and virtual method invocations to boxed values.
224/// A singleton instance of this struct is attached to each \alib{boxing;Box}.
225//==================================================================================================
226struct VTable
227{
228 /// Denotes if the mapped type is a value type, a pointer type, an enum or an array.
229 /// The latter is not specified by an enum element, but rather is \c true for all enum
230 /// elements that have a value greater than \c 0. The value in this case provides the size
231 /// of the array's element type.
233 {
234 Value = 0, ///< Value boxing.
235 Pointer = -1, ///< Pointer boxing.
236 Enum = -2, ///< Enum type boxing
237 };
238
239 /// Information about the encapsulated type. In the case of arrays, this field is
240 /// equal to \c typeid(void).
241 const std::type_info& Type;
242
243 /// In case of array types, information about the element type. Otherwise this field is
244 /// equal to \c typeid(void).
245 const std::type_info& ElementType;
246
247 /// Denotes if the mapped type is a value type, a pointer type, an enum or an array.
248 /// In the case of array types, the enum element value provides the size of the array's element
249 /// type (a value greater than \c 0).
251
252 /// The number of relevant bytes used in the placeholder.
253 /// \see
254 /// The documentation of \alib{boxing;SizeTraits} provides details on
255 /// and rationals for the existence of this property.
256 const unsigned int PlaceholderUsage;
257
258 /// Box-functions attached with \alib{boxing;BootstrapRegister}.
260
261 #if ALIB_DEBUG
262 /// These flags are available in debug-compilations only. Denotes whether this vtable
263 /// is statically or dynamically created. In the case of \b Unregistered, a customized
264 /// vtable was not properly registered on bootstrap.
265 enum class DbgFactoryType
266 {
267 Unregistered, ///< Not registered, yet.
268 Static , ///< A static VTable is in place.
269 Dynamic , ///< The VTable is created dynamically from the templated type
270 ///< \b VTableUnoptimized.
271 };
272
273 /// Debug information.
275
276 /// Counter for the number of unbox operations and function invocations made on boxes
277 /// that used this \e vtable. Precisely, the counter is increased with invocations
278 /// 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
306 /// Virtual destructor.<br>
307 /// Note: This is not really needed and empty. Because derived class \b %VTable derives from
308 /// virtual type \alib{singletons;Singleton}, having this destructor allows cleaning memory
309 /// on termination "more precisely" and reduce warnings raised by analytics tools like
310 /// \b valgrind.
311 virtual ~VTable()
312 {}
313
314 /// Returns \c true if this vtable represents boxed array types. In this case, method
315 /// \ref alib::boxing::Box::UnboxLength "Box::UnboxLength"
316 /// will return the length of the array and
317 /// \ref alib::boxing::Box::UnboxElement "Box::UnboxElement" may be used to
318 /// access elements of the array.
319 ///
320 /// @return \c true if this vtable is representing an array type, \c false otherwise.
321 bool IsArray() const
322 {
323 return Mapping > 0;
324 }
325
326 /// Returns \c true if this vtable represents mapped pointer type.
327 ///
328 /// @return \c true if this vtable is representing a pointer type, \c false otherwise.
329 bool IsPointer() const
330 {
332 }
333
334 /// Returns \c true if this vtable represents a scoped or non-scoped enum type.
335 ///
336 /// @return \c true if this vtable is representing an enum type, \c false otherwise.
337 bool IsEnum() const
338 {
339 return Mapping == MappingType::Enum;
340 }
341}; // struct VTable
342
343#if ALIB_DEBUG
344} namespace debug {
345
346/// Registers a virtual table for debug purposes.
347/// This function is invoked internally, when a dynamic \e vtable is created and
348/// when a static \e vtable is registered.
349///
350/// Statically created \e vtables have to be registered during bootstrap in debug-compilations.
351/// For this, macro \ref ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER is available, which is empty
352/// in release compilations.
353///
354/// \see
355/// Macros ALIB_BOXING_VTABLE_DECLARE and \ref alib_mod_boxing "Programmer's Manual" chapter
356/// \ref alib_boxing_more_opt_staticvt.
357///
358/// @param vtable The vtable to register.
359/// @param productionType Denotes whether the \p{vtable} is a static constexpr object or
360/// dynamically created from template type \b VTableUnoptimized.
362void DbgRegisterVTable( detail::VTable* vtable, detail::VTable::DbgFactoryType productionType );
363#endif
364
365} namespace detail {
366
367
368//==================================================================================================
369/// This is a templated derivate of class \b VTable. It is necessary to create singletons for
370/// arbitrary mapped types.
371///
372/// \see
373/// Chapter \ref alib_boxing_more_opt_staticvt_bg
374/// of the \alib_boxing "Programmer's Manual" of module \alib_boxing_nl.
375///
376/// ## Friends ##
377/// class \alib{singletons;Singleton;Singleton< VTableUnoptimized<TMapped, TIsArray> >}
378///
379/// @tparam TMapped The mapped type.
380/// @tparam TIsArray Denotes whether array-boxing is performed or not.
381//==================================================================================================
382template<typename TMapped, bool TIsArray>
384 , public Singleton< VTableUnoptimized<TMapped, TIsArray> >
385{
386 #if !DOXYGEN
388 #endif
389
390 private:
391 /// Constructor. Passes parameters as expected by parent class \b VTable.
392 ///
393 /// This constructor is private, and class \b %Singleton is a friend, which makes each
394 /// template instance of this class being a 'strict' singleton (only that singleton instance
395 /// exists).
397 : VTable( !TIsArray ? typeid(TMapped)
398 : typeid(TMapped[1]),
399
400 !TIsArray ? typeid(void)
401 : typeid(TMapped),
402
403 TIsArray ? VTable::MappingType(sizeof(TMapped))
404 : std::is_pointer_v<TMapped>
406 : std::is_enum_v<TMapped>
409
410 !TIsArray ? SizeTraits<TMapped>
411 : sizeof(Placeholder) ) {
412 #if ALIB_DEBUG_BOXING
414 #endif
415 }
416};
417
418} namespace debug {
419#if ALIB_DEBUG_BOXING || DOXYGEN
420
421/// Checks if \alib_boxing_nl was correctly initialized.
422/// This is done with the creation of \ref alib_boxing_more_opt_staticvt "dynamic vtables",
423/// to detect global or static box objects which are initialized with data that is mapped to
424/// a type that no static \e vtable is defined for.
425///
426/// Available and used only in debug-compilations.
427///
428/// \see
429/// Manual chapter \ref alib_boxing_more_static_instances.
431
432/// Checks for doubly-defined \e vtables, as well as for unregistered
433/// \ref alib_boxing_more_opt_staticvt "static vtables".
434///
435/// Available and used only in debug-compilations.
436/// @param vtable The \e vtable to check.
437/// @param increaseUsageCounter Denotes if this is a use of the vtable or just a check.
438ALIB_DLL void DbgCheckRegistration( detail::VTable* vtable, bool increaseUsageCounter );
439#else
440inline void DbgCheckIsInitialized() {}
441inline void DbgCheckRegistration (detail::VTable*, bool ) {}
442#endif
443
444} // namespace alib::boxing[::debug]
445
446//==================================================================================================
447/// Method #Get of the default version of this struct creates a \alib{boxing::detail;VTable}
448/// dynamically.
449/// For this, a corresponding templated \alib{singletons;Singleton} of type
450/// \alib{boxing::detail;VTableUnoptimized<TMapped, TIsArray>} is returned.
451///
452/// For optimization purposes (code size as well as execution performance), this struct might
453/// be specialized for selected mapped types to return a static singleton object.
454///
455/// Specializations can be performed with preprocessor macros
456/// - \ref ALIB_BOXING_VTABLE_DECLARE,
457/// - \ref ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE, and
458/// - \ref ALIB_BOXING_VTABLE_DEFINE.
459///
460/// Furthermore, with debug-compilations, such spezializations should be "registered" during
461/// bootstrap using macro \ref ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER.
462///
463/// Specializations for all C++ fundamental types are given. Furthermore, various different
464/// \alibmods provide such specializations for types they introduced and that are boxed.
465///
466/// \see
467/// - Chapter \ref alib_boxing_more_opt_staticvt_howto of the Programmer's Manual
468/// of \alib_boxing_nl.
469///
470/// @tparam TMapped The mapped type to receive a \e vtable for.
471/// @tparam TIsArray Denotes if this is array-boxing or not.
472//==================================================================================================
473template<typename TMapped, bool TIsArray>
475{
476 /// Functor to return the \b vtable singleton.
477 /// @return The requested \e vtable singleton.
478 static constexpr detail::VTable* Get() {
481 debug::DbgCheckRegistration( result, false );
482 return result;
483 }
484};
485
486
487
488#if ALIB_DEBUG && !DOXYGEN
489namespace debug {
490# if ALIB_MONOMEM && ALIB_CONTAINERS
494# else
495 extern std::unordered_set< lang::TypeFunctors::Key, lang::TypeFunctors::Hash, lang::TypeFunctors::EqualTo> DbgKnownCustomFunctions;
496 extern std::unordered_map< lang::TypeFunctors::Key, detail::VTable*, lang::TypeFunctors::Hash, lang::TypeFunctors::EqualTo> DbgKnownVTables;
497 extern std::unordered_map< lang::TypeFunctors::Key, detail::VTable*, lang::TypeFunctors::Hash, lang::TypeFunctors::EqualTo> DbgKnownVTablesArray;
498# endif
499 extern ALIB_DLL void DbgLockMaps( bool doLock );
500} // namespace alib::boxing[::debug]
501#endif
502
503} // namespace [alib::boxing]
504
505// VTables for character arrays. We need them before the constructors of class Box are defined.
506// Therefore, declaring them in "boxingcustoms.inl.inl." would be too late.
507DOX_MARKER([DOX_BOXING_OPTIMIZE_DECLARE_2])
508ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( char, vt_arr_char )
509DOX_MARKER([DOX_BOXING_OPTIMIZE_DECLARE_2])
510ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( wchar_t , vt_arr_wchar_t )
511ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( char8_t , vt_arr_char8_t )
512ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( char16_t , vt_arr_char16_t)
513ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE( char32_t , vt_arr_char32_t)
514
515
516
#define ALIB_DLL
Definition alib.inl:496
#define ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE(TMapped, Identifier)
#define ALIB_EXPORT
Definition alib.inl:488
#define ALIB_DBG(...)
Definition alib.inl:836
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:96
constexpr unsigned int 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.
void(*)(const Box &self, strings::TAString< TChar, TAllocator > &target) Signature
bool(*)(const Box &self) Signature
static constexpr detail::VTable * Get()
Definition vtable.inl:478
ALIB_DLL void setCustom(const std::type_info &rtti, void *implementation)
Definition vtable.cpp:127
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
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
FAppend< character, lang::HeapAllocator >::Signature fAppend
Entry for built-in function FAppend.
Definition vtable.inl:34
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:111
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:99
The custom function hash.
Definition vtable.inl:227
FunctionTable Functions
Box-functions attached with BootstrapRegister.
Definition vtable.inl:259
const unsigned int PlaceholderUsage
Definition vtable.inl:256
const std::type_info & ElementType
Definition vtable.inl:245
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:274
const MappingType Mapping
Definition vtable.inl:250
@ Pointer
Pointer boxing.
Definition vtable.inl:235
@ Enum
Enum type boxing.
Definition vtable.inl:236
@ Static
A static VTable is in place.
Definition vtable.inl:268
const std::type_info & Type
Definition vtable.inl:241