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 RDM_CHAR_T *opts=NULL)
Instantiate a database. More...
void SetOptions (const RDM_CHAR_T *optString)
Set TFS option values. More...
void SetOption (const RDM_CHAR_T *key, const RDM_CHAR_T *value)
Set a TFS option value. More...
void GetOptions (RDM_CHAR_T *optionString, size_t bytesIn, size_t *bytesOut=NULL)
Get TFS options. More...
void GetOption (const RDM_CHAR_T *key, RDM_CHAR_T *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 GetConnections (const RDM_CHAR_T *uri, const RDM_CHAR_T *const **ppszUserIDs, uint32_t *puUserCount) const
Get the list of users connected to the TFS. 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 RDM_CHAR_T *uri, const RDM_CHAR_T *dbUserID) const
Kill the TFS connection associated with a user. More...
void KillAllRemoteConnections (const RDM_CHAR_T *uri) const
Kill all the TFS connections. More...
void Ping (const RDM_CHAR_T *uri) const
Ping a remote TFS. More...
void DropDatabase (const RDM_CHAR_T *dbNameSpec) const
Drop a database. 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 RDM_CHAR_T *options)
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.

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 [in] 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 [in] an existing TFS to base this instance on

Member Function Documentation

_ValidateITFS()

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

Validate the ITFS.

101 {
102if (m_itfs == NULL)
103 {
104throw(rdm_exception(eINVTFSID));
105 }
106 }

References eINVTFSID.

Alloc() [1/2]

static TFS RDM_CPP::TFS::Alloc ( const RDM_CHAR_T * options )
static

Allocate an RDM_TFS and return a TFS object.

This method will allocate the TFS service with specified option values and return its handle. The optString is a key/value pair in the form of "key=value".

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.
listen Enable the listener for remote TFS connections.
readonly Read-only mode for TFS.
diskless Diskless 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.
verbose Enable verbose logging.
logfile Specify TFS log file.
stdout_file Specify alternate stdout output file name.
keep_alive_on Enable TCP keepalives for tcp communication.
Note
Database configuration options can be set using this function and will be inherited by the database handle at the time it is allocated. For example, the "durability=consistent" option can be set using this function and it will be inherited by the next Db handle allocated using this TFS handle. See Database Configuration Options for the list of valid database configuration option keys.
Parameters
[in] options [in] TFS option string

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 [in] RDM_TFS handle

AllocDatabase()

Db RDM_CPP::TFS::AllocDatabase ( const RDM_CHAR_T * 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 [in] 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 RDM_CHAR_T * dbNameSpec ) const

Drop a database.

This method will drop the specified database.

Parameters
[in] dbNameSpec [in] The database name specification for the database to be dropped

EnableListener()

void RDM_CPP::TFS::EnableListener ( ) const

Starts the listener process for the TFS.

GetConnections()

void RDM_CPP::TFS::GetConnections ( const RDM_CHAR_T * uri,
const RDM_CHAR_T *const ** ppszUserIDs,
uint32_t * puUserCount
) const

Get the list of users connected to the TFS.

This method returns an array of user IDs, each of which represents a TFS connection.

Parameters
[in] uri [in] Connection URI
[out] ppszUserIDs [out] Array of user IDs
[out] puUserCount [out] Number of user IDs

GetEncrypt()

void RDM_CPP::TFS::GetEncrypt ( RDM_ENCRYPT * enc ) const

Set an encryption context.

GetOption()

void RDM_CPP::TFS::GetOption ( const RDM_CHAR_T * key,
RDM_CHAR_T * 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 [in] A null terminated name of the option to be set.
[in] value [in] A null terminated value for the specified option
[in] bytesIn [in] the size of value (in bytes)
[out] bytesOut [out] the number of bytes written to value

GetOptions()

void RDM_CPP::TFS::GetOptions ( RDM_CHAR_T * 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 [out] Option string
[in] bytesIn [in] the size of optionString (in bytes)
[out] bytesOut [out] 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 [out] major version
[out] pMinorV [out] minor version
[out] pTfsType [out] TFS type

KillAllRemoteConnections()

void RDM_CPP::TFS::KillAllRemoteConnections ( const RDM_CHAR_T * uri ) const

Kill all the TFS connections.

Parameters
[in] uri [in] Connection URI for TFSR

KillRemoteConnection()

void RDM_CPP::TFS::KillRemoteConnection ( const RDM_CHAR_T * uri,
const RDM_CHAR_T * dbUserID
) const

Kill the TFS connection associated with a user.

Parameters
[in] uri [in] Connection URI for TFSR
[in] dbUserID [in] 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 RDM_CHAR_T * 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 [in] Connection URI for TFSR

Release()

TFS& RDM_CPP::TFS::Release ( void )

SetOption()

void RDM_CPP::TFS::SetOption ( const RDM_CHAR_T * key,
const RDM_CHAR_T * value
)

Set a TFS option value.

This method sets an option for the TFS Handle

Locking Requirements
None
Exceptions
rdm_exception
Parameters
[in] key [in] A null terminated name of the option to be set.
[in] value [in] A null terminated value for the specified option

SetOptions()

void RDM_CPP::TFS::SetOptions ( const RDM_CHAR_T * 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
timeout Specify default lock timeout in seconds.
time_zone Specify current time zone.
storage Specify database storage mode.
cache_size Specify cache size.
item_format Specify row storage form.
locale Specify database locale.
error_format Specify error message format.
durability Specify database transaction safety level.
pack_file_size Specify pack file maximum size.
db_size Specify the maximum database size allocation.
vacuum_percentage Specify the vacuum trigger level for pack files.
vacuum_write_chunk_size Specify the vacuum scan size for pack files.
vacuum_read_chunk_size Specify the vacuum write size for pack files.
idindex_flush_threshold_on_close Specify the threshold for flushing the ID-index when the last database user closes the database.
idindex_flush_threshold Specify the threshold for flushing the ID-index.
idindex_cache_size Specify the size of the ID-index cache in byte.
Exceptions
rdm_exception
Parameters
[in] optString [in] 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:437
@ eINVTFSID
Definition: rdmretcodetypes.h:217