forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSessionImpl.cpp
More file actions
executable file
·170 lines (116 loc) · 2.42 KB
/
SessionImpl.cpp
File metadata and controls
executable file
·170 lines (116 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
//
// SessionImpl.cpp
//
// $Id: //poco/Main/Data/testsuite/src/SessionImpl.cpp#4 $
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "SessionImpl.h"
#include "TestStatementImpl.h"
#include "Connector.h"
namespace Poco {
namespace Data {
namespace Test {
SessionImpl::SessionImpl(const std::string& init, std::size_t timeout):
Poco::Data::AbstractSessionImpl<SessionImpl>(init, timeout),
_f(false),
_connected(true)
{
addFeature("f1", &SessionImpl::setF, &SessionImpl::getF);
addFeature("f2", 0, &SessionImpl::getF);
addFeature("f3", &SessionImpl::setF, 0);
addFeature("connected", &SessionImpl::setConnected, &SessionImpl::getConnected);
addProperty("p1", &SessionImpl::setP, &SessionImpl::getP);
addProperty("p2", 0, &SessionImpl::getP);
addProperty("p3", &SessionImpl::setP, &SessionImpl::getP);
}
SessionImpl::~SessionImpl()
{
}
void SessionImpl::open(const std::string& connectionString)
{
_connected = true;
}
void SessionImpl::close()
{
_connected = false;
}
bool SessionImpl::isConnected()
{
return _connected;
}
void SessionImpl::setConnectionTimeout(std::size_t timeout)
{
}
std::size_t SessionImpl::getConnectionTimeout()
{
return 0;
}
Poco::Data::StatementImpl* SessionImpl::createStatementImpl()
{
return new TestStatementImpl(*this);
}
void SessionImpl::begin()
{
}
void SessionImpl::commit()
{
}
void SessionImpl::rollback()
{
}
bool SessionImpl::canTransact()
{
return false;
}
bool SessionImpl::isTransaction()
{
return false;
}
void SessionImpl::setTransactionIsolation(Poco::UInt32)
{
}
Poco::UInt32 SessionImpl::getTransactionIsolation()
{
return 0;
}
bool SessionImpl::hasTransactionIsolation(Poco::UInt32)
{
return false;
}
bool SessionImpl::isTransactionIsolation(Poco::UInt32)
{
return false;
}
const std::string& SessionImpl::connectorName() const
{
return Connector::KEY;
}
bool SessionImpl::getConnected(const std::string& name)
{
return _connected;
}
void SessionImpl::setConnected(const std::string& name, bool value)
{
_connected = value;
}
void SessionImpl::setF(const std::string& name, bool value)
{
_f = value;
}
bool SessionImpl::getF(const std::string& name)
{
return _f;
}
void SessionImpl::setP(const std::string& name, const Poco::Any& value)
{
_p = value;
}
Poco::Any SessionImpl::getP(const std::string& name)
{
return _p;
}
} } } // namespace Poco::Data::Test