VR-Forces 4.6.1 Class Documentation
 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. More...

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

Public Member Functions

 DtDisconnectable ()
 Default constructor.
virtual ~DtDisconnectable ()
 Destructor.
virtual boost::signals2::connection addDisconnectFunction (const boost::function< void()> &callback)
 Add a function to be called when callDisconnectFunctions is called.
virtual bool callDisconnectFunctions ()
 Atomically call all the disconnect functions and mark this object as disconnected.

Protected Types

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

Protected Attributes

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

Detailed Description

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.

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::signals2::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::signals2::signal<void ()> makVrv::DtDisconnectable::myDisconnectSignal
protected

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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)