LibCXX 0.26.1
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
x::ptrImpl< objClass > Class Template Reference

Reference pointer implementation. More...

#include <ptrimpl.H>

Public Types

typedef objClass obj_type
 Define this reference's base type.
 

Public Member Functions

template<typename baseClass >
requires derived_from_obj<objClass>
 ptrImpl (const const_ref< objClass, baseClass > &o) noexcept
 
 ptrImpl (const ptrImpl< objClass > &o) noexcept LIBCXX_INLINE
 The default copy constructor.
 
template<typename baseClass >
requires derived_from_obj<objClass>
 ptrImpl (const ref< objClass, baseClass > &o) noexcept
 
template<typename baseClass >
requires derived_from_obj<objClass>
 ptrImpl (const_ptr< objClass, baseClass > &&o) noexcept
 Move constructor.
 
template<typename baseClass >
requires derived_from_obj<objClass>
 ptrImpl (const_ref< objClass, baseClass > &&o) noexcept
 
template<typename impl_objClass = objClass>
requires derived_from_obj<impl_objClass>
 ptrImpl (objClass *pArg) noexcept LIBCXX_INLINE
 Default constructor.
 
template<typename baseClass >
requires derived_from_obj<objClass>
 ptrImpl (ptr< objClass, baseClass > &&o) noexcept
 Move constructor.
 
 ptrImpl (ptrImpl< objClass > &&o) noexcept LIBCXX_INLINE
 Move constructor.
 
template<typename baseClass >
requires derived_from_obj<objClass>
 ptrImpl (ref< objClass, baseClass > &&o) noexcept
 
 ~ptrImpl () LIBCXX_INLINE
 Default destructor.
 
bool null () const noexcept LIBCXX_INLINE
 Check if this is an unbound reference.
 
 operator bool () const noexcept
 Make it work in boolean context.
 
bool operator! () const noexcept
 Make it work in boolean context.
 
ptrImpl< objClass > & operator= (const ptrImpl< objClass > &o) noexcept LIBCXX_INLINE
 The default assignment operator.
 
ptrImpl< objClass > & operator= (ptrImpl< objClass > &&o) noexcept LIBCXX_INLINE
 The move operator.
 

Protected Member Functions

objClass * getrefP () const noexcept LIBCXX_INLINE
 Return the underlying pointer.
 
void setRef (objClass *newRefP) noexcept LIBCXX_INLINE
 Update reference pointer.
 
void setRef_noconscheck (objClass *newRefP) noexcept LIBCXX_INLINE
 Update reference pointer.
 

Protected Attributes

objClass * refP
 Object that this reference is bound to.
 

Friends

template<typename , typename >
class const_ptr
 
template<typename , typename >
class const_ref
 
class obj
 
template<typename , typename >
class ptr
 
template<typename , typename >
class ref
 

Detailed Description

template<typename objClass>
class x::ptrImpl< objClass >

Reference pointer implementation.

This class stores the pointer to the underlying reference-counted object, and implements its housekeeping functions.

Member Typedef Documentation

◆ obj_type

template<typename objClass >
typedef objClass x::ptrImpl< objClass >::obj_type

Define this reference's base type.

Constructor & Destructor Documentation

◆ ptrImpl() [1/9]

template<typename objClass >
template<typename impl_objClass = objClass>
requires derived_from_obj<impl_objClass>
x::ptrImpl< objClass >::ptrImpl ( objClass *  pArg)
noexcept

Default constructor.

Parameters
pArgIf pArg is not NULL, the object's reference count gets incremented. When pArg is NULL, this is an unbound reference.

◆ ~ptrImpl()

template<typename objClass >
x::ptrImpl< objClass >::~ptrImpl ( )

Default destructor.

◆ ptrImpl() [2/9]

template<typename objClass >
x::ptrImpl< objClass >::ptrImpl ( const ptrImpl< objClass > &  o)
noexcept

The default copy constructor.

Parameters
oAn existing reference. If this reference is bound to an instance of objClass, its reference count gets incremented.

◆ ptrImpl() [3/9]

template<typename objClass >
template<typename baseClass >
requires derived_from_obj<objClass>
x::ptrImpl< objClass >::ptrImpl ( const const_ref< objClass, baseClass > &  o)
explicitnoexcept

◆ ptrImpl() [4/9]

template<typename objClass >
template<typename baseClass >
requires derived_from_obj<objClass>
x::ptrImpl< objClass >::ptrImpl ( const ref< objClass, baseClass > &  o)
explicitnoexcept

◆ ptrImpl() [5/9]

template<typename objClass >
template<typename baseClass >
requires derived_from_obj<objClass>
x::ptrImpl< objClass >::ptrImpl ( const_ref< objClass, baseClass > &&  o)
explicitnoexcept

◆ ptrImpl() [6/9]

template<typename objClass >
template<typename baseClass >
requires derived_from_obj<objClass>
x::ptrImpl< objClass >::ptrImpl ( ref< objClass, baseClass > &&  o)
inlineexplicitnoexcept

◆ ptrImpl() [7/9]

template<typename objClass >
x::ptrImpl< objClass >::ptrImpl ( ptrImpl< objClass > &&  o)
inlinenoexcept

Move constructor.

Parameters
oAn existing reference.

◆ ptrImpl() [8/9]

template<typename objClass >
requires derived_from_obj<objClass>
template<typename baseClass >
requires derived_from_obj<objClass>
x::ptrImpl< objClass >::ptrImpl ( const_ptr< objClass, baseClass > &&  o)
inlinenoexcept

Move constructor.

Parameters
oAn existing reference.

◆ ptrImpl() [9/9]

template<typename objClass >
requires derived_from_obj<objClass>
template<typename baseClass >
requires derived_from_obj<objClass>
x::ptrImpl< objClass >::ptrImpl ( ptr< objClass, baseClass > &&  o)
inlinenoexcept

Move constructor.

Parameters
oAn existing reference.

Member Function Documentation

◆ getrefP()

template<typename objClass >
objClass * x::ptrImpl< objClass >::getrefP ( ) const
inlineprotectednoexcept

Return the underlying pointer.

◆ null()

template<typename objClass >
bool x::ptrImpl< objClass >::null ( ) const
inlinenoexcept

Check if this is an unbound reference.

Returns
true, if this reference is not bound to an instance, false otherwise.

Referenced by x::workerpoolObj< workerThreadType >::~workerpoolObj(), x::lockpoolObj< lockid_t, compare_t, lockop_t, starve >::checklocks(), x::serialization::default_traits::classcreate(), x::eventqueuedestroynotifyObj< argType >::destroyed(), x::weakmapObj< K, T, M >::find_or_create(), x::ibasiciofilteriter< in_iter, input_type, output_type >::internal_fill(), x::singletonapp::managedSingletonFactoryObj< appObjClass, appBaseClass, factory_type, argsClass, argsBase, ret_args >::new_thread(), x::hierObj< hier_type, node_type >::iterator::operator*(), x::ibasiciofilteriter< in_iter, input_type, output_type >::operator++(), x::hierObj< hier_type, node_type >::iterator::operator++(), x::yaml::mappingnodeObj::iterator::operator<(), x::yaml::sequencenodeObj::iterator::operator<(), x::yaml::mappingnodeObj::iterator::operator<=(), x::yaml::sequencenodeObj::iterator::operator<=(), x::const_ref< objClass, baseClass >::operator=(), x::ibasiciofilteriter< in_iter, input_type, output_type >::operator==(), x::hierObj< hier_type, node_type >::iterator::operator==(), x::yaml::mappingnodeObj::iterator::operator==(), x::yaml::sequencenodeObj::iterator::operator==(), x::yaml::mappingnodeObj::iterator::operator>(), x::yaml::sequencenodeObj::iterator::operator>(), x::yaml::mappingnodeObj::iterator::operator>=(), x::yaml::sequencenodeObj::iterator::operator>=(), x::http::useragentObj::request(), x::serialize::serialize_value_nonconst< ptr< obj_type, base_type > >::serialize_bytes(), x::interface< refType >::setref(), and x::hierObj< hier_type, node_type >::readlockObj::to_child().

◆ operator bool()

template<typename objClass >
x::ptrImpl< objClass >::operator bool ( ) const
inlineexplicitnoexcept

Make it work in boolean context.

◆ operator!()

template<typename objClass >
bool x::ptrImpl< objClass >::operator! ( ) const
inlinenoexcept

Make it work in boolean context.

◆ operator=() [1/2]

template<typename objClass >
ptrImpl< objClass > & x::ptrImpl< objClass >::operator= ( const ptrImpl< objClass > &  o)
inlinenoexcept

The default assignment operator.

Parameters
oAn existing reference. If this reference is bound to an instance of objClass, its reference count gets incremented.

◆ operator=() [2/2]

template<typename objClass >
ptrImpl< objClass > & x::ptrImpl< objClass >::operator= ( ptrImpl< objClass > &&  o)
inlinenoexcept

The move operator.

Parameters
oAn existing reference.

◆ setRef()

template<typename objClass >
void x::ptrImpl< objClass >::setRef ( objClass *  newRefP)
inlineprotectednoexcept

Update reference pointer.

Set the reference to point to a new instance of the object class. The new instance's reference count gets incremented. The current reference's count gets decremented. If it becomes 0 the current object the reference points to gets destroyed. The reference gets repointed to the new object.

Parameters
newRefPNew object, may be NULL

◆ setRef_noconscheck()

template<typename objClass >
void x::ptrImpl< objClass >::setRef_noconscheck ( objClass *  newRefP)
inlineprotectednoexcept

Update reference pointer.

Same as setRef(), except that newRefP is from another ptr or ref, and not a raw pointer, so we don't need to do the ref_in_constructor() check.

Friends And Related Symbol Documentation

◆ const_ptr

template<typename objClass >
template<typename , typename >
friend class const_ptr
friend

◆ const_ref

template<typename objClass >
template<typename , typename >
friend class const_ref
friend

◆ obj

template<typename objClass >
friend class obj
friend

◆ ptr

template<typename objClass >
template<typename , typename >
friend class ptr
friend

◆ ref

template<typename objClass >
template<typename , typename >
friend class ref
friend

Member Data Documentation

◆ refP

template<typename objClass >
objClass* x::ptrImpl< objClass >::refP
protected

Object that this reference is bound to.

This pointer is NULL when this reference is not bound to any object.

Referenced by x::const_ref< objClass, baseClass >::getrefP(), and x::const_ptr< objClass, baseClass >::operator=().


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