The TFS class This class provides the TFS implementation.
More...
#include "cpp-tfs.h"
|
| 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 | 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 | GetEncrypt (RDM_ENCRYPT *enc) const |
| Set an encryption context. More...
|
|
void | GetVersion (uint16_t *pMajorV, uint16_t *pMinorV, TFS_TYPE *pTfsType) const |
| Get the TFS type and version. 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...
|
|
RDM_BOOL_T | 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 |
|
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
- cpp/01_helloworld_cpp/cpp01Example_main.cpp.
◆ 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()
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 | ( | |
| ) | | |
Constructor.
Applications should not directly create TFS classes. They should use the static Alloc method to get a TFS class.
- Parameters
-
[in] | itfs | The internal ITFS to use with this instance |
◆ TFS() [3/3]
RDM_CPP::TFS::TFS |
( |
const TFS & |
tfs | ) |
|
throw | ( | |
| ) | | |
Constructor.
Applications should not directly create TFS classes. They should use the static Alloc method to get a TFS class.
- Parameters
-
[in] | tfs | an existing TFS to base this instance on |
◆ _ValidateITFS()
void RDM_CPP::TFS::_ValidateITFS |
( |
| ) |
const |
|
inline |
Validate the ITFS.
Definition: rdmretcodetypes.h:229
ITFS * m_itfs
Internal ITFS pointer.
Definition: cpp-tfs.h:353
References eINVTFSID.
◆ Alloc() [1/2]
◆ Alloc() [2/2]
static TFS RDM_CPP::TFS::Alloc |
( |
const char * |
options, |
|
|
size_t |
memSize = 0 , |
|
|
void * |
memBuf = NULL |
|
) |
| |
|
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 |
[in] | memSize | The memory size limit (size of memBuff if memBuf is specified) |
[in] | memBuf | The memory buffer to use instead of getting memory from the operating system |
◆ AllocDatabase()
Db RDM_CPP::TFS::AllocDatabase |
( |
const char * |
opts = NULL | ) |
|
◆ 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()
RDM_BOOL_T 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 * |
enc | ) |
const |
Set an encryption context.
◆ GetMemoryUsage()
void RDM_CPP::TFS::GetMemoryUsage |
( |
size_t & |
currUsage, |
|
|
size_t & |
maxUsage |
|
) |
| const |
Get memory usage information.
This method will get the TFS memory usage information
- Parameters
-
[out] | currUsage | The current amount of memory in use by the TFS |
[out] | maxUsage | The current amount of memory in use by the TFS |
◆ 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
-
- 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
-
- Parameters
-
[out] | optionString | Option string |
[in] | bytesIn | the size of optionString (in bytes) |
[out] | bytesOut | the number of bytes written to optionString |
◆ GetReturnCode()
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 |
Get the RDM_TFS handcle for a TFS object.
- Returns
- The RDM_TFS handle for the TFS object
◆ GetType()
TFS_TYPE RDM_CPP::TFS::GetType |
( |
void |
| ) |
const |
Get the RDM_TFS type for a TFS object.
- Returns
- The TFS_TYPE for the TFS object
◆ GetVersion()
void RDM_CPP::TFS::GetVersion |
( |
uint16_t * |
pMajorV, |
|
|
uint16_t * |
pMinorV, |
|
|
TFS_TYPE * |
pTfsType |
|
) |
| const |
Get the TFS type and version.
This method will obtain the type and version of the TFS
- Parameters
-
[out] | pMajorV | major version |
[out] | pMinorV | minor version |
[out] | pTfsType | TFS type |
◆ 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& RDM_CPP::TFS::operator= |
( |
const TFS & |
tfs | ) |
|
throw | ( | |
| ) | | |
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 |
Ping a remote TFS.
This method will ping the TFS specified by the URI to see if the TFS is active.
- Parameters
-
[in] | uri | Connection URI for TFSR |
◆ Release()
TFS& RDM_CPP::TFS::Release |
( |
void |
| ) |
|
◆ 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 |
tfstype | Specify the type of TFS to be used. |
docroot | Specify the Document Root directory. |
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 |
- Locking Requirements
- None
- Exceptions
-
- 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 RDM 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 |
tfstype | Specify the type of TFS to be used. |
docroot | Specify the Document Root directory. |
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 |
- Exceptions
-
- Parameters
-
[in] | optString | A null terminated string containing the key/value pairs |
◆ Db
◆ m_itfs
ITFS* RDM_CPP::TFS::m_itfs |
|
protected |
The documentation for this class was generated from the following file: