VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Attributes
makVrv::DtDisconnectable Class Reference

Functionality for disconnecting the various references that objects make to each other.

This class is a wrapper around a boost::signal2 which guarantees that each attached function is run once and only once.

Inheritance diagram for makVrv::DtDisconnectable:
Inheritance graph
[legend]

Public Member Functions

 DtDisconnectable ()
 
virtual ~DtDisconnectable ()
 
virtual
boost::signalslib::connection 
addDisconnectFunction (const boost::function< void()> &callback)
 
virtual bool callDisconnectFunctions ()
 

Protected Types

enum  State { NotUsed, InUse, Disconnected }
 
typedef tbb::spin_mutex Mutex
 

Protected Attributes

Mutex myMutex
 
State myDisconnectedState
 
boost::signalslib::signal< void()> myDisconnectSignal
 

Member Typedef Documentation

typedef tbb::spin_mutex makVrv::DtDisconnectable::Mutex
protected

Member Enumeration Documentation

Enumerator
NotUsed 
InUse 
Disconnected 

Constructor & Destructor Documentation

makVrv::DtDisconnectable::DtDisconnectable ( )

Default constructor.

virtual makVrv::DtDisconnectable::~DtDisconnectable ( )
virtual

Destructor. callDisconnectFunctions is not called in the destructor, it is up to to the caller to call it when it is necessary.

Member Function Documentation

virtual boost::signalslib::connection makVrv::DtDisconnectable::addDisconnectFunction ( const boost::function< void()> &  callback)
virtual

Add a function to be called when callDisconnectFunctions is called. If it has already been called, then the callback will be called during this call.

virtual bool makVrv::DtDisconnectable::callDisconnectFunctions ( )
virtual

Atomically call all the disconnect functions and mark this object as disconnected. If callDisconnectFunctions has already been called or is currently being called, this call will do nothing.

Member Data Documentation

Mutex makVrv::DtDisconnectable::myMutex
mutableprotected
State makVrv::DtDisconnectable::myDisconnectedState
protected
boost::signalslib::signal<void ()> makVrv::DtDisconnectable::myDisconnectSignal
protected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)