Objects can be locked. Objects of this class represent an object locked by the communicator, with possibly also locked objects like embedded objects.
More...
#include <GloLockManager.h>
|
| LockedObject (const ObjID &rLockObjekt) |
|
| ~LockedObject () |
|
void | deleteCommunicator (Communicator *pCommunicator) |
|
std::size_t | getNumCommunicators () |
|
ObjID | getObjID () const |
|
bool | hasAnyOtherCompetingProtection (Communicator *pCommunicator, EnLockMode eLockMode) const |
|
bool | isPossible (Communicator *pCommunicator, bool bRead, bool bWrite, bool bDelete) const |
|
int | lockObject (Communicator *pCommunicator, std::stack< ObjID > *pDependObjIdStack, EnLockMode eLockMode, EnDeepMode eDeepMode, bool bSimulate=false) |
|
int | unlockObject (Communicator *pCommunicator, std::stack< ObjID > *&prDependObjIdStack, EnLockMode eLockMode, EnDeepMode eDeepMode, bool bSimulate=false) |
|
Objects can be locked. Objects of this class represent an object locked by the communicator, with possibly also locked objects like embedded objects.
- Copyright
- © 2010 Helmut Jakoby
- Author
- Helmut Jakoby
◆ LockedObject() [1/3]
glo::LockManager::LockedObject::LockedObject |
( |
| ) |
|
|
protected |
The default constructor is not available.
◆ LockedObject() [2/3]
glo::LockManager::LockedObject::LockedObject |
( |
const ObjID & | rLockObjekt | ) |
|
Constructor with parameter passing.
- Parameters
-
[in] | rLockObjekt | The object ID of the object to be locked. |
◆ ~LockedObject()
glo::LockManager::LockedObject::~LockedObject |
( |
| ) |
|
◆ LockedObject() [3/3]
glo::LockManager::LockedObject::LockedObject |
( |
const LockedObject & | | ) |
|
|
private |
The copy constructor is not available.
◆ deleteCommunicator()
void glo::LockManager::LockedObject::deleteCommunicator |
( |
Communicator * | pCommunicator | ) |
|
Removes all locks of the passed communicator.
- Parameters
-
[in] | pCommunicator | The communicator. |
◆ getNumCommunicators()
std::size_t glo::LockManager::LockedObject::getNumCommunicators |
( |
| ) |
|
Returns the number of communicators who have locked the object with the object ID from LockedObject::m_LockObjectID.
- Returns
- The number of locking communicators.
◆ getObjID()
ObjID glo::LockManager::LockedObject::getObjID |
( |
| ) |
const |
Returns the object ID of the locked object.
- Returns
- The object ID.
◆ hasAnyOtherCompetingProtection()
bool glo::LockManager::LockedObject::hasAnyOtherCompetingProtection |
( |
Communicator * | pCommunicator, |
|
|
EnLockMode | eLockMode ) const |
Checks whether another communicator of the object with object ID from LockedObject::m_LockObjektID is competing for the passed communicator.
- Parameters
-
[in] | pCommunicator | The communicator. |
[in] | eLockMode | The lock mode to be checked for the communicator. |
- Returns
- If true, there is a competing lock. The object with the object ID from LockedObject :: m_LockObjektID cannot be locked by the transferred communicator with the transferred lock mode.
◆ isPossible()
bool glo::LockManager::LockedObject::isPossible |
( |
Communicator * | pCommunicator, |
|
|
bool | bRead, |
|
|
bool | bWrite, |
|
|
bool | bDelete ) const |
Checks whether the passed communicator is allowed to read, write and/or delete the object with the object ID from vLockedObject::m_LockObjectID.
- Parameters
-
[in] | pCommunicator | The communicator. |
[in] | bRead | If true, a check is made for 'read'. |
[in] | bWrite | If true, a check is made for 'write'. |
[in] | bDelete | If true, a check is made for 'delete'. |
- Returns
- If true, the modes set to true for the communicator are possible.
◆ lockObject()
int glo::LockManager::LockedObject::lockObject |
( |
Communicator * | pCommunicator, |
|
|
std::stack< ObjID > * | pDependObjIdStack, |
|
|
EnLockMode | eLockMode, |
|
|
EnDeepMode | eDeepMode, |
|
|
bool | bSimulate = false ) |
Locks the object with the object ID from LockedObject::m_LockObjectID for a communicator.
- Parameters
-
[in] | pCommunicator | The blocking communicator. |
[in] | pDependObjIdStack | The stack of object IDs of the objects to be locked. |
[in] | eLockMode | The lock mode. |
[in] | eDeepMode | The lock depth mode. |
[in] | bSimulate | If true, only simulation is carried out, i.e. no value is set, but a valid result or error is returned. |
- Returns
- A return <0 indicates an error.
◆ operator=()
The assignment operator is not available.
◆ setLockCount()
int glo::LockManager::LockedObject::setLockCount |
( |
std::list< DependentObjsWithDeepMode * > & | rLockCountList, |
|
|
std::stack< ObjID > *& | prUnlockDependObjIdStack, |
|
|
std::stack< ObjID > * | pLockDependObjIdStack, |
|
|
EnDeepMode | eDeepMode, |
|
|
bool | bSimulate = false ) |
|
private |
Help method for LockedObject::setLocks (...).
- Parameters
-
[in,out] | rLockCountList | The list for each lock mode from CommunicatorRightsRestrictions |
[in,out] | prUnlockDependObjIdStack | The stack of object IDs of the objects to be shared. |
[in] | pLockDependObjIdStack | The stack of object IDs of the objects to be locked. |
[in] | eDeepMode | The lock depth mode. |
[in] | bSimulate | If true, only simulation is performed, i.e. no value is set, but a valid result or an error is returned. |
- Returns
- A return value < 0 indicates an error.
◆ setLocks()
Locks the object with object ID from LockedObject::m_LockObjektID for a CommunicatorRightsRestrictions or releases it.
- Parameters
-
[in] | pItem | The CommunicatorRightsRestrictions in which the lock or release is entered. |
[in] | eLockMode | The lock mode. |
[in] | eDeepMode | The lock depth mode. |
[in,out] | prUnlockDependObjIdStack | The stack of object IDs of the objects to be shared. |
[in] | pLockDependObjIdStack | The stack of object IDs of the objects to be locked. |
[in] | bSimulate | If true, only simulation is performed, i.e. no value is set, but a valid result or an error is returned. |
- Returns
- A return value < 0 indicates an error.
◆ unlockObject()
int glo::LockManager::LockedObject::unlockObject |
( |
Communicator * | pCommunicator, |
|
|
std::stack< ObjID > *& | prDependObjIdStack, |
|
|
EnLockMode | eLockMode, |
|
|
EnDeepMode | eDeepMode, |
|
|
bool | bSimulate = false ) |
Releases the object locked by a communicator with the object ID from LockedObject::m_LockObjectID.
- Parameters
-
[in] | pCommunicator | The releasing communicator. |
[in,out] | prDependObjIdStack | The stack of object IDs of the objects to be released. |
[in] | eLockMode | The original lock mode which should be released. |
[in] | eDeepMode | The lock depth mode of the original lock mode that is to be canceled. |
[in] | bSimulate | If true, only simulation is carried out, ie no value is set, but a result or error is returned. |
- Returns
- A return <0 indicates an error.
◆ LockManager
◆ m_CommunicatorMap
◆ m_LockObjektID
ObjID glo::LockManager::LockedObject::m_LockObjektID |
|
protected |
The object ID of the locked object.
The documentation for this class was generated from the following file: