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 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 *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...
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

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 (
)

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

Member Function Documentation

_ValidateITFS()

void RDM_CPP::TFS::_ValidateITFS ( ) const
inline

Validate the ITFS.

97 {
98if (m_itfs == NULL)
99 {
100throw (rdm_exception (eINVTFSID));
101 }
102 }

References eINVTFSID.

Alloc() [1/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
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]

static TFS RDM_CPP::TFS::Alloc ( RDM_TFS tfs )
static

Return TFS object using the specified RDM_TFS.

This method will allocate the TFS service and return its handle.

Locking Requirements
None
Parameters
[in] tfs RDM_TFS handle
Examples
cpp01Example_main.cpp, cpp35Example_main.cpp, tfscpp/tfsAlloc.cpp, and tfscpp/tfsAllocDefault.cpp.

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
Examples
cpp01Example_main.cpp, cpp35Example_main.cpp, tfscpp/tfsAlloc.cpp, and tfscpp/tfsAllocDefault.cpp.

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
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

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
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 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
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 class Db
friend

Field Documentation

m_itfs

ITFS* RDM_CPP::TFS::m_itfs
protected

Internal ITFS pointer.


The documentation for this class was generated from the following file:
ITFS * m_itfs
Internal ITFS pointer.
Definition: cpp-tfs.h:353
@ eINVTFSID
Definition: rdmretcodetypes.h:233