|
Teamcenter C++ API Reference
2312
|
Manages a lock on an object. More...
#include <AcquireLock.hxx>
Public Member Functions | |
| AcquireLock () | |
| AcquireLock (tag_t object) | |
| void | forget () |
| bool | isLocked () const |
| bool | isLockedByMe () const |
| void | lock (tag_t object) |
| virtual void | unlock () |
| virtual | ~AcquireLock () |
Protected Attributes | |
| bool | m_bLockedPrior |
| tag_t | m_lockedObj |
Private Member Functions | |
| AcquireLock (const AcquireLock &other) | |
| AcquireLock & | operator= (const AcquireLock &other) |
Manages a lock on an object.
It obtains a write lock on an object.
This is required if the caller wish to save a modified version of the object or delete it.
It is a convenient C++ class wrapper to AOM_refresh.
Use this class where you would use AOM_refresh( tag, TRUE ).
It will ensure that the object will be unlocked when you go out of scope. So you do not have to remember to do an unlock on the object.
Use as follows:
Definition at line 48 of file AcquireLock.hxx.
| Teamcenter::AcquireLock::AcquireLock | ( | ) |
Constructor that does not lock any object.
The lock() method needs to be invoked to complete the lock on a given object.
| Teamcenter::AcquireLock::AcquireLock | ( | tag_t | object | ) |
Constructs the instance and locks the object.
| object | (I) The object to lock. |
|
virtual |
Destructor.
Unlocks any locked object.
|
private |
Copy constructor.
| void Teamcenter::AcquireLock::forget | ( | ) |
Skips the refresh of the objects, which means that the changes to the in-memory representation of the object will remain when the AcquireLock instance goes out of the C++ scope.
| bool Teamcenter::AcquireLock::isLocked | ( | ) | const |
Returns the locking state of the underlying POM object.
| bool Teamcenter::AcquireLock::isLockedByMe | ( | ) | const |
Determines if the underlying POM object has been locked by this instance.
| void Teamcenter::AcquireLock::lock | ( | tag_t | object | ) |
Locks the object.
| object | (I) The object to lock. |
|
private |
Assignment operator.
|
virtual |
Unlocks any locked object.
|
protected |
The status of the object lock prior to being locked by this instance.
Definition at line 116 of file AcquireLock.hxx.
|
protected |
The locked object
Definition at line 113 of file AcquireLock.hxx.