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) || defined(RDM_WINCE)
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 #if defined(RDM_WINCE)
52 #pragma warning (push)
53 #pragma warning (disable:4275)
54 #endif
55 
56 #include "psptypes.h"
57 
67 class PUBLIC_CLASS RDM_CPP::TFS
68 {
69 public:
70 /* Handle more than one reference to the underlying database */
71 
83  TFS (void) throw ();
84 
96  TFS& operator = (const TFS& tfs) throw ();
97 
99  //void _ValidateITFS () const;
100  void _ValidateITFS() const
101  {
102  if (m_itfs == NULL)
103  {
104  throw(rdm_exception(eINVTFSID));
105  }
106  }
107 
108 
116  static TFS Alloc (
117  RDM_TFS tfs
118  );
119 
135  static TFS Alloc (
136  const RDM_CHAR_T *options
137  );
138 
139 #if !defined(RDM_NO_UNICODE)
140  static TFS Alloc (
141  const wchar_t *options
142  );
143 #endif
144 
153  Db AllocDatabase (
154  const RDM_CHAR_T *opts = NULL
155  );
156 
157 #if !defined(RDM_NO_UNICODE)
158  Db AllocDatabase (
159  const wchar_t *opts
160  );
161 #endif
162 
174  void SetOptions (
175  const RDM_CHAR_T *optString
176  );
177 #if !defined(RDM_NO_UNICODE)
178  void SetOptions (
179  const wchar_t *optString
180  );
181 #endif
182 
193  void SetOption (
194  const RDM_CHAR_T *key,
195  const RDM_CHAR_T *value
196  );
197 
198 #if !defined(RDM_NO_UNICODE)
199  void SetOption (
200  const wchar_t *key,
201  const wchar_t *value
202  );
203 #endif
204 
217  void GetOptions (
218  RDM_CHAR_T *optionString,
219  size_t bytesIn,
220  size_t *bytesOut = NULL
221  );
222 #if !defined(RDM_NO_UNICODE)
223  void GetOptions (
224  wchar_t *optionString,
225  size_t bytesIn,
226  size_t *bytesOut = NULL
227  );
228 #endif
229 
239  void GetOption (
240  const RDM_CHAR_T *key,
241  RDM_CHAR_T *value,
242  size_t bytesIn,
243  size_t *bytesOut = NULL
244  );
245 
246 #if !defined(RDM_NO_UNICODE)
247  void GetOption (
248  const wchar_t *key,
249  wchar_t *value,
250  size_t bytesIn,
251  size_t *bytesOut = NULL
252  );
253 #endif
254 
257  void DisableListener (
258  void
259  ) const;
260 
263  void EnableListener (
264  ) const;
265 
268  void GetEncrypt (
269  RDM_ENCRYPT *enc
270  ) const;
271 
277  void GetConnections (
278  const RDM_CHAR_T *uri,
279  const RDM_CHAR_T *const **ppszUserIDs,
280  uint32_t *puUserCount
281  ) const;
282 
283 #if !defined (RDM_NO_UNICODE)
284  void GetConnections (
285  const wchar_t *uri,
286  const wchar_t *const **ppszUserIDs,
287  uint32_t *puUserCount
288  ) const;
289 #endif
290 
295  void GetVersion (
296  uint16_t *pMajorV,
297  uint16_t *pMinorV,
298  TFS_TYPE *pTfsType
299  ) const;
300 
301  RDM_ENCRYPT AllocEncrypt(
302  const char *passcode
303  );
304 
305 #if !defined(RDM_NO_UNICODE)
306  RDM_ENCRYPT AllocEncrypt(
307  const wchar_t *passcode
308  );
309 #endif
310 
315  RDM_TFS GetTFS () const;
316 
321  TFS_TYPE GetType (void) const;
322 
325  void KillRemoteConnection (
326  const RDM_CHAR_T *uri,
327  const RDM_CHAR_T *dbUserID
328  ) const;
329 
330 #if !defined (RDM_NO_UNICODE)
331  void KillRemoteConnection (
332  const wchar_t *uri,
333  const wchar_t *dbUserID
334  ) const;
335 #endif
336 
339  void KillAllRemoteConnections (
340  const RDM_CHAR_T *uri
341  ) const;
342 
343 #if !defined (RDM_NO_UNICODE)
344  void KillAllRemoteConnections (
345  const wchar_t *uri
346  ) const;
347 #endif
348 
354  void Ping (
355  const RDM_CHAR_T *uri
356  ) const;
357 
358 #if !defined (RDM_NO_UNICODE)
359  void Ping (
360  const wchar_t *uri
361  ) const;
362 #endif
363 
368  void DropDatabase (
369  const RDM_CHAR_T *dbNameSpec
370  ) const;
371 
372 #if !defined (RDM_NO_UNICODE)
373  void DropDatabase (
374  const wchar_t *dbNameSpec
375  ) const;
376 #endif
377 
391  TFS& Release (void);
392 
404  ~TFS ();
410  TFS (
411  ITFS *itfs
412  ) throw ();
413 
419  TFS (
420  const TFS& tfs
421  ) throw ();
422 
433  RDM_RETCODE GetReturnCode() const;
434 
435 protected:
437  ITFS *m_itfs;
438 
439 private:
440  const TFS* operator & (void) const;
441 
442  friend class Db;
443 };
444 
445 #if defined(RDM_WINCE)
446 #pragma warning (pop)
447 #endif
448 #endif
void _ValidateITFS() const
Validate the ITFS.
Definition: cpp-tfs.h:100
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:48
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:67
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:437
TFS_TYPE
Definition: rdmtfstypes.h:24
Header for the Transactional File Server (TFS) types.
struct RDM_ENCRYPT_S * RDM_ENCRYPT
Definition: psptypes.h:77