Products Support Documentation Download
RDM_CPP::TFS Class Reference

The TFS class This class provides the TFS implementation. More...

#include "cpp-tfs.h"

Public Member Functions

 TFS (void) throw ()
 TFS Default Constructor. More...
 
TFSoperator= (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...
 
TFSRelease (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.

Examples:
tutorials/HelloWorldCPP/hello_worldCPPTutorial_main.cpp.

Definition at line 67 of file cpp-tfs.h.

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]itfsThe 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]tfsan existing TFS to base this instance on

Member Function Documentation

◆ _ValidateITFS()

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

Validate the ITFS.

Definition at line 100 of file cpp-tfs.h.

References eINVTFSID, and RDM_CHAR_T.

101  {
102  if (m_itfs == NULL)
103  {
104  throw(rdm_exception(eINVTFSID));
105  }
106  }
ITFS * m_itfs
Internal ITFS pointer.
Definition: cpp-tfs.h:437

◆ Alloc() [1/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]tfsRDM_TFS handle
Examples:
tutorials/HelloWorldCPP/hello_worldCPPTutorial_main.cpp.

◆ Alloc() [2/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]optionsTFS option string

◆ 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]optsDB option string
Examples:
tutorials/HelloWorldCPP/hello_worldCPPTutorial_main.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 RDM_CHAR_T dbNameSpec) const

Drop a database.

This method will drop the specified database.

Parameters
[in]dbNameSpecThe 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]uriConnection URI
[out]ppszUserIDsArray of user IDs
[out]puUserCountNumber 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]keyA null terminated name of the option to be set.
[in]valueA null terminated value for the specified option
[in]bytesInthe size of value (in bytes)
[out]bytesOutthe 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]optionStringOption string
[in]bytesInthe size of optionString (in bytes)
[out]bytesOutthe 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]pMajorVmajor version
[out]pMinorVminor version
[out]pTfsTypeTFS type

◆ KillAllRemoteConnections()

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

Kill all the TFS connections.

Parameters
[in]uriConnection 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]uriConnection URI for TFSR
[in]dbUserIDUser 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]uriConnection 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]keyA null terminated name of the option to be set.
[in]valueA 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_sizeSpecify 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]optStringA null terminated string containing the key/value pairs

Friends And Related Function Documentation

◆ Db

friend class Db
friend

Definition at line 442 of file cpp-tfs.h.

Field Documentation

◆ m_itfs

ITFS* RDM_CPP::TFS::m_itfs
protected

Internal ITFS pointer.

Definition at line 437 of file cpp-tfs.h.


The documentation for this class was generated from the following file: