CFx SDK Documentation
2023 SP0
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
OdBaseObjectPtr::isNull
bool isNull() const
Definition:
BaseObjectPtr.h:70
OdDbDatabase
Definition:
DbDatabase.h:448
OdDbDatabase::abortTransaction
virtual void abortTransaction()
OdDbDatabase::startTransaction
virtual void startTransaction()
OdDbDatabase::endTransaction
virtual void endTransaction()
OdSmartPtr< OdDbDatabase >
OdDbTransactionWrapper
Definition:
DbTransactionWrapper.h:5
OdDbTransactionWrapper::OdDbTransactionWrapper
OdDbTransactionWrapper(OdDbDatabase *db)
Definition:
DbTransactionWrapper.h:7
OdDbTransactionWrapper::endTransaction
void endTransaction()
Definition:
DbTransactionWrapper.h:15
OdDbTransactionWrapper::m_pDb
OdDbDatabasePtr m_pDb
Definition:
DbTransactionWrapper.h:6
OdDbTransactionWrapper::~OdDbTransactionWrapper
~OdDbTransactionWrapper()
Definition:
DbTransactionWrapper.h:23
Generated on Thu Feb 24 2022 15:09:28