tcsBASE
Section: Devices and Network Interfaces (4)
Updated: 2012-04-23 10:08
Index
Return to man pages list
NAME
tcsBASE - TCS basic class to provide basic support tools
for handling common tcs environment and database root point
SYNOPSIS
#include "tcsBASE.h"
DESCRIPTION
This class provides methods to retrieve and, eventually, set the common
environment and database root point that is assumed to be used by all
TCS processes.
If these values are not explicitly set, they are defined using
environment variables or a default based on the assumption that a
fully standard TCS is used.
Look at the methods' description for details.
The class is fully static, i.e. all methods and data members are
static (it is a Singleton) and there is no need of declaring
any instance of the class to use the services provided.
In order to ensure a proper initializzation of the data members, the
include file tcsBASE.h allocates transparently an instance of the class
whenever it is included, called tcsBaseInit.
The functions tcsDbRoot(3), tcsEnvName(3) and tcsProcName(3)
provide a more convenient way for applications to access the TCS
environment name, database root point and the name of the current
process.
The function tcsMakeDbPoint(3) provides a convenient way for TCS
applications of building database symbolic addresses relative to
the TCS database root point.
All the methods can be safely called only after ccsInit() has
been executed.
A standard TCS application, handling command line arguments via
the tcsMAIN_HANDLER(4) class should call methods of this class
only after having called the Init() method of tcsMAIN_HANDLER(4)
A proper error handling makes sure that these rules are applied
PUBLIC METHODS
tcsBASE();
Constructor. There no need to explicitly ever call the
constructor, since this is a fully static class and all
services are available at class level.
It is only used in tcsBASE.h to ensure a proper initializzation
of the static data members.
static const char* DbRoot();
Static method to retrieve the "official" TCS database root point.
This database symbolic address must be used as an official root
point for all modules.
The default value for this address is defined in tcsDefines.h as:
#define tcsDBPOINT_DEF ":Appl_data:TCS"
If the environment variable TCS_DBPOINT is set, it is used in place
of the default.
static const char* EnvName();
Static method to retrieve the "official" TCS environment name.
This is the environment where all TCS processes are assumed to be
running.
The default value is the current environment in which the process
is running.
If the environment variable TCS_ENVNAME is set, it is used in place
of the default.
static const char* ProcName();
Name of this process, as retrieved via ccsGetMyProcId(3)
static ccsCOMPL_STAT DbRoot(const dbSYMADDRESS &root);
Allow to explicitly set the TCS database root point,
overwriting both the default value and what eventually set
in the environment variable TCS_DBPOINT.
The method can be called only once and must be called
BEFORE the corresponding read method is ever called
static ccsCOMPL_STAT EnvName(const ccsENVNAME &env);
Allow to explicitly set the TCS environment name,
overwriting both the default value and what eventually set
in the environment variable TCS_ENVNAME.
The method can be called only once and must be called
BEFORE the corresponding read method is ever called
PRIVATE DATA MEMBERS
The following static data members are set at the first access
via a read method.
static dbSYMADDRESS dbRoot; // TCS database root point
static ccsENVNAME envName; // TCS environmen name
static ccsPROCNAME procName; // Name for this process
ENVIRONMENT
TCS_DBPOINT specifies the root point of the TCS database branch,
if it is not the default.
TCS_ENVNAME specifies the environment for TCS processes,
if it is not the default.
RETURN VALUES
tcsERR_ALREADY_ASSIGNED The given parameter has been already
assigned and cannot be changed
tcsERR_PARM_TOO_LONG The size of the given parameter
string is too big
CAUTIONS
All the methods can be safely called only after ccsInit() has
been executed.
A standard TCS application, handling command line arguments via
the tcsMAIN_HANDLER(4) class should call methods of this class
only after having called the Init() method of tcsMAIN_HANDLER(4)
A proper error handling makes sure that these rules are applied
SEE ALSO
tcsDbRoot(3), tcsEnvName(3), tcsProcName(3), tcsMakeDbPoint(3),
tcsMAIN_HANDLER(4)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- PUBLIC METHODS
-
- PRIVATE DATA MEMBERS
-
- ENVIRONMENT
-
- RETURN VALUES
-
- CAUTIONS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 10:08:47 GMT, April 23, 2012