NCBI C++ ToolKit
interfaces.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: interfaces.cpp 79243 2017-08-24 15:46:37Z satskyse $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Vladimir Soussov
27  *
28  * File Description: Data Server public interfaces
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
36 
37 
39 
40 
41 ////////////////////////////////////////////////////////////////////////////
43 : m_ChildObj(NULL)
44 {
45 }
46 
48 {
49 }
50 
51 
52 ///////////////////////////////////////////////////////////////////////////////
54 : m_Other(other)
55 {
56  m_Other.SetChildObj(*this);
57 }
58 
60 {
62 }
63 
64 
66 {
67  return m_Other.GetDriverName();
68 }
69 
71 {
72  return m_Other.GetProtocolVersion();
73 }
74 
76 {
77  return m_Other.GetEncoding();
78 }
79 
81 {
82  return m_Other.GetServerName();
83 }
84 
86 {
87  return m_Other.GetDatabaseName();
88 }
89 
91 {
92  return m_Other.GetUserName();
93 }
94 
96 {
97  return m_Other.GetPassword();
98 }
99 
102 {
103  return m_Other.GetServerType();
104 }
105 
107 {
108  return m_Other.GetHost();
109 }
110 
112 {
113  return m_Other.GetPort();
114 }
115 
118 {
119  return m_Other.GetConnValidator();
120 }
121 
123  const
124 {
126 }
127 
128 string CDBConnParamsDelegate::GetParam(const string& key) const
129 {
130  return m_Other.GetParam(key);
131 }
132 
133 
134 ////////////////////////////////////////////////////////////////////////////
136 {
137  return;
138 }
139 
140 
141 ////////////////////////////////////////////////////////////////////////////
142 // CDBParams::
143 //
144 
146 {
147 }
148 
149 
151  const CDBParamVariant& param,
152  CDB_Object* value,
153  bool out_param
154  )
155 {
156  DATABASE_DRIVER_ERROR( "Methods Bind and Set of class CDBParams are not implemented yet.", 122002 );
157  return *this;
158 }
159 
160 
162  const CDBParamVariant& param,
163  CDB_Object* value,
164  bool out_param
165  )
166 {
167  DATABASE_DRIVER_ERROR( "Methods Bind and Set of class CDBParams are not implemented yet.", 122002 );
168  return *this;
169 }
170 
171 
172 ////////////////////////////////////////////////////////////////////////////
173 // I_BaseCmd::
174 // CParametrizedStmt::
175 // I_LangCmd::
176 // I_RPCCmd::
177 // I_BCPInCmd::
178 // I_CursorCmd::
179 // I_SendDataCmd::
180 //
181 
183 {
184 }
185 
187 {
188  return;
189 }
190 
192 {
193 }
194 
196 {
197 }
198 
200 {
201 }
202 
204 {
205 }
206 
208 {
209 }
210 
212 {
213  return;
214 }
215 
217 {
218 }
219 
221 {
222  return;
223 }
224 
226 {
227  return;
228 }
229 
231 {
232  return;
233 }
234 
236 {
237 }
238 
240 {
241  return;
242 }
243 
244 bool I_CursorCmd::UpdateTextImage(unsigned int item_num,
245  CDB_Stream& data,
246  bool log_it)
247 {
248  return UpdateBlob(item_num, data, log_it);
249 }
250 
252 {
253 }
254 
256 {
257  return;
258 }
259 
260 
261 ////////////////////////////////////////////////////////////////////////////
262 // I_Result::
263 //
264 
266 {
267 }
268 
270 {
271  return;
272 }
273 
275 {
276  return GetBlobDescriptor();
277 }
278 
279 
280 ////////////////////////////////////////////////////////////////////////////
281 // I_DriverContext::
282 //
283 
285 {
286  return;
287 }
288 
290 {
291  return;
292 }
293 
296  const string& srv_name,
297  const string& user_name,
298  const string& passwd,
300  bool reusable,
301  const string& pool_name)
302 {
303  const CDBDefaultConnParams def_params(
304  srv_name,
305  user_name,
306  passwd,
307  mode,
308  reusable,
309  pool_name
310  );
311  const CCPPToolkitConnParams params(def_params);
312 
313  return MakeConnection(params);
314 }
315 
318  const string& srv_name,
319  const string& user_name,
320  const string& passwd,
321  IConnValidator& validator,
323  bool reusable,
324  const string& pool_name)
325 {
326  CDBDefaultConnParams def_params(
327  srv_name,
328  user_name,
329  passwd,
330  mode,
331  reusable,
332  pool_name
333  );
334  def_params.SetConnValidator(CRef<IConnValidator>(&validator));
335 
336  const CCPPToolkitConnParams params(def_params);
337 
338 
339  return MakeConnection(params);
340 }
341 
343 {
344  return kEmptyStr;
345 }
346 
347 ////////////////////////////////////////////////////////////////////////////
349 {
350 }
351 
353 {
354  return;
355 }
356 
357 
359 
360 
CDBConnParams::
Definition: interfaces.hpp:258
void SetConnValidator(const CRef< IConnValidator > &validator)
CDBParams.
Definition: interfaces.hpp:154
I_BlobDescriptor::
Definition: interfaces.hpp:369
char data[12]
Definition: iconv.c:80
#define NULL
Definition: ncbistd.hpp:225
#define DATABASE_DRIVER_ERROR(message, err_code)
Definition: exception.hpp:740
virtual EEncoding GetEncoding(void) const =0
virtual ~I_BCPInCmd(void)
Definition: interfaces.cpp:230
virtual EServerType GetServerType(void) const
Definition: interfaces.cpp:101
virtual Uint4 GetProtocolVersion(void) const
Definition: interfaces.cpp:70
virtual const impl::CDBHandlerStack & GetOpeningMsgHandlers(void) const =0
virtual CDBParams & Set(const CDBParamVariant &param, CDB_Object *value, bool out_param=false)
This method stores copy of data.
Definition: interfaces.cpp:161
virtual ~I_Result(void)
Definition: interfaces.cpp:269
virtual ~I_BaseCmd(void)
Definition: interfaces.cpp:186
virtual string GetDatabaseName(void) const
Definition: interfaces.cpp:85
virtual string GetParam(const string &key) const
Parameters, which are not listed above explicitly, should be retrieved via SetParam() method.
Definition: interfaces.cpp:128
I_CursorCmd(void)
Definition: interfaces.cpp:235
I_RPCCmd(void)
Definition: interfaces.cpp:216
CDB_Connection * Connect(const string &srv_name, const string &user_name, const string &passwd, TConnectionMode mode, bool reusable=false, const string &pool_name=kEmptyStr)
Create new connection to specified server (or service) within this context.
Definition: interfaces.cpp:295
virtual EServerType GetServerType(void) const =0
CDBConnParams(void)
Definition: interfaces.cpp:42
virtual string GetPassword(void) const =0
virtual ~CParamRecordset(void)
Definition: interfaces.cpp:195
virtual Uint4 GetProtocolVersion(void) const =0
void SetChildObj(const CDBConnParams &child_obj) const
Definition: interfaces.hpp:293
virtual ~CParamStmt(void)
Definition: interfaces.cpp:203
virtual EEncoding GetEncoding(void) const
Definition: interfaces.cpp:75
I_SendDataCmd(void)
Definition: interfaces.cpp:251
virtual string GetDriverName(void) const
Definition: interfaces.cpp:342
const CDBConnParams & m_Other
Definition: interfaces.hpp:357
virtual ~I_DriverContext(void)
Definition: interfaces.cpp:289
I_BCPInCmd(void)
Definition: interfaces.cpp:225
I_Result(void)
Definition: interfaces.cpp:265
virtual Uint4 GetHost(void) const =0
virtual string GetServerName(void) const =0
virtual ~CDBConnParamsDelegate(void)
Definition: interfaces.cpp:59
I_Connection(void)
Definition: interfaces.cpp:348
virtual CDBParams & Bind(const CDBParamVariant &param, CDB_Object *value, bool out_param=false)
This method stores pointer to data.
Definition: interfaces.cpp:150
virtual CRef< IConnValidator > GetConnValidator(void) const
Definition: interfaces.cpp:117
virtual ~CDBConnParams(void)
Definition: interfaces.cpp:47
I_BaseCmd(void)
Definition: interfaces.cpp:182
virtual Uint4 GetHost(void) const
Definition: interfaces.cpp:106
virtual ~I_SendDataCmd(void)
Definition: interfaces.cpp:255
virtual string GetDriverName(void) const =0
virtual Uint2 GetPort(void) const =0
virtual Uint2 GetPort(void) const
Definition: interfaces.cpp:111
virtual CDB_Connection * MakeConnection(const CDBConnParams &params)=0
Create connection object using Load Balancer / connection factory.
virtual string GetDriverName(void) const
Definition: interfaces.cpp:65
virtual ~I_Connection(void)
Definition: interfaces.cpp:352
virtual I_BlobDescriptor * GetBlobDescriptor(void)=0
Get a descriptor for a BLOB column (for SendData).
virtual ~I_CursorCmd(void)
Definition: interfaces.cpp:239
CParamStmt(void)
Definition: interfaces.cpp:199
virtual string GetDatabaseName(void) const =0
virtual const impl::CDBHandlerStack & GetOpeningMsgHandlers(void) const
Definition: interfaces.cpp:122
virtual CRef< IConnValidator > GetConnValidator(void) const =0
friend class CDBConnParamsDelegate
Definition: interfaces.hpp:321
void ReleaseChildObj(void) const
Definition: interfaces.hpp:298
virtual ~I_BlobDescriptor(void)
Definition: interfaces.cpp:135
CDB_Connection * ConnectValidated(const string &srv_name, const string &user_name, const string &passwd, IConnValidator &validator, TConnectionMode mode=0, bool reusable=false, const string &pool_name=kEmptyStr)
Create new connection to specified server (within this context).
Definition: interfaces.cpp:317
bool UpdateTextImage(unsigned int item_num, CDB_Stream &data, bool log_it=true)
Definition: interfaces.cpp:244
I_LangCmd(void)
Definition: interfaces.cpp:207
virtual string GetPassword(void) const
Definition: interfaces.cpp:95
virtual bool UpdateBlob(unsigned int item_num, CDB_Stream &data, bool log_it=true)=0
virtual ~CDBParams(void)
Definition: interfaces.cpp:145
virtual ~I_LangCmd(void)
Definition: interfaces.cpp:211
virtual string GetUserName(void) const
Definition: interfaces.cpp:90
virtual string GetUserName(void) const =0
virtual string GetParam(const string &key) const =0
Parameters, which are not listed above explicitly, should be retrieved via SetParam() method.
virtual string GetServerName(void) const
Definition: interfaces.cpp:80
virtual ~I_RPCCmd(void)
Definition: interfaces.cpp:220
I_BlobDescriptor * GetImageOrTextDescriptor(void)
Definition: interfaces.cpp:274
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
uint16_t Uint2
2-byte (16-bit) unsigned integer
Definition: ncbitype.h:101
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
EEncoding
Definition: ncbistr.hpp:199
#define kEmptyStr
Definition: ncbistr.hpp:123
mdb_mode_t mode
Definition: lmdb++.h:38
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon Apr 22 04:05:58 2024 by modify_doxy.py rev. 669887