torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::physical::Progenitor< T > Class Template Reference

Concept for any object that may have children. More...

#include <Progenitor.hpp>

Public Member Functions

const WeakPtrTypegetSelfWeakPtr (void) const
 Returns a weak pointer to this object. More...
 

Protected Types

typedef boost::weak_ptr< T > WeakPtrType
 Weak pointer of our own type. More...
 
typedef boost::shared_ptr< T > SharedPtrType
 Shared pointer of our own type. More...
 

Protected Member Functions

void setSelfWeakPtr (WeakPtrType inSelfPtr)
 Sets the weak pointer to this object. More...
 

Protected Attributes

WeakPtrType mSelfWeakPtr
 Weak pointer this object. More...
 

Friends

class Factory
 The Factory class has direct access to our internals. More...
 
class torc::physical::physical::ProgenitorUnitTest
 Our unit test has direct access to our internals. More...
 
class torc::physical::physical::ProgenyUnitTest
 The Progeny<T> unit test has direct access to our internals. More...
 

Detailed Description

template<class T>
class torc::physical::Progenitor< T >

Concept for any object that may have children.

Forward declaration of Progenitor template (a parent of the Renamable object).

Todo:
Rename Progenitor to SelfReferent, since some childless objects need to refer to themselves. c.f. InstancePin.

Definition at line 36 of file Progenitor.hpp.

Member Typedef Documentation

template<class T>
typedef boost::shared_ptr<T> torc::physical::Progenitor< T >::SharedPtrType
protected

Shared pointer of our own type.

Definition at line 52 of file Progenitor.hpp.

template<class T>
typedef boost::weak_ptr<T> torc::physical::Progenitor< T >::WeakPtrType
protected

Weak pointer of our own type.

Definition at line 50 of file Progenitor.hpp.

Member Function Documentation

template<class T>
const WeakPtrType& torc::physical::Progenitor< T >::getSelfWeakPtr ( void  ) const
inline

Returns a weak pointer to this object.

Definition at line 68 of file Progenitor.hpp.

68 { return mSelfWeakPtr; }
WeakPtrType mSelfWeakPtr
Weak pointer this object.
Definition: Progenitor.hpp:57
template<class T>
void torc::physical::Progenitor< T >::setSelfWeakPtr ( WeakPtrType  inSelfPtr)
inlineprotected

Sets the weak pointer to this object.

Definition at line 59 of file Progenitor.hpp.

59 { mSelfWeakPtr = inSelfPtr; }
WeakPtrType mSelfWeakPtr
Weak pointer this object.
Definition: Progenitor.hpp:57

Friends And Related Function Documentation

template<class T>
friend class Factory
friend

The Factory class has direct access to our internals.

The Factory class needs access so that it can set this object's self weak pointer after constructing it. This object can in turn share its weak pointer with its children, allowing them to link back.

Definition at line 42 of file Progenitor.hpp.

template<class T>
friend class torc::physical::physical::ProgenitorUnitTest
friend

Our unit test has direct access to our internals.

Definition at line 44 of file Progenitor.hpp.

template<class T>
friend class torc::physical::physical::ProgenyUnitTest
friend

The Progeny<T> unit test has direct access to our internals.

Definition at line 46 of file Progenitor.hpp.

Field Documentation

template<class T>
WeakPtrType torc::physical::Progenitor< T >::mSelfWeakPtr
protected

Weak pointer this object.

This weak pointer is kept here to be passed along to our children, allowing them to point back to us without the strong dependency of a shared pointer.

Definition at line 57 of file Progenitor.hpp.


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