LibreOffice Module framework (master) 1
|
implements a guard, which can use the interface <type scope="css::document">XActionLockable</type>. More...
#include <actionlockguard.hxx>
Public Member Functions | |
ActionLockGuard () | |
default ctor to initialize a "non working guard". More... | |
~ActionLockGuard () | |
release this guard instance and make sure, that no lock will exist afterwards on the internal wrapped resource. More... | |
bool | setResource (const css::uno::Reference< css::document::XActionLockable > &xLock) |
set a new resource for locking at this guard. More... | |
void | freeResource () |
set a new resource for locking at this guard. More... | |
void | unlock () |
unlock the internal wrapped resource, if it's not already done. More... | |
Private Attributes | |
std::mutex | m_mutex |
css::uno::Reference< css::document::XActionLockable > | m_xActionLock |
points to the object, which can be locked from outside. More... | |
bool | m_bActionLocked |
knows if a lock exists on the internal lock object forced by this guard instance. More... | |
implements a guard, which can use the interface <type scope="css::document">XActionLockable</type>.
@descr This guard should be used to be sure, that any lock will be released. Otherwise the locked document can hinder the office on shutdown!
Definition at line 33 of file actionlockguard.hxx.
|
inline |
default ctor to initialize a "non working guard".
@descr That can be useful in cases, where no resource still exists, but will be available next time. Then this guard can be used in a mode "use guard for more than one resources".
Definition at line 58 of file actionlockguard.hxx.
|
inline |
release this guard instance and make sure, that no lock will exist afterwards on the internal wrapped resource.
Definition at line 66 of file actionlockguard.hxx.
References unlock().
|
inline |
set a new resource for locking at this guard.
@descr This call will fail, if an internal resource already exists and is currently locked.
xLock | points to the outside resource, which should be locked. |
Definition at line 107 of file actionlockguard.hxx.
References m_bActionLocked, m_mutex, and m_xActionLock.
Referenced by framework::LoadEnv::impl_reactForLoadingState().
|
inline |
set a new resource for locking at this guard.
@descr This call will fail, if an internal resource already exists and is currently locked.
xLock | points to the outside resource, which should be locked. |
Definition at line 82 of file actionlockguard.hxx.
References m_bActionLocked, m_mutex, and m_xActionLock.
Referenced by framework::LoadEnv::impl_loadContent(), and framework::LoadEnv::impl_searchRecycleTarget().
|
inline |
unlock the internal wrapped resource, if it's not already done.
Definition at line 126 of file actionlockguard.hxx.
References m_bActionLocked, m_mutex, and m_xActionLock.
Referenced by ~ActionLockGuard().
|
private |
knows if a lock exists on the internal lock object forced by this guard instance.
Definition at line 46 of file actionlockguard.hxx.
Referenced by freeResource(), setResource(), and unlock().
|
private |
Definition at line 39 of file actionlockguard.hxx.
Referenced by freeResource(), setResource(), and unlock().
|
private |
points to the object, which can be locked from outside.
Definition at line 42 of file actionlockguard.hxx.
Referenced by freeResource(), setResource(), and unlock().