/*-************************************************************************************************************ @descrDescribedifferentstatesofafeatureoffollowingimplementation. Duringlifetimeofanobjectdifferentworkingstatesoccur: initialization-working-closing-closed Ifyouwishtoimplementthreadsafeclassesyoushouldusethisfeaturetoprotect yourcodeagainstcallsatwrongtime.e.g.youarenotfullinitializedbutsomewhere callaninterfacemethod(initializephasemeansstartuptimefromcreatingobjecttill callingspecifiedfirstmethode.g.XInitialization::initialize()!)thenyoushouldrefuse thiscall.Thesameforclosing/disposingtheobject!
*//*-*************************************************************************************************************/ enum EWorkingMode
{
E_INIT , // We stand in an init method -> some calls are accepted - some ones are rejected
E_WORK , // Object is ready for working -> all calls are accepted
E_BEFORECLOSE, // We stand in a close method -> some calls are accepted - some ones are rejected
E_CLOSE // Object is dead! -> all calls are rejected!
};
@devstatusdraft
*//*-*************************************************************************************************************/ class TransactionManager
{
mutable std::mutex m_aAccessLock; /// regulate access on internal member of this instance
Gate m_aBarrier; /// used to block transactions requests during change or work mode
EWorkingMode m_eWorkingMode; /// current working mode of object which use this manager (used to reject calls at wrong time)
sal_Int32 m_nTransactionCount; /// every transaction request is registered by this counter
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.