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 | Static Public Attributes | Protected Attributes
makVrf::DtGateLock Class Reference

If you need access to data in the main thread outside of the advance frame, use this lock (with the lock flag as true) to prevent the advancing of the frame in the network thread. Note that if the network thread is in the middile of advancing the frame when this lock is attemped to be used, then, the thread will hang until the lock is available.

Public Member Functions

 DtGateLock ()
 
virtual ~DtGateLock ()
 
bool wait (std::chrono::milliseconds timeout)
 
void allowAdvance ()
 
void disallowAdvance ()
 
bool lock (double timeout=-1)
 
void unlock ()
 

Static Public Attributes

static boost::signals2::signal
< void()> 
signal_gateLocked
 
static boost::signals2::signal
< void()> 
signal_gateUnlocked
 

Protected Attributes

tbb::mutex::scoped_lock myLock
 
bool myLocked = false
 

Constructor & Destructor Documentation

makVrf::DtGateLock::DtGateLock ( )

If lock is true will try and lock the mutex to allow for exclusive access to the gate. If try is true will try to get the lock. If the lock cannot be retrieved then isLocked is false and you know the data access is not safe.

virtual makVrf::DtGateLock::~DtGateLock ( )
virtual

Member Function Documentation

bool makVrf::DtGateLock::wait ( std::chrono::milliseconds  timeout)

Wait for the condition to trigger from another thread based on the amount of time. Will return true if condition is met or false if the timeout is reached.

void makVrf::DtGateLock::allowAdvance ( )

Notify that the condition has been met.

void makVrf::DtGateLock::disallowAdvance ( )

Reset condition so it cannot be met.

bool makVrf::DtGateLock::lock ( double  timeout = -1)

If timeout is -1 means wait forever. Timeout is in seconds.

void makVrf::DtGateLock::unlock ( )

Member Data Documentation

boost::signals2::signal<void ()> makVrf::DtGateLock::signal_gateLocked
static
boost::signals2::signal<void ()> makVrf::DtGateLock::signal_gateUnlocked
static
tbb::mutex::scoped_lock makVrf::DtGateLock::myLock
protected
bool makVrf::DtGateLock::myLocked = false
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)