Loki::StrongPtr< T, Strong, OwnershipPolicy, ConversionPolicy, CheckingPolicy, ResetPolicy, DeletePolicy, ConstnessPolicy > Class Template Reference
[Smart pointers]

#include <StrongPtr.h>

List of all members.

Public Types

typedef OwnershipPolicy OP
typedef T * StoredType
typedef T * PointerType
typedef T & ReferenceType
typedef ConstnessPolicy< T
>::Type * 
ConstPointerType
typedef ConstnessPolicy< T
>::Type & 
ConstReferenceType

Public Member Functions

 StrongPtr (void)
 StrongPtr (ExplicitArg p)
 StrongPtr (ImplicitArg p)
 StrongPtr (const StrongPtr &rhs)
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
 StrongPtr (const StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs)
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
 StrongPtr (StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs)
 StrongPtr (RefToValue< StrongPtr > rhs)
 operator RefToValue (void)
StrongPtroperator= (const StrongPtr &rhs)
StrongPtroperator= (T *p)
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
StrongPtroperator= (const StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs)
bool IsStrong (void) const
void Swap (StrongPtr &rhs)
 ~StrongPtr ()
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
bool Merge (StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs)
void Lock (void)
void Unlock (void)
PointerType operator-> ()
ConstPointerType operator-> () const
ReferenceType operator * ()
ConstReferenceType operator * () const
template<class T1>
bool Equals (const T1 *p) const
 Helper function which can be called to avoid exposing GetPointer function.
template<class T1>
bool LessThan (const T1 *p) const
 Helper function which can be called to avoid exposing GetPointer function.
template<class T1>
bool GreaterThan (const T1 *p) const
 Helper function which can be called to avoid exposing GetPointer function.
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
bool operator== (const StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs) const
 Equality comparison operator is templated to handle ambiguity.
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
bool operator!= (const StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs) const
 Inequality comparison operator is templated to handle ambiguity.
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
bool operator< (const StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs) const
 Less-than comparison operator is templated to handle ambiguity.
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
bool operator> (const StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs) const
 Greater-than comparison operator is templated to handle ambiguity.
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
bool operator<= (const StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs) const
 Less-than-or-equal-to operator is templated to handle ambiguity.
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
bool operator>= (const StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &rhs) const
 Greater-than-or-equal-to operator is templated to handle ambiguity.
bool operator! () const
 operator unspecified_boolean_type () const
 operator AutomaticConversionResult () const

Protected Member Functions

PointerType GetPointer (void)
ConstPointerType GetPointer (void) const


Detailed Description

template<typename T, bool Strong = true, class OwnershipPolicy = Loki::TwoRefCounts, class ConversionPolicy = Loki::DisallowConversion, template< class > class CheckingPolicy = Loki::AssertCheck, template< class > class ResetPolicy = Loki::CantResetWithStrong, template< class > class DeletePolicy = Loki::DeleteSingle, template< class > class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS>
class Loki::StrongPtr< T, Strong, OwnershipPolicy, ConversionPolicy, CheckingPolicy, ResetPolicy, DeletePolicy, ConstnessPolicy >

Parameters:
Strong default = true,
OwnershipPolicy default = TwoRefCounts,
ConversionPolicy default = DisallowConversion,
CheckingPolicy default = AssertCheck,
ResetPolicy default = CantResetWithStrong,
DeletePolicy default = DeleteSingle
ConstnessPolicy default = LOKI_DEFAULT_CONSTNESS

Definition at line 845 of file StrongPtr.h.


Member Function Documentation

template<typename T, bool Strong = true, class OwnershipPolicy = Loki::TwoRefCounts, class ConversionPolicy = Loki::DisallowConversion, template< class > class CheckingPolicy = Loki::AssertCheck, template< class > class ResetPolicy = Loki::CantResetWithStrong, template< class > class DeletePolicy = Loki::DeleteSingle, template< class > class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS>
template<typename T1, bool S1, class OP1, class CP1, template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
bool Loki::StrongPtr< T, Strong, OwnershipPolicy, ConversionPolicy, CheckingPolicy, ResetPolicy, DeletePolicy, ConstnessPolicy >::Merge ( StrongPtr< T1, S1, OP1, CP1, KP1, RP1, DP1, CNP1 > &  rhs  )  [inline]

Merges ownership of two StrongPtr's that point to same shared object but are not copointers. Requires Merge function in OwnershipPolicy.

Returns:
True for success, false if not pointer to same object.

Definition at line 1098 of file StrongPtr.h.

template<typename T, bool Strong = true, class OwnershipPolicy = Loki::TwoRefCounts, class ConversionPolicy = Loki::DisallowConversion, template< class > class CheckingPolicy = Loki::AssertCheck, template< class > class ResetPolicy = Loki::CantResetWithStrong, template< class > class DeletePolicy = Loki::DeleteSingle, template< class > class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS>
void Loki::StrongPtr< T, Strong, OwnershipPolicy, ConversionPolicy, CheckingPolicy, ResetPolicy, DeletePolicy, ConstnessPolicy >::Lock ( void   )  [inline]

Locks StrongPtr so other threads can't affect pointer. Requires the OwnershipPolicy to have Lock function.

Definition at line 1110 of file StrongPtr.h.

template<typename T, bool Strong = true, class OwnershipPolicy = Loki::TwoRefCounts, class ConversionPolicy = Loki::DisallowConversion, template< class > class CheckingPolicy = Loki::AssertCheck, template< class > class ResetPolicy = Loki::CantResetWithStrong, template< class > class DeletePolicy = Loki::DeleteSingle, template< class > class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS>
void Loki::StrongPtr< T, Strong, OwnershipPolicy, ConversionPolicy, CheckingPolicy, ResetPolicy, DeletePolicy, ConstnessPolicy >::Unlock ( void   )  [inline]

Unlocks StrongPtr so other threads can affect pointer. Requires the OwnershipPolicy to have Unlock function.

Definition at line 1118 of file StrongPtr.h.


The documentation for this class was generated from the following file:
Generated on Sun Feb 25 16:52:49 2007 for Loki by  doxygen 1.5.1-p1