Loading...
Searching...
No Matches
by::tstr< T, TACTIC > Class Template Reference

Strong reference smart pointer with strict type checking. More...

#include <tstr.hpp>

Inheritance diagram for by::tstr< T, TACTIC >:
by::tweak< T, TACTIC > by::binder by::typeProvidable by::tbindable< instance >

Public Member Functions

 tstr (const type &subtype)
 
 tstr (const T &it)
 
 tstr (const T *it)
 
 tstr (const tmedium< T > &it)
 
 tstr (const binder &rhs)
 
 tstr (const me &rhs)
 
meoperator= (const me &rhs)=default
 
- Public Member Functions inherited from by::tweak< T, TACTIC >
 tweak (const type &subtype)
 
 tweak (const T &it)
 
 tweak (const T *it)
 
 tweak (const tmedium< T > &it)
 
 tweak (const me &rhs)
 
 tweak (const binder &rhs)
 
Toperator-> ()
 
Toperator* ()
 
const Toperator-> () const BY_CONST_FUNC(operator->()) const T &operator*() const BY_CONST_FUNC(operator*()) me &operator=(const binder &rhs)
 
meoperator= (const me &rhs)
 
Tget ()
 
const T *get() const BY_CONST_FUNC(get()) using super nbool bind (const T &new1)
 Binds a weak reference to the specified instance.
 
- Public Member Functions inherited from by::binder
 binder (const type &type, bindTacticable &tactic)
 Constructs a binder with a specific type and binding tactic.
 
 binder (const me &rhs)
 
instanceoperator-> ()
 Dereference operator to access bound instance.
 
const instanceoperator-> () const BY_CONST_FUNC(operator->()) instance &operator*()
 
const instanceoperator* () const BY_CONST_FUNC(operator*()) me &operator
 Assigns another binder's bound instance to this binder.
 
id getItsId () const
 Retrieves the unique ID of the instance currently bound by this binder.
 
nbool isBind () const override
 
void rel () override
 
nbool canBind (const type &it) const override
 Checks if given type can be bound to this binder.
 
nbool bind (const instance &it) override
 Binds instance to this binder with reference counting.
 
instanceget ()
 
const instanceget () const BY_CONST_FUNC(get()) template< typename E > E *get()
 
template<typename E >
const Eget () const BY_CONST_FUNC(get< E >()) const type &getType() const override
 
voidcast (const type &to) override
 
nbool canBind (const T &it) const
 
nbool canBind (const T *it) const BY_SIDE_FUNC(canBind)
 
virtual nbool canBind (const type &it) const=0
 
nbool canBind (const type *it) const BY_SIDE_FUNC(canBind)
 
virtual nbool bind (const T &it)
 
nbool bind (const T *it)
 Bind to instance pointer.
 
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)
 
- Public Member Functions inherited from by::typeProvidable
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)
 
- Public Member Functions inherited from by::tbindable< instance >
 operator nbool () const
 
nbool bind (const instance *it)
 Bind to instance pointer.
 
nbool canBind (const instance &it) const
 
nbool canBind (const instance *it) const BY_SIDE_FUNC(canBind)
 
nbool canBind (const type *it) const BY_SIDE_FUNC(canBind)
 

Additional Inherited Members

- Protected Member Functions inherited from by::binder
nbool _assign (const binder &rhs)
 Assigns binder from another binder.
 
nbool _onSame (const typeProvidable &rhs) const override
 Checks if two typeProvidable objects are same instance.
 
life_getBindTag () const
 Retrieves life object associated with bound instance.
 
- Protected Attributes inherited from by::binder
id _itsId
 
const type_type
 
bindTacticable_tactic
 

Detailed Description

template<typename T, typename TACTIC = strTactic>
class by::tstr< T, TACTIC >

Strong reference smart pointer with strict type checking.

Template-based strong reference binder with configurable memory management tactics. Provides type-safe access to instances with automatic lifetime management.

Constructor & Destructor Documentation

◆ tstr()

template<typename T , typename TACTIC = strTactic>
by::tstr< T, TACTIC >::tstr ( const type & subtype)
Parameters
subtypesubType is should be sub type of 'T' or type 'T' will be used from base class.

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