Loading...
Searching...
No Matches
by::typeProvidable Class Referenceabstract

Interface for objects that can provide their type information. More...

#include <typeProvidable.hpp>

Inheritance diagram for by::typeProvidable:
by::binder by::instance by::life by::tweak< T, strTactic > by::tweak< by::stela, strTactic > by::tweak< T, TACTIC > by::stela by::tstr< by::stela > by::tstr< T, TACTIC > by::nulStela by::valStela by::verStela

Public Member Functions

nbool operator== (const me &rhs) const
 
nbool operator!= (const me &rhs) const
 
virtual const typegetType () const =0
 
nbool isSub (const type &it) const
 
nbool isSub (const type *it) const BY_SIDE_FUNC(isSub)
 
nbool isSub (const me &it) const
 
nbool isSub (const me *it) const BY_SIDE_FUNC(isSub)
 
nbool isSuper (const type &it) const
 
nbool isSuper (const type *it) const BY_SIDE_FUNC(isSuper)
 
nbool isSuper (const me &it) const
 
nbool isSuper (const me *it) const BY_SIDE_FUNC(isSuper)
 
template<typename T >
nint isSub () const
 
template<typename T >
nint isSuper () const
 
template<typename T >
Tcast ()
 
template<typename T >
const Tcast () const BY_CONST_FUNC(cast< T >()) virtual void *cast(const type &to)
 Safe cast to target type using type hierarchy information.
 
const voidcast (const type &to) const BY_CONST_FUNC(cast(to)) void *cast(const type *it) BY_SIDE_FUNC(cast)
 

Detailed Description

Interface for objects that can provide their type information.

Provides type introspection capabilities including type comparison, hierarchy checking, and safe casting operations.

Member Function Documentation

◆ cast()

template<typename T >
const T * by::typeProvidable::cast ( ) const &

Safe cast to target type using type hierarchy information.

Returns
Pointer to object if cast is valid, nullptr otherwise
Note
Uses O(1) tier algorithm instead of slow dynamic_cast

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