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 } // namespace RDM_CPP
50 
51 #include "psptypes.h"
52 
62 class RDM_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 
110  static TFS Alloc (RDM_TFS tfs
111  );
112 
128  static TFS Alloc (const RDM_CHAR_T *options,
129  size_t memSize = 0,
130  void *memBuf = NULL
131  );
132 
133 #if defined(RDM_UNICODE)
134  static TFS Alloc (
135  const wchar_t *options,
136  size_t memSize = 0,
137  void *memBuf = NULL
138  );
139 #endif
140 
149  Db AllocDatabase (
150  const RDM_CHAR_T *opts = NULL
151  );
152 
153 #if defined(RDM_UNICODE)
154  Db AllocDatabase (const wchar_t *opts);
155 #endif
156 
168  void SetOptions (
169  const RDM_CHAR_T *optString
171  );
172 #if defined(RDM_UNICODE)
173  void SetOptions (const wchar_t *optString);
174 #endif
175 
186  void SetOption (
187  const RDM_CHAR_T
188  *key,
189  const RDM_CHAR_T
190  *value
191  );
192 
193 #if defined(RDM_UNICODE)
194  void SetOption (const wchar_t *key, const wchar_t *value);
195 #endif
196 
209  void GetOptions (
210  RDM_CHAR_T *optionString,
211  size_t bytesIn,
212  size_t *bytesOut =
213  NULL
214  );
215 #if defined(RDM_UNICODE)
216  void GetOptions (wchar_t *optionString, size_t bytesIn, size_t *bytesOut = NULL);
217 #endif
218 
228  void GetOption (
229  const RDM_CHAR_T
230  *key,
231  RDM_CHAR_T *value,
232  size_t bytesIn,
233  size_t *bytesOut = NULL
234  );
235 
236 #if defined(RDM_UNICODE)
237  void GetOption (
238  const wchar_t *key,
239  wchar_t *value,
240  size_t bytesIn,
241  size_t *bytesOut = NULL);
242 #endif
243 
246  void DisableListener (void) const;
247 
250  void EnableListener () const;
251 
254  void GetEncrypt (RDM_ENCRYPT *enc) const;
255 
261  void GetConnections (
262  const RDM_CHAR_T *uri,
263  const RDM_CHAR_T *const **ppszUserIDs,
264  uint32_t *puUserCount
265  ) const;
266 
267 #if defined(RDM_UNICODE)
268  void GetConnections (
269  const wchar_t *uri,
270  const wchar_t *const **ppszUserIDs,
271  uint32_t *puUserCount) const;
272 #endif
273 
278  void GetVersion (
279  uint16_t *pMajorV,
280  uint16_t *pMinorV,
281  TFS_TYPE *pTfsType
282  ) const;
283 
284  RDM_ENCRYPT AllocEncrypt (const char *passcode);
285 
286 #if defined(RDM_UNICODE)
287  RDM_ENCRYPT AllocEncrypt (const wchar_t *passcode);
288 #endif
289 
294  RDM_TFS GetTFS () const;
295 
300  TFS_TYPE GetType (void) const;
301 
304  void KillRemoteConnection (
305  const RDM_CHAR_T *uri,
306  const RDM_CHAR_T *dbUserID
307  ) const;
308 
309 #if defined(RDM_UNICODE)
310  void KillRemoteConnection (const wchar_t *uri, const wchar_t *dbUserID) const;
311 #endif
312 
315  void KillAllRemoteConnections (
316  const RDM_CHAR_T *uri
317  ) const;
318 
319 #if defined(RDM_UNICODE)
320  void KillAllRemoteConnections (const wchar_t *uri) const;
321 #endif
322 
328  void Ping (const RDM_CHAR_T *uri
329  ) const;
330 
331 #if defined(RDM_UNICODE)
332  void Ping (const wchar_t *uri) const;
333 #endif
334 
339  void DropDatabase (
340  const RDM_CHAR_T *dbNameSpec
342  ) const;
343 
348  void GetMemoryUsage (
349  size_t &currUsage,
350  size_t &maxUsage
351  ) const;
352 
353 #if defined(RDM_UNICODE)
354  void DropDatabase (const wchar_t *dbNameSpec) const;
355 #endif
356 
361  RDM_BOOL_T GetCapability (
362  const RDM_CHAR_T *name
363  ) const;
364 
365 #if defined(RDM_UNICODE)
366  RDM_BOOL_T GetCapability (const wchar_t *name) const;
367 #endif
368 
382  TFS &Release (void);
383 
395  ~TFS ();
401  TFS (ITFS *itfs
402  )
403  throw ();
404 
410  TFS (const TFS &tfs
411  )
412  throw ();
413 
424  RDM_RETCODE GetReturnCode () const;
425 
426  protected:
428  ITFS *m_itfs;
429 
430  private:
431  const TFS *operator& (void) const;
432 
433  friend class Db;
434 };
435 
436 #endif
void _ValidateITFS() const
Validate the ITFS.
Definition: cpp-tfs.h:95
RDM_BOOL_T
Definition: psptypes.h:57
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:115
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:428
TFS_TYPE
Definition: rdmtfstypes.h:24
Header for the Transactional File Server (TFS) types.
struct RDM_ENCRYPT_S * RDM_ENCRYPT
Definition: psptypes.h:73