Products Support Documentation Download
cpp-tfs.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  *
3  * Raima Database Manager
4  *
5  * Copyright (c) 2011 Raima Inc., All rights reserved.
6  *
7  * Use of this software, whether in source code format, or in executable,
8  * binary object code form, is governed by the Birdstep LICENSE which
9  * is fully described in the LICENSE.TXT file, included within this
10  * distribution of files.
11  *
12  * ----------------------------------------------------------------------------
13  */
14 
19 #if !defined(CPP_TFS_H)
20 #define CPP_TFS_H
21 
22 #if !defined(__cplusplus)
23 #error cpp-tfs.h is only for C++ applications. Do not include it in C applications
24 #endif
25 
26 #include "cpp-exception.h"
27 
28 #if defined(RDM_WINDOWS)
29 #pragma warning(disable: 4290)
30 #endif
31 
32 #include "rdmtfstypes.h"
33 
44 namespace RDM_CPP {
45  class Cursor;
46  class Db;
47  class ITFS;
48  class TFS;
49 }
50 
51 #include "psptypes.h"
52 
62 class PUBLIC_CLASS RDM_CPP::TFS
63 {
64 public:
65 /* Handle more than one reference to the underlying database */
66 
78  TFS (void) throw ();
79 
91  TFS& operator = (const TFS& tfs) throw ();
92 
94  //void _ValidateITFS () const;
95  void _ValidateITFS() const
96  {
97  if (m_itfs == NULL)
98  {
99  throw(rdm_exception(eINVTFSID));
100  }
101  }
102 
103 
111  static TFS Alloc (
112  RDM_TFS tfs
113  );
114 
130  static TFS Alloc (
131  const RDM_CHAR_T *options
132  );
133 
134 #if !defined(RDM_NO_UNICODE)
135  static TFS Alloc (
136  const wchar_t *options
137  );
138 #endif
139 
148  Db AllocDatabase (
149  const RDM_CHAR_T *opts = NULL
150  );
151 
152 #if !defined(RDM_NO_UNICODE)
153  Db AllocDatabase (
154  const wchar_t *opts
155  );
156 #endif
157 
169  void SetOptions (
170  const RDM_CHAR_T *optString
171  );
172 #if !defined(RDM_NO_UNICODE)
173  void SetOptions (
174  const wchar_t *optString
175  );
176 #endif
177 
188  void SetOption (
189  const RDM_CHAR_T *key,
190  const RDM_CHAR_T *value
191  );
192 
193 #if !defined(RDM_NO_UNICODE)
194  void SetOption (
195  const wchar_t *key,
196  const wchar_t *value
197  );
198 #endif
199 
212  void GetOptions (
213  RDM_CHAR_T *optionString,
214  size_t bytesIn,
215  size_t *bytesOut = NULL
216  );
217 #if !defined(RDM_NO_UNICODE)
218  void GetOptions (
219  wchar_t *optionString,
220  size_t bytesIn,
221  size_t *bytesOut = NULL
222  );
223 #endif
224 
234  void GetOption (
235  const RDM_CHAR_T *key,
236  RDM_CHAR_T *value,
237  size_t bytesIn,
238  size_t *bytesOut = NULL
239  );
240 
241 #if !defined(RDM_NO_UNICODE)
242  void GetOption (
243  const wchar_t *key,
244  wchar_t *value,
245  size_t bytesIn,
246  size_t *bytesOut = NULL
247  );
248 #endif
249 
252  void DisableListener (
253  void
254  ) const;
255 
258  void EnableListener (
259  ) const;
260 
263  void GetEncrypt (
264  RDM_ENCRYPT *enc
265  ) const;
266 
272  void GetConnections (
273  const RDM_CHAR_T *uri,
274  const RDM_CHAR_T *const **ppszUserIDs,
275  uint32_t *puUserCount
276  ) const;
277 
278 #if !defined (RDM_NO_UNICODE)
279  void GetConnections (
280  const wchar_t *uri,
281  const wchar_t *const **ppszUserIDs,
282  uint32_t *puUserCount
283  ) const;
284 #endif
285 
290  void GetVersion (
291  uint16_t *pMajorV,
292  uint16_t *pMinorV,
293  TFS_TYPE *pTfsType
294  ) const;
295 
296  RDM_ENCRYPT AllocEncrypt(
297  const char *passcode
298  );
299 
300 #if !defined(RDM_NO_UNICODE)
301  RDM_ENCRYPT AllocEncrypt(
302  const wchar_t *passcode
303  );
304 #endif
305 
310  RDM_TFS GetTFS () const;
311 
316  TFS_TYPE GetType (void) const;
317 
320  void KillRemoteConnection (
321  const RDM_CHAR_T *uri,
322  const RDM_CHAR_T *dbUserID
323  ) const;
324 
325 #if !defined (RDM_NO_UNICODE)
326  void KillRemoteConnection (
327  const wchar_t *uri,
328  const wchar_t *dbUserID
329  ) const;
330 #endif
331 
334  void KillAllRemoteConnections (
335  const RDM_CHAR_T *uri
336  ) const;
337 
338 #if !defined (RDM_NO_UNICODE)
339  void KillAllRemoteConnections (
340  const wchar_t *uri
341  ) const;
342 #endif
343 
349  void Ping (
350  const RDM_CHAR_T *uri
351  ) const;
352 
353 #if !defined (RDM_NO_UNICODE)
354  void Ping (
355  const wchar_t *uri
356  ) const;
357 #endif
358 
363  void DropDatabase (
364  const RDM_CHAR_T *dbNameSpec
365  ) const;
366 
367 #if !defined (RDM_NO_UNICODE)
368  void DropDatabase (
369  const wchar_t *dbNameSpec
370  ) const;
371 #endif
372 
386  TFS& Release (void);
387 
399  ~TFS ();
405  TFS (
406  ITFS *itfs
407  ) throw ();
408 
414  TFS (
415  const TFS& tfs
416  ) throw ();
417 
428  RDM_RETCODE GetReturnCode() const;
429 
430 protected:
432  ITFS *m_itfs;
433 
434 private:
435  const TFS* operator & (void) const;
436 
437  friend class Db;
438 };
439 
440 #endif
void _ValidateITFS() const
Validate the ITFS.
Definition: cpp-tfs.h:95
Header for the Platform Support Package - Platform dependent types.
the rdm_exception class This class implements the exception thrown by the RDM CPP API ...
Definition: cpp-exception.h:45
struct RDM_TFS_S * RDM_TFS
RDM TFS Handle.
Definition: rdmtfstypes.h:21
The Db base class.
Definition: cpp-db.h:52
#define RDM_CHAR_T
Definition: psptypes.h:119
The TFS class This class provides the TFS implementation.
Definition: cpp-tfs.h:62
RDM_RETCODE
RDM status and error return codes.
The RDM C++ Namespace.
Definition: cpp-cursor.h:27
Header for C++ exceptions.
ITFS * m_itfs
Internal ITFS pointer.
Definition: cpp-tfs.h:432
TFS_TYPE
Definition: rdmtfstypes.h:24
Header for the Transactional File Server (TFS) types.
struct RDM_ENCRYPT_S * RDM_ENCRYPT
Definition: psptypes.h:77