CFx SDK Documentation
2020SP3
SDK
CFx
dd_inc
DbTransactionWrapper.h
Go to the documentation of this file.
1
#ifndef _ODDBTRANSACTIONWRAPPER_H_INCLUDED_
2
#define _ODDBTRANSACTIONWRAPPER_H_INCLUDED_
3
4
struct
OdDbTransactionWrapper
5
{
6
OdDbDatabasePtr
m_pDb
;
7
OdDbTransactionWrapper
(
OdDbDatabase
* db)
8
{
9
if
(db)
10
{
11
m_pDb
= db;
12
db->
startTransaction
();
13
}
14
}
15
void
endTransaction
()
16
{
17
if
(!
m_pDb
.isNull())
18
{
19
m_pDb
->
endTransaction
();
20
m_pDb
= 0;
21
}
22
}
23
~OdDbTransactionWrapper
()
24
{
25
if
(!
m_pDb
.isNull())
26
m_pDb
->
abortTransaction
();
27
}
28
};
29
30
#endif
OdDbDatabase::abortTransaction
virtual void abortTransaction()
OdDbDatabase
Definition:
DbDatabase.h:421
OdDbDatabase::startTransaction
virtual void startTransaction()
OdDbTransactionWrapper::endTransaction
void endTransaction()
Definition:
DbTransactionWrapper.h:15
OdSmartPtr< OdDbDatabase >
OdDbTransactionWrapper::m_pDb
OdDbDatabasePtr m_pDb
Definition:
DbTransactionWrapper.h:6
OdDbTransactionWrapper::~OdDbTransactionWrapper
~OdDbTransactionWrapper()
Definition:
DbTransactionWrapper.h:23
OdDbTransactionWrapper
Definition:
DbTransactionWrapper.h:5
OdDbDatabase::endTransaction
virtual void endTransaction()
OdDbTransactionWrapper::OdDbTransactionWrapper
OdDbTransactionWrapper(OdDbDatabase *db)
Definition:
DbTransactionWrapper.h:7
Generated on Mon Oct 12 2020 11:49:31