CFx SDK Documentation
2022 SP0
Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
z
Variables
a
k
o
s
v
w
Typedefs
_
a
b
c
d
e
f
h
i
l
m
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
a
b
c
d
e
h
i
k
l
m
o
p
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Related Functions
b
c
d
e
f
g
h
i
m
o
p
r
s
v
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
u
v
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
i
m
o
p
s
t
Enumerator
a
c
d
e
g
j
k
o
s
t
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
SDK
CFx
dd_inc
DbSafeTransaction.h
Go to the documentation of this file.
1
// Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3
// All rights reserved.
4
//
5
// This software and its documentation and related materials are owned by
6
// the Alliance. The software may only be incorporated into application
7
// programs owned by members of the Alliance, subject to a signed
8
// Membership Agreement and Supplemental Software License Agreement with the
9
// Alliance. The structure and organization of this software are the valuable
10
// trade secrets of the Alliance and its suppliers. The software is also
11
// protected by copyright law and international treaty provisions. Application
12
// programs incorporating this software must include the following statement
13
// with their copyright notices:
14
//
15
// This application incorporates Teigha(R) software pursuant to a license
16
// agreement with Open Design Alliance.
17
// Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18
// All rights reserved.
19
//
20
// By use of this software, its documentation or related materials, you
21
// acknowledge and accept the above terms.
23
24
25
26
27
#ifndef _ODDBSAFETRANSACTION_INCLUDED_
28
#define _ODDBSAFETRANSACTION_INCLUDED_
29
30
#include "
TD_PackPush.h
"
31
32
#include "
RxObject.h
"
33
#include "
StaticRxObject.h
"
34
#include "
DbTransactionReactor.h
"
35
36
46
class
OdDbSafeTransaction
:
private
OdStaticRxObject
<OdDbTransactionReactor>
47
{
48
int
m_nCounter;
49
OdDbDatabase
* m_pTrackedDB;
50
51
OdDbSafeTransaction
& operator = (
const
OdDbSafeTransaction
& other);
52
58
void
transactionStarted(
OdDbDatabase
* ) { ++m_nCounter; }
67
void
transactionEnded(
OdDbDatabase
* pTrackedDb)
68
{
69
if
(!--m_nCounter)
70
pTrackedDb->
removeTransactionReactor
(
this
);
71
}
80
void
transactionAborted(
OdDbDatabase
* pTrackedDb)
81
{
82
if
(!--m_nCounter)
83
pTrackedDb->
removeTransactionReactor
(
this
);
84
}
85
public
:
91
OdDbSafeTransaction
(
OdDbDatabase
* pTrackedDb)
92
: m_nCounter(0), m_pTrackedDB(pTrackedDb)
93
{
94
if
(m_pTrackedDB)
95
{
96
m_pTrackedDB->
addTransactionReactor
(
this
);
97
}
98
}
99
105
~OdDbSafeTransaction
()
106
{
107
m_pTrackedDB->
removeTransactionReactor
(
this
);
108
while
(m_nCounter--)
109
m_pTrackedDB->
abortTransaction
();
110
}
111
};
112
113
#include "
TD_PackPop.h
"
114
115
#endif
// _ODDBSAFETRANSACTION_INCLUDED_
116
DbTransactionReactor.h
RxObject.h
StaticRxObject.h
TD_PackPop.h
TD_PackPush.h
OdDbDatabase
Definition:
DbDatabase.h:421
OdDbDatabase::abortTransaction
virtual void abortTransaction()
OdDbDatabase::addTransactionReactor
virtual void addTransactionReactor(OdDbTransactionReactor *reactor)
OdDbDatabase::removeTransactionReactor
virtual void removeTransactionReactor(OdDbTransactionReactor *reactor)
OdDbSafeTransaction
Definition:
DbSafeTransaction.h:47
OdDbSafeTransaction::~OdDbSafeTransaction
~OdDbSafeTransaction()
Definition:
DbSafeTransaction.h:105
OdDbSafeTransaction::OdDbSafeTransaction
OdDbSafeTransaction(OdDbDatabase *pTrackedDb)
Definition:
DbSafeTransaction.h:91
OdStaticRxObject
Definition:
StaticRxObject.h:57
Generated on Fri Jan 22 2021 18:01:32