Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a2016848
Kaydet (Commit)
a2016848
authored
Ara 16, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove comment noise
Change-Id: I7794e40e07520c1e504b1167aa64cf24819271f2
üst
4ac13fb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
37 deletions
+4
-37
transactionguard.hxx
framework/inc/threadhelp/transactionguard.hxx
+4
-37
No files found.
framework/inc/threadhelp/transactionguard.hxx
Dosyayı görüntüle @
a2016848
...
...
@@ -25,59 +25,26 @@
namespace
framework
{
/*-************************************************************************************************************
@short implement a guard to support non breakable transactions
@descr If you wish to support non breakable method calls without locking any mutex, rw-lock or
something like that - you should use this guard implementation.
Initialize it at first in your method and don't release it till end of your function!
Your "transaction" is registered in ctor and automatically released in dtor.
Use set/get of working mode to enable/disable further transactions.
It's possible too, to enable automatically throwing of some exceptions for illegal
transaction requests ... e.g. interface call for already disposed objects.
@attention To prevent us against wrong using, the default ctor, copy ctor and the =operator are marked private!
@devstatus draft
*//*-*************************************************************************************************************/
class
TransactionGuard
:
private
boost
::
noncopyable
{
// public methods
public
:
/*-****************************************************************************************************
@short ctors
@descr Use these ctor methods to initialize the guard right.
Given reference must be valid - otherwise crashes could occur!
@attention It's not necessary to lock any mutex here! Because a ctor should not be called
from different threads at the same time ... this class use no refcount mechanism!
@param "rManager" reference to transaction manager for using to register a request
@param "eMode" enable/disable throwing of exceptions for rejected calls
*//*-*****************************************************************************************************/
inline
TransactionGuard
(
TransactionManager
&
rManager
,
EExceptionMode
eMode
)
:
m_pManager
(
&
rManager
)
{
m_pManager
->
registerTransaction
(
eMode
);
}
/*-************************************************************************************************************
@short dtor
@descr We must release the transaction manager and can forget his pointer.
*//*-*************************************************************************************************************/
inline
~
TransactionGuard
()
{
m_pManager
->
unregisterTransaction
();
}
private
:
TransactionManager
*
m_pManager
;
};
TransactionManager
*
m_pManager
;
/// pointer to safed transaction manager
};
// class TransactionGuard
}
// namespace framework
}
#endif
// INCLUDED_FRAMEWORK_INC_THREADHELP_TRANSACTIONGUARD_HXX
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment