The TFS class This class provides the TFS implementation. More...
#include "cpp-tfs.h"
Public Member Functions |
|
TFS (void) throw () | |
TFS Default Constructor. More... |
|
TFS & | operator= (const TFS &tfs) throw () |
TFS assignment operator. More... |
|
void | _ValidateITFS () const |
Validate the ITFS. More... |
|
Db | AllocDatabase (const char *opts=NULL) |
Instantiate a database. More... |
|
void | SetCertificate (const char *certificate) |
Set an SSL certificate for an RDM_TFS instance. More... |
|
void | GetInfo (const char *uri, const char *optString, size_t bufSizeInBytes, char *buffer, size_t *numBytesWritten) |
Get TFS information. More... |
|
void | SetKey (const char *certificate) |
Set an SSL private key for an RDM_TFS instance. More... |
|
void | SetOptions (const char *optString) |
Set TFS option values. More... |
|
void | SetOption (const char *key, const char *value) |
Set a TFS option value. More... |
|
void | GetOptions (char *optionString, size_t bytesIn, size_t *bytesOut=NULL) |
Get TFS options. More... |
|
void | GetOption (const char *key, char *value, size_t bytesIn, size_t *bytesOut=NULL) |
Get a TFS option value. More... |
|
void | DisableListener (void) const |
Stop the listener process for the TFS. More... |
|
void | EnableListener () const |
Starts the listener process for the TFS. More... |
|
void | GetVersion (uint16_t *pMajorV, uint16_t *pMinorV, TFS_TYPE *pTfsType) const |
Get the TFS type and version. More... |
|
void | GetEncrypt (RDM_ENCRYPT_C *enc) const |
Set an encryption context. More... |
|
RDM_ENCRYPT | AllocEncrypt (const char *passcode) |
RDM_TFS | GetTFS () const |
Get the RDM_TFS handcle for a TFS object. More... |
|
TFS_TYPE | GetType (void) const |
Get the RDM_TFS type for a TFS object. More... |
|
void | KillRemoteConnection (const char *uri, const char *dbUserID) const |
Kill the TFS connection associated with a user. More... |
|
void | KillAllRemoteConnections (const char *uri) const |
Kill all the TFS connections. More... |
|
void | Ping (const char *uri) const |
Ping a remote TFS. More... |
|
void | DropDatabase (const char *dbNameSpec) const |
Drop a database. More... |
|
void | GetMemoryUsage (size_t &currUsage, size_t &maxUsage) const |
Get memory usage information. More... |
|
bool | GetCapability (const char *name) const |
Get a capability. More... |
|
TFS & | Release (void) |
~TFS () | |
TFS destructor. More... |
|
TFS (ITFS *itfs) throw () | |
Constructor. More... |
|
TFS (const TFS &tfs) throw () | |
Constructor. More... |
|
RDM_RETCODE | GetReturnCode () const |
Static Public Member Functions |
|
static TFS | Alloc (RDM_TFS tfs) |
Return TFS object using the specified RDM_TFS. More... |
|
static TFS | Alloc (const char *options, size_t memSize=0, void *memBuf=NULL) |
Allocate an RDM_TFS and return a TFS object. More... |
|
Protected Attributes |
|
ITFS * | m_itfs |
Internal ITFS pointer. More... |
|
Friends |
|
class | Db |
Detailed Description
The TFS class This class provides the TFS implementation.
This is a class with very little overhead - a single pointer - that is a 'smart pointer' (i.e. will automatically get destroyed when the last reference is removed).
To keep the overhead down this class should have no virtual functions.
- Examples
- cpp01Example_main.cpp, and cpp35Example_main.cpp.
Constructor & Destructor Documentation
TFS() [1/3]
RDM_CPP::TFS::TFS | ( | void | ) | ||
throw | ( | ||||
) |
TFS Default Constructor.
The default constructor, copy constructor, assignment operator, and destructor implement a smart pointer for the TFS interface and it's generated subclasses. The number of references to the underlying implementation object will be maintained. When the number of references to an implementation object is down to zero the object will be released.
The default constructor will initialize the number of references to the underlying implementation object to one.
~TFS()
RDM_CPP::TFS::~TFS | ( | ) |
TFS destructor.
The default constructor, copy constructor, assignment operator, and destructor implement a smart pointer for the TFS interface and it's generated subclasses. The number of references to the underlying implementation object will be maintained. When the number of references to an implementation object is down to zero the object will be released.
The destructor will decrement the number of references to the underlying implementation object by one.
TFS() [2/3]
RDM_CPP::TFS::TFS | ( | ITFS * | itfs | ) | |
throw | ( | ||||
) |
TFS() [3/3]
RDM_CPP::TFS::TFS | ( | const TFS & | tfs | ) | |
throw | ( | ||||
) |
Member Function Documentation
_ValidateITFS()
|
inline |
Alloc() [1/2]
|
static |
Allocate an RDM_TFS and return a TFS object.
This method will allocate the TFS service and return its handle.
- Parameters
-
[in] options TFS option string memSize [IN] The memory size limit (size of memBuff if memBuf is specified) memBuf [IN] The memory buffer to use instead of getting memory from the operating system
Alloc() [2/2]
AllocDatabase()
Db RDM_CPP::TFS::AllocDatabase | ( | const char * | opts = NULL |
) |
Instantiate a database.
This method will allocate the DB with specified options and return its handle. The optString is a key/value pair in the form of "key=value".
- Returns
- A database
- Parameters
-
[in] opts DB option string
AllocEncrypt()
RDM_ENCRYPT RDM_CPP::TFS::AllocEncrypt | ( | const char * | passcode | ) |
DisableListener()
void RDM_CPP::TFS::DisableListener | ( | void | ) | const |
Stop the listener process for the TFS.
DropDatabase()
void RDM_CPP::TFS::DropDatabase | ( | const char * | dbNameSpec | ) | const |
Drop a database.
This method will drop the specified database.
- Parameters
-
[in] dbNameSpec The database name specification for the database to be dropped
EnableListener()
void RDM_CPP::TFS::EnableListener | ( | ) | const |
Starts the listener process for the TFS.
GetCapability()
bool RDM_CPP::TFS::GetCapability | ( | const char * | name | ) | const |
Get a capability.
This method get an information about whether a capability is supported by a TFS
- Parameters
-
[in] name The name of the capability to query for
GetEncrypt()
void RDM_CPP::TFS::GetEncrypt | ( | RDM_ENCRYPT_C * | enc | ) | const |
Set an encryption context.
GetInfo()
void RDM_CPP::TFS::GetInfo | ( | const char * | uri, |
const char * | optString, | ||
size_t | bufSizeInBytes, | ||
char * | buffer, | ||
size_t * | numBytesWritten | ||
) |
Get TFS information.
This function method information in various categories about the TFS. The information will be returned in JSON format via the provided buffer.
The valid key/value boolean options are:
Key | Description |
---|---|
databases | If true, list the databases names available in the docroot directory. |
users | If true, list the current users accessing the TFS. |
version | If true, list the version info for the TFS |
The optString is a semicolon delimited list of keys to specifiy the information to be retrieved in the buffer. For example, "databases=true;users=true"
will retrieve database and user names.
- Exceptions
-
rdm_exception
GetMemoryUsage()
void RDM_CPP::TFS::GetMemoryUsage | ( | size_t & | currUsage, |
size_t & | maxUsage | ||
) | const |
GetOption()
void RDM_CPP::TFS::GetOption | ( | const char * | key, |
char * | value, | ||
size_t | bytesIn, | ||
size_t * | bytesOut = NULL |
||
) |
Get a TFS option value.
This method retrieves an option value for the TFS Handle
- Locking Requirements
- None
- Exceptions
-
rdm_exception
- Parameters
-
[in] key A null terminated name of the option to be set. [in] value A null terminated value for the specified option [in] bytesIn the size of value (in bytes) [out] bytesOut the number of bytes written to value
GetOptions()
void RDM_CPP::TFS::GetOptions | ( | char * | optionString, |
size_t | bytesIn, | ||
size_t * | bytesOut = NULL |
||
) |
Get TFS options.
The method retrieves a semicolon-delimited list of options in the pair of keyword and value for the options specified in 'keywords.'
keywords should be a list of option values. If keywords is NULL, the function returns the pairs for all available options. If keywords is an empty string, the function returns an empty string.
- Exceptions
-
rdm_exception
- Parameters
-
[out] optionString Option string [in] bytesIn the size of optionString (in bytes) [out] bytesOut the number of bytes written to optionString
GetReturnCode()
RDM_RETCODE RDM_CPP::TFS::GetReturnCode | ( | ) | const |
The TFS object does not throw exceptions for status codes. This function allows you to get the return code from the last method call. If the previous method call did not throw and exception this will either be sOKAY or a status code value. If the previous method call did throw an exception this will be the error code related to that exception.
- Returns
- The current RDM_RETCODE value
GetTFS()
RDM_TFS RDM_CPP::TFS::GetTFS | ( | ) | const |
GetType()
TFS_TYPE RDM_CPP::TFS::GetType | ( | void | ) | const |
GetVersion()
void RDM_CPP::TFS::GetVersion | ( | uint16_t * | pMajorV, |
uint16_t * | pMinorV, | ||
TFS_TYPE * | pTfsType | ||
) | const |
KillAllRemoteConnections()
void RDM_CPP::TFS::KillAllRemoteConnections | ( | const char * | uri | ) | const |
Kill all the TFS connections.
- Parameters
-
[in] uri Connection URI for TFSR
KillRemoteConnection()
void RDM_CPP::TFS::KillRemoteConnection | ( | const char * | uri, |
const char * | dbUserID | ||
) | const |
Kill the TFS connection associated with a user.
- Parameters
-
[in] uri Connection URI for TFSR [in] dbUserID User whose connection to kill
operator=()
TFS assignment operator.
The default constructor, copy constructor, assignment operator, and destructor implement a smart pointer for the TFS interface and it's generated subclasses. The number of references to the underlying implementation object will be maintained. When the number of references to an implementation object is down to zero the object will be released.
The assignment operator will increment the number of references to the underlying implementation object by one.
Ping()
void RDM_CPP::TFS::Ping | ( | const char * | uri | ) | const |
Release()
TFS& RDM_CPP::TFS::Release | ( | void | ) |
SetCertificate()
void RDM_CPP::TFS::SetCertificate | ( | const char * | certificate | ) |
Set an SSL certificate for an RDM_TFS instance.
This method is used to set an SSL certificate for TFS communication.
- Exceptions
-
rdm_exception
- Parameters
-
[in] certificate character string that contains an SSL certificate
SetKey()
void RDM_CPP::TFS::SetKey | ( | const char * | certificate | ) |
Set an SSL private key for an RDM_TFS instance.
This method is used to set an SSL private for TFS communication.
- Exceptions
-
rdm_exception
- Parameters
-
[in] certificate character string that contains an SSL private key
SetOption()
void RDM_CPP::TFS::SetOption | ( | const char * | key, |
const char * | value | ||
) |
Set a TFS option value.
This function retrieves a single runtime TFS option into a string value. The keyword parameter accepts the key for the option to get. The options are inherited by the database and/or SQL handles derived from this TFS handle.
Options are defined using keys or properties. Every key has a name and a value, delimited by an equals sign (=). The key name appears to the left of the equals sign. Key names are not case-sensitive. Unless otherwise noted, values are not case-sensitive.
Key | Value Description |
---|---|
docroot | Specify the Document Root directory. |
force_ssl | Specify if server allows any connection or only SSL |
logfilelevel | The log severity to use when writing to logfile . |
logerrlevel | The log severity to use when writing to stderr . |
logcategory | The log categories to use. |
logfile | Log File Spec |
listen | Enable the listener for remote TFS connections. |
readonly | Read-only mode for TFS. |
sharedmem | Enable shared memory communication protocol. |
tcp | Enable TCP/IP communication protocol. |
name | Specify TCP/IP port or shared memory protocol name. |
keep_alive_on | Enable TCP keepalives for tcp communication. |
tos | Enable ToS |
disable_rest_api | Disable REST API |
client_io | Client I/O mode for TFS |
- Locking Requirements
- None
- Exceptions
-
rdm_exception
- Parameters
-
[in] key A null terminated name of the option to be set. [in] value A null terminated value for the specified option
SetOptions()
void RDM_CPP::TFS::SetOptions | ( | const char * | optString | ) |
Set TFS option values.
This method is used to set any RaimaDB TFS options. The optString is a key/value pair in the form of "key=value". The options are inherited by the database and/or SQL handle derived from this TFS handle.
Options are defined using keys or properties. Every key has a name and a value, delimited by an equals sign (=). The key name appears to the left of the equals sign. Key names are not case-sensitive. Unless otherwise noted, values are not case-sensitive.
Key | Value Description |
---|---|
docroot | Specify the Document Root directory. |
force_ssl | Specify if server allows any connection or only SSL |
logfilelevel | The log severity to use when writing to logfile . |
logerrlevel | The log severity to use when writing to stderr . |
logcategory | The log categories to use. |
logfile | Log File Spec |
listen | Enable the listener for remote TFS connections. |
readonly | Read-only mode for TFS. |
sharedmem | Enable shared memory communication protocol. |
tcp | Enable TCP/IP communication protocol. |
name | Specify TCP/IP port or shared memory protocol name. |
keep_alive_on | Enable TCP keepalives for tcp communication. |
tos | Enable ToS |
disable_rest_api | Disable REST API |
client_io | Client I/O mode for TFS |
- Exceptions
-
rdm_exception
- Parameters
-
[in] optString A null terminated string containing the key/value pairs
Friends And Related Function Documentation
Db
|
friend |
Field Documentation
m_itfs
|
protected |
Internal ITFS pointer.
The documentation for this class was generated from the following file: