NCBI C++ ToolKit
Public Member Functions | Private Types | List of all members
CSrvRef< C, Locker > Class Template Reference

Search Toolkit Book for CSrvRef

Special variant of CRef that doesn't check for NULL when dereferencing. More...

#include "srv_ref.hpp"
(Private to src/app/netcache.)

+ Inheritance diagram for CSrvRef< C, Locker >:
+ Collaboration diagram for CSrvRef< C, Locker >:

Public Member Functions

 CSrvRef (void)
 
 CSrvRef (ENull)
 
 CSrvRef (TObjectType *ptr)
 
 CSrvRef (TObjectType *ptr, const locker_type &locker_value)
 
 CSrvRef (const TThisType &ref)
 
TThisTypeoperator= (const TThisType &ref)
 
TThisTypeoperator= (TObjectType *ptr)
 
TThisTypeoperator= (ENull)
 
TObjectTypeoperator* (void)
 
TObjectTypeoperator-> (void)
 
const TObjectTypeoperator* (void) const
 
const TObjectTypeoperator-> (void) const
 
- Public Member Functions inherited from CRef< C, Locker >
 CRef (void) THROWS_NONE
 Constructor for null pointer. More...
 
 CRef (ENull) THROWS_NONE
 Constructor for ENull pointer. More...
 
 CRef (TObjectType *ptr)
 Constructor for explicit type conversion from pointer to object. More...
 
 CRef (TObjectType *ptr, const locker_type &locker_value)
 Constructor for explicit type conversion from pointer to object. More...
 
 CRef (const TThisType &ref)
 Copy constructor from an existing CRef object,. More...
 
template<class TDerived , class = typename enable_if<is_convertible<TDerived*, TObjectType*>::value, void>::type>
 CRef (const CRef< TDerived, Locker > &ref)
 
 CRef (TThisType &&ref)
 Copy constructor from an existing CRef object,. More...
 
 ~CRef (void)
 Destructor. More...
 
const locker_typeGetLocker (void) const
 Get reference to locker object. More...
 
bool operator! (void) const THROWS_NONE
 Check if CRef is empty – not pointing to any object, which means having a null value. More...
 
bool Empty (void) const THROWS_NONE
 Check if CRef is empty – not pointing to any object, which means having a null value. More...
 
bool NotEmpty (void) const THROWS_NONE
 Check if CRef is not empty – pointing to an object and has a non-null value. More...
 
bool IsNull (void) const THROWS_NONE
 Check if pointer is null – same effect as Empty(). More...
 
bool NotNull (void) const THROWS_NONE
 Check if pointer is not null – same effect as NotEmpty(). More...
 
void Swap (TThisType &ref)
 Swaps the pointer with another reference. More...
 
void Reset (void)
 Reset reference object. More...
 
void Reset (TObjectType *newPtr)
 Reset reference object to new pointer. More...
 
TObjectTypeReleaseOrNull (void)
 Release a reference to the object and return a pointer to the object. More...
 
TObjectTypeRelease (void)
 Release a reference to the object and return a pointer to the object. More...
 
void AtomicResetFrom (const TThisType &ref)
 Reset reference object to new pointer. More...
 
void AtomicReleaseTo (TThisType &ref)
 Release referenced object to another CRef<> object. More...
 
TThisTypeoperator= (const TThisType &ref)
 Assignment operator for references. More...
 
template<class TDerived >
TThisTypeoperator= (const CRef< TDerived, Locker > &ref)
 
TThisTypeoperator= (TThisType &&ref)
 Assignment operator for references. More...
 
TThisTypeoperator= (TObjectType *ptr)
 Assignment operator for references with right hand side set to a pointer. More...
 
TThisTypeoperator= (ENull)
 Assignment operator with right hand side set to ENull. More...
 
TObjectTypeGetNonNullPointer (void)
 Get pointer value and throw a null pointer exception if pointer is null. More...
 
TObjectTypeGetPointerOrNull (void) THROWS_NONE
 Get pointer value. More...
 
TObjectTypeGetPointer (void) THROWS_NONE
 Get pointer,. More...
 
TObjectTypeGetObject (void)
 Get object. More...
 
TObjectTypeoperator* (void)
 Dereference operator returning object. More...
 
TObjectTypeoperator-> (void)
 Reference operator. More...
 
const TObjectTypeGetNonNullPointer (void) const
 Get pointer value and throw a null pointer exception if pointer is null – constant version. More...
 
const TObjectTypeGetPointerOrNull (void) const THROWS_NONE
 Get pointer value – constant version. More...
 
const TObjectTypeGetPointer (void) const THROWS_NONE
 Get pointer – constant version,. More...
 
const TObjectTypeGetObject (void) const
 Get object – constant version. More...
 
const TObjectTypeoperator* (void) const
 Dereference operator returning object – constant version. More...
 
const TObjectTypeoperator-> (void) const
 Reference operator – constant version. More...
 
 operator TObjectType * (void)
 Dereference operator returning pointer. More...
 
 operator const TObjectType * (void) const
 Dereference operator returning pointer – constant version. More...
 
TObjectTypeGetNonNullNCPointer (void) const
 Get pointer value and throw a null pointer exception if pointer is null. More...
 
TObjectTypeGetNCPointerOrNull (void) const THROWS_NONE
 Get pointer value. More...
 
TObjectTypeGetNCPointer (void) const THROWS_NONE
 Get pointer,. More...
 
TObjectTypeGetNCObject (void) const
 Get object. More...
 

Private Types

typedef CSrvRef< C, Locker > TThisType
 
typedef CRef< C, Locker > TParent
 
typedef TParent::TObjectType TObjectType
 
typedef TParent::locker_type locker_type
 

Additional Inherited Members

- Public Types inherited from CRef< C, Locker >
typedef C element_type
 Define alias element_type. More...
 
typedef element_type TObjectType
 Define alias TObjectType. More...
 
typedef Locker locker_type
 Define alias for locking type. More...
 
typedef CRef< C, Locker > TThisType
 Alias for this template type. More...
 
- Static Public Member Functions inherited from CRef< C, Locker >
static NCBI_NORETURN void ThrowNullPointerException (void)
 

Detailed Description

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
class CSrvRef< C, Locker >

Special variant of CRef that doesn't check for NULL when dereferencing.

Segmentation fault in such case is much better than thrown exception.

Definition at line 40 of file srv_ref.hpp.

Member Typedef Documentation

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
typedef TParent::locker_type CSrvRef< C, Locker >::locker_type
private

Definition at line 45 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
typedef TParent::TObjectType CSrvRef< C, Locker >::TObjectType
private

Definition at line 44 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
typedef CRef<C, Locker> CSrvRef< C, Locker >::TParent
private

Definition at line 43 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
typedef CSrvRef<C, Locker> CSrvRef< C, Locker >::TThisType
private

Definition at line 42 of file srv_ref.hpp.

Constructor & Destructor Documentation

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
CSrvRef< C, Locker >::CSrvRef ( void  )
inline

Definition at line 48 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
CSrvRef< C, Locker >::CSrvRef ( ENull  )
inline

Definition at line 50 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
CSrvRef< C, Locker >::CSrvRef ( TObjectType ptr)
inlineexplicit

Definition at line 53 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
CSrvRef< C, Locker >::CSrvRef ( TObjectType ptr,
const locker_type locker_value 
)
inline

Definition at line 56 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
CSrvRef< C, Locker >::CSrvRef ( const TThisType ref)
inline

Definition at line 59 of file srv_ref.hpp.

Member Function Documentation

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
TObjectType& CSrvRef< C, Locker >::operator* ( void  )
inline

Definition at line 79 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
const TObjectType& CSrvRef< C, Locker >::operator* ( void  ) const
inline

Definition at line 87 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
TObjectType* CSrvRef< C, Locker >::operator-> ( void  )
inline

Definition at line 83 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
const TObjectType* CSrvRef< C, Locker >::operator-> ( void  ) const
inline

Definition at line 91 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
TThisType& CSrvRef< C, Locker >::operator= ( const TThisType ref)
inline

Definition at line 63 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
TThisType& CSrvRef< C, Locker >::operator= ( TObjectType ptr)
inline

Definition at line 68 of file srv_ref.hpp.

template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
TThisType& CSrvRef< C, Locker >::operator= ( ENull  )
inline

Definition at line 73 of file srv_ref.hpp.


The documentation for this class was generated from the following file:
Modified on Tue Jan 16 15:39:09 2018 by modify_doxy.py rev. 546573