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 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  );
130 
131 #if defined(RDM_UNICODE)
132  static TFS Alloc (const wchar_t *options);
133 #endif
134 
143  Db AllocDatabase (
144  const RDM_CHAR_T *opts = NULL
145  );
146 
147 #if defined(RDM_UNICODE)
148  Db AllocDatabase (const wchar_t *opts);
149 #endif
150 
162  void SetOptions (
163  const RDM_CHAR_T *optString
165  );
166 #if defined(RDM_UNICODE)
167  void SetOptions (const wchar_t *optString);
168 #endif
169 
180  void SetOption (
181  const RDM_CHAR_T
182  *key,
183  const RDM_CHAR_T
184  *value
185  );
186 
187 #if defined(RDM_UNICODE)
188  void SetOption (const wchar_t *key, const wchar_t *value);
189 #endif
190 
203  void GetOptions (
204  RDM_CHAR_T *optionString,
205  size_t bytesIn,
206  size_t *bytesOut =
207  NULL
208  );
209 #if defined(RDM_UNICODE)
210  void GetOptions (wchar_t *optionString, size_t bytesIn, size_t *bytesOut = NULL);
211 #endif
212 
222  void GetOption (
223  const RDM_CHAR_T
224  *key,
225  RDM_CHAR_T *value,
226  size_t bytesIn,
227  size_t *bytesOut = NULL
228  );
229 
230 #if defined(RDM_UNICODE)
231  void GetOption (
232  const wchar_t *key,
233  wchar_t *value,
234  size_t bytesIn,
235  size_t *bytesOut = NULL);
236 #endif
237 
240  void DisableListener (void) const;
241 
244  void EnableListener () const;
245 
248  void GetEncrypt (RDM_ENCRYPT *enc) const;
249 
255  void GetConnections (
256  const RDM_CHAR_T *uri,
257  const RDM_CHAR_T *const **ppszUserIDs,
258  uint32_t *puUserCount
259  ) const;
260 
261 #if defined(RDM_UNICODE)
262  void GetConnections (
263  const wchar_t *uri,
264  const wchar_t *const **ppszUserIDs,
265  uint32_t *puUserCount) const;
266 #endif
267 
272  void GetVersion (
273  uint16_t *pMajorV,
274  uint16_t *pMinorV,
275  TFS_TYPE *pTfsType
276  ) const;
277 
278  RDM_ENCRYPT AllocEncrypt (const char *passcode);
279 
280 #if defined(RDM_UNICODE)
281  RDM_ENCRYPT AllocEncrypt (const wchar_t *passcode);
282 #endif
283 
288  RDM_TFS GetTFS () const;
289 
294  TFS_TYPE GetType (void) const;
295 
298  void KillRemoteConnection (
299  const RDM_CHAR_T *uri,
300  const RDM_CHAR_T *dbUserID
301  ) const;
302 
303 #if defined(RDM_UNICODE)
304  void KillRemoteConnection (const wchar_t *uri, const wchar_t *dbUserID) const;
305 #endif
306 
309  void KillAllRemoteConnections (
310  const RDM_CHAR_T *uri
311  ) const;
312 
313 #if defined(RDM_UNICODE)
314  void KillAllRemoteConnections (const wchar_t *uri) const;
315 #endif
316 
322  void Ping (const RDM_CHAR_T *uri
323  ) const;
324 
325 #if defined(RDM_UNICODE)
326  void Ping (const wchar_t *uri) const;
327 #endif
328 
333  void DropDatabase (
334  const RDM_CHAR_T *dbNameSpec
336  ) const;
337 
338 #if defined(RDM_UNICODE)
339  void DropDatabase (const wchar_t *dbNameSpec) const;
340 #endif
341 
346  RDM_BOOL_T GetCapability (
347  const RDM_CHAR_T *name
348  ) const;
349 
350 #if defined(RDM_UNICODE)
351  RDM_BOOL_T GetCapability (const wchar_t *name) const;
352 #endif
353 
367  TFS &Release (void);
368 
380  ~TFS ();
386  TFS (ITFS *itfs
387  )
388  throw ();
389 
395  TFS (const TFS &tfs
396  )
397  throw ();
398 
409  RDM_RETCODE GetReturnCode () const;
410 
411  protected:
413  ITFS *m_itfs;
414 
415  private:
416  const TFS *operator& (void) const;
417 
418  friend class Db;
419 };
420 
421 #endif
void _ValidateITFS() const
Validate the ITFS.
Definition: cpp-tfs.h:95
RDM_BOOL_T
Definition: psptypes.h:62
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:413
TFS_TYPE
Definition: rdmtfstypes.h:24
Header for the Transactional File Server (TFS) types.
struct RDM_ENCRYPT_S * RDM_ENCRYPT
Definition: psptypes.h:77