![]() |
VR-Link API Documentation for HLA Evolved
|
A scoped sequence lock. More...
Inheritance diagram for DtScopedSequenceLock:
Collaboration diagram for DtScopedSequenceLock:Public Types | |
| typedef void(* | LockFunction )(void *) |
| Define Lock function. More... | |
Public Member Functions | |
| DtScopedSequenceLock (const DtScopedSequenceLock &orig) | |
| Public copy constructor, is called on return from the implementation/ This method creates the lock. More... | |
| virtual | ~DtScopedSequenceLock () |
| Destructor, unlocks the object. More... | |
Protected Member Functions | |
| DtScopedSequenceLock (void *object, LockFunction lockCB, LockFunction unlockCB) | |
| Protected constructor is called by private implementation of lock. More... | |
Protected Attributes | |
| LockFunction | myLockCallback |
| The acquire lock callback. More... | |
| LockFunction | myUnlockCallback |
| The release lock callback. More... | |
| void * | myObject |
| The object to pass to the callbacks. More... | |
A scoped sequence lock.
A scoped sequence lock, maintains a lock on an DtThreadSafe object until it goes out of scope. DtScopedSequenceLock is return by value from a DtThreadSafe object and should not be copied or maintained. A sequence lock is required when multiple operations are performed that need to be atomic.
A DtScopedSequenceLock requires several additional locks and thus is more expensive than normal ThreadSafe calls. However each additional call in a sequence may be slightly cheaper due to it already having the lock. It is faster to copy the DtThreadSafe to a local object and do the operations then reassign it, however this may not always be possible. The exception to this is if copying is overly expensive.
It is not possible to create a DtScopedSequenceLock as the implementation of its lock and unlock callbacks are defined by the DtThreadSafe object
| typedef void(* DtScopedSequenceLock::LockFunction)(void *) |
Define Lock function.
| DtScopedSequenceLock::DtScopedSequenceLock | ( | const DtScopedSequenceLock & | orig | ) |
Public copy constructor, is called on return from the implementation/ This method creates the lock.
|
virtual |
Destructor, unlocks the object.
|
protected |
Protected constructor is called by private implementation of lock.
|
protected |
The acquire lock callback.
|
protected |
The object to pass to the callbacks.
|
protected |
The release lock callback.