torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::SelfReferencing< _Tp > Class Template Reference

#include <SelfReferencing.hpp>

Public Types

typedef _Tp Type
 
typedef boost::shared_ptr< TypePointer
 
typedef boost::weak_ptr< TypeWeakPointer
 

Public Member Functions

void setWeakThis (const WeakPointer &inWeakThis)
 
Pointer getSharedThis () const
 
 ~SelfReferencing () throw ()
 

Protected Member Functions

 SelfReferencing ()
 

Private Attributes

WeakPointer mWeakThis
 

Detailed Description

template<typename _Tp>
class torc::generic::SelfReferencing< _Tp >

Definition at line 30 of file SelfReferencing.hpp.

Member Typedef Documentation

template<typename _Tp>
typedef boost::shared_ptr<Type> torc::generic::SelfReferencing< _Tp >::Pointer

Definition at line 36 of file SelfReferencing.hpp.

template<typename _Tp>
typedef _Tp torc::generic::SelfReferencing< _Tp >::Type

Definition at line 35 of file SelfReferencing.hpp.

template<typename _Tp>
typedef boost::weak_ptr<Type> torc::generic::SelfReferencing< _Tp >::WeakPointer

Definition at line 37 of file SelfReferencing.hpp.

Constructor & Destructor Documentation

template<typename _Type >
torc::generic::SelfReferencing< _Type >::SelfReferencing ( )
protected

Definition at line 70 of file SelfReferencing.hpp.

template<typename _Type >
torc::generic::SelfReferencing< _Type >::~SelfReferencing ( )
throw (
)

Definition at line 72 of file SelfReferencing.hpp.

72 {}

Member Function Documentation

template<typename _Type >
SelfReferencing< _Type >::Pointer torc::generic::SelfReferencing< _Type >::getSharedThis ( ) const
inline

Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.

Returns
A shared pointer to this object

Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.

Parameters
[out]ptrSet to a shared pointer to this object

Definition at line 94 of file SelfReferencing.hpp.

94  {
95  return mWeakThis.lock();
96 }
template<typename _Tp>
void torc::generic::SelfReferencing< _Type >::setWeakThis ( const WeakPointer inWeakThis)
inline

Set a weak pointer to this object. This will be used later to get a shared pointer to this object from within other member methods if required. This should be called by the Factory creating the object.

Parameters
[in]weakThisA weak pointer to this object

Definition at line 81 of file SelfReferencing.hpp.

82  {
83  mWeakThis = inWeakThis;
84 }

Field Documentation

template<typename _Tp>
WeakPointer torc::generic::SelfReferencing< _Tp >::mWeakThis
private

Definition at line 67 of file SelfReferencing.hpp.


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