sttcl  v0.9c
STTCL C++ template state machine framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sttcl::RefCountPtr< T, MutexType > Class Template Reference

#include <RefCountPtr.h>

Inheritance diagram for sttcl::RefCountPtr< T, MutexType >:
Collaboration diagram for sttcl::RefCountPtr< T, MutexType >:

List of all members.

Public Member Functions

 RefCountPtr ()
 RefCountPtr (T *argPointee, typename sttcl::internal::RefCountPtrBase< MutexType >::ReleaseFunc argReleaseFunc=RefCountPtr< T, MutexType >::release)
template<typename U >
 RefCountPtr (U *argPointee, typename sttcl::internal::RefCountPtrBase< MutexType >::ReleaseFunc argReleaseFunc=RefCountPtr< T, MutexType >::release)
 RefCountPtr (const RefCountPtr< T, MutexType > &rhs)
template<typename U >
 RefCountPtr (const RefCountPtr< U, MutexType > &rhs)
 ~RefCountPtr ()
RefCountPtroperator= (const RefCountPtr< T, MutexType > &rhs)
template<typename U >
RefCountPtroperator= (const RefCountPtr< U, MutexType > &rhs)
T * get () const
 operator T * () const
T * operator-> ()
T & operator* ()
- Public Member Functions inherited from sttcl::internal::RefCountPtrBase< MutexType >
 ~RefCountPtrBase ()

Additional Inherited Members

- Public Types inherited from sttcl::internal::RefCountPtrBase< MutexType >
typedef void(* ReleaseFunc )(void *ptr)
- Protected Member Functions inherited from sttcl::internal::RefCountPtrBase< MutexType >
 RefCountPtrBase ()
 RefCountPtrBase (void *argPointee, ReleaseFunc argReleaseFunc)
 RefCountPtrBase (const RefCountPtrBase &rhs)
RefCountPtrBaseoperator= (const RefCountPtrBase< MutexType > &rhs)
void incrementRefCount ()
void decrementRefCount ()
- Protected Attributes inherited from sttcl::internal::RefCountPtrBase< MutexType >
PtrRefptrRef

Detailed Description

template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
class sttcl::RefCountPtr< T, MutexType >

Represents a smart pointer class for STTCL dispatched event arguments. The implementation provides a simple reference counting smart pointer. There's also a specialization for T as void, but it will never be really used with void pointees, since void event argument types won't be instantiated in the event dispatch interfaces.

Template Parameters:
TThe event arguments type.
MutexTypeThe mutex type used to guarantee thread safety of the RefCountPtr instances.

Constructor & Destructor Documentation

template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
sttcl::RefCountPtr< T, MutexType >::RefCountPtr ( )
inline

Default constructor for class RefCountPtr.

template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
sttcl::RefCountPtr< T, MutexType >::RefCountPtr ( T *  argPointee,
typename sttcl::internal::RefCountPtrBase< MutexType >::ReleaseFunc  argReleaseFunc = RefCountPtr<T,MutexType>::release 
)
inline

Constructor for class RefCountPtr.

Parameters:
argPointeeThe pointee to manage.
argReleaseFuncAn optional alternate release function for the pointee.
template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
template<typename U >
sttcl::RefCountPtr< T, MutexType >::RefCountPtr ( U *  argPointee,
typename sttcl::internal::RefCountPtrBase< MutexType >::ReleaseFunc  argReleaseFunc = RefCountPtr<T,MutexType>::release 
)
inline

Constructor for class RefCountPtr.

Parameters:
argPointeeThe pointee to manage.
argReleaseFuncAn optional alternate release function for the pointee.
template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
sttcl::RefCountPtr< T, MutexType >::RefCountPtr ( const RefCountPtr< T, MutexType > &  rhs)
inline

Copy constructor for class RefCountPtr. This operation will increment the reference count of the copied pointee.

Parameters:
rhsThe other instance to copy from.
template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
template<typename U >
sttcl::RefCountPtr< T, MutexType >::RefCountPtr ( const RefCountPtr< U, MutexType > &  rhs)
inline

Copy constructor for class RefCountPtr. This operation will increment the reference count of the copied pointee.

Parameters:
rhsThe other instance to copy from.
template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
sttcl::RefCountPtr< T, MutexType >::~RefCountPtr ( )
inline

Destructor for class RefCountPtr. This operation will decrement the reference count of the managed pointee.


Member Function Documentation

template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
T* sttcl::RefCountPtr< T, MutexType >::get ( ) const
inline

Gets the pointee.

Returns:
The pointee.
template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
sttcl::RefCountPtr< T, MutexType >::operator T * ( ) const
inline

Gets the pointee.

template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
T& sttcl::RefCountPtr< T, MutexType >::operator* ( )
inline

Star dereference operator.

Returns:
A reference to the pointee if available.
template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
T* sttcl::RefCountPtr< T, MutexType >::operator-> ( )
inline

Arrow derefernce operator.

Returns:
The pointee if available.
template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
RefCountPtr& sttcl::RefCountPtr< T, MutexType >::operator= ( const RefCountPtr< T, MutexType > &  rhs)
inline

Assignment operator. This operation will increment the reference count of the copied pointee.

Parameters:
rhsThe other instance to copy from.
Returns:
A reference to this instance.
template<typename T, class MutexType = internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL>>
template<typename U >
RefCountPtr& sttcl::RefCountPtr< T, MutexType >::operator= ( const RefCountPtr< U, MutexType > &  rhs)
inline

Assignment operator. This operation will increment the reference count of the copied pointee.

Parameters:
rhsThe other instance to copy from.
Returns:
A reference to this instance.

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