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

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

`#include <StrongPtr.h>`

List of all members.

## Public Member Functions
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)
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.

## 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

## 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>

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.

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.

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.

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

- StrongPtr.h