Main Page Class Hierarchy Compound List File List Compound Members File Members

# TGlobalUtils Class Reference

`#include <globalutils.h>`

Inheritance diagram for TGlobalUtils:

List of all members.

## Public Member Functions
| TGlobalUtils (char *p_programname)
HANDLE_STATUS | HandleConfigLine (ConfigSource *p_parser)
## Static Public Member Functions
void | SetTerminateFlag ()
bool | GetTerminateFlag ()
char * | GetEnvironmentValue (const char *)
char * | GetHomeDirectory ()
char * | GetVersion ()
const char * | GetProgramName ()
unsigned int | GetPID ()
WORM_MODULE_ID | GetThisModuleId ()
WORM_INSTALLATION_ID | GetThisInstallationId ()
void | SetFileLoggingState (bool p_newstate)
bool | WriteLogFile ()
WORM_LOGGING_LEVEL | GetLoggingLevel ()
long | GetHeartbeatInt ()
const WORM_INSTALLATION_ID | LookupInstallationId (const char *p_name)
const WORM_MODULE_ID | LookupModuleId (const char *p_name)
const WORM_MSGTYPE_ID | LookupMessageTypeId (const char *p_name)
const WORM_RING_ID | LookupRingKey (const char *p_name)
## Protected Member Functions
virtual bool | ParseLookupLine (const char *p_filename, ConfigSource &p_parser)
virtual void | CheckConfig ()
## Static Protected Attributes
PROGRAM_NAME | ProgramName = { "Uninitialized" }
WORM_MODULE_ID | ThisModuleId = WORM_MODULE_INVALID
WORM_INSTALLATION_ID | ThisInstallation = WORM_INSTALLATION_INVALID
LOG_DIRECTORY | HomeDirectory
char | Version [12]
bool | DoLogFile = true
WORM_LOGGING_LEVEL | LogLevel = WORM_LOG_ERRORS
long | HeartBeatInt = -1
volatile bool | TerminateFlag = false
INSTALLATION_MAP | InstallIds
RING_MAP | RingIds
MODULE_MAP | ModuleIds
MESSAGETYPE_MAP | MessageTypeIds
## Private Member Functions
void | LoadFiles ()
## Static Private Attributes
std::vector< std::string > | ConfigFiles
int | ConfigFileCount = 0

## Constructor & Destructor Documentation

TGlobalUtils::TGlobalUtils | ( | char * | p_programname | ) |

| Definition at line 54 of file globalutils.cpp. References ConfigFileCount, ConfigFiles, TConfigurable::ConfigState, GEN_FILENAME, GetEnvironmentValue(), LoadFiles(), TLogger::Logit(), LookupInstallationId(), ThisInstallation, WORM_INSTALLATION_INVALID, and WORM_STAT_NOTINIT.

## Member Function Documentation

void TGlobalUtils::CheckConfig | ( |  | ) | `[protected, virtual]`

| Reimplemented from TConfigurable. Definition at line 346 of file globalutils.cpp. References ConfigFileCount, TConfigurable::ConfigState, InstallIds, TLogger::Logit(), MessageTypeIds, ModuleIds, RingIds, ThisInstallation, WORM_INSTALLATION_INVALID, and WORM_STAT_BADSTATE.

char * TGlobalUtils::GetEnvironmentValue | ( | const char * |  | ) | `[static]`

| Definition at line 258 of file globalutils.cpp. Referenced by TLogger::OpenFile(), CMFCDialogModuleBase::PrepApp(), TGlobalUtils(), and TModuleBase::TModuleBase().

long TGlobalUtils::GetHeartbeatInt | ( |  | ) | `[inline, static]`

| Definition at line 170 of file globalutils.h. Referenced by WormServerBase::CheckConfig(), TModuleBase::CheckConfig(), CMFCDialogModuleBase::CheckConfig(), TModuleBase::Heartbeat(), CMFCDialogModuleBase::HeartBeat(), MutableServerBase::MainThreadActions(), WormServerBase::Run(), and CMFCDialogModuleBase::StatusAndReadLoop().

char* TGlobalUtils::GetHomeDirectory | ( |  | ) | `[inline, static]`

| Definition at line 149 of file globalutils.h.

WORM_LOGGING_LEVEL TGlobalUtils::GetLoggingLevel | ( |  | ) | `[inline, static]`

| Definition at line 168 of file globalutils.h. References WORM_LOGGING_LEVEL. Referenced by CMFCDialogModuleBase::CheckConfig(), ServerTemplate::GetRequestFromInput(), ServerTemplate::GetResultContainer(), ServerTemplate::HandleResult(), WormServerBase::Listener(), WormServerBase::ListenForMsg(), CMFCDialogModuleBase::PrepApp(), WormServerBase::PrepareToRun(), RingReaderServer::PrepareToRun(), TModuleBase::PrepareToRun(), ServerTemplate::ProcessRequest(), TModuleBase::Run(), WormServerBase::SendMessage(), MutableServerBase::TransmitRequest(), and MutableServerBase::TransmitResult().

unsigned int TGlobalUtils::GetPID | ( |  | ) | `[inline, static]`

| Definition at line 155 of file globalutils.h. Referenced by MutableServerBase::MainThreadActions(), WormServerBase::Run(), and CMFCDialogModuleBase::StatusAndReadLoop().

const char* TGlobalUtils::GetProgramName | ( |  | ) | `[inline, static]`

| Definition at line 153 of file globalutils.h.

bool TGlobalUtils::GetTerminateFlag | ( |  | ) | `[inline, static]`

| Definition at line 142 of file globalutils.h. Referenced by MutableServerBase::MainThreadActions().

WORM_INSTALLATION_ID TGlobalUtils::GetThisInstallationId | ( |  | ) | `[inline, static]`

| Definition at line 159 of file globalutils.h. References WORM_INSTALLATION_ID. Referenced by MutableServerBase::CheckConfig(), WormServerBase::SendStatus(), and CMFCDialogModuleBase::SendStatus().

WORM_MODULE_ID TGlobalUtils::GetThisModuleId | ( |  | ) | `[inline, static]`

| Definition at line 157 of file globalutils.h. References WORM_MODULE_ID. Referenced by MutableServerBase::CheckConfig(), TModuleBase::Run(), WormServerBase::SendStatus(), and CMFCDialogModuleBase::SendStatus().

char* TGlobalUtils::GetVersion | ( |  | ) | `[inline, static]`

| Definition at line 151 of file globalutils.h.

HANDLE_STATUS TGlobalUtils::HandleConfigLine | ( | ConfigSource * | p_parser | ) | `[virtual]`

| Reimplemented from TConfigurable. Definition at line 263 of file globalutils.cpp. References DoLogFile, ConfigSource::GetCurrentLine(), HANDLE_STATUS, HANDLER_UNUSED, HANDLER_USED, HeartBeatInt, ConfigSource::Int(), ConfigSource::INVALID_INT, ConfigSource::INVALID_LONG, ConfigSource::Its(), TLogger::Logit(), LogLevel, ConfigSource::Long(), LookupModuleId(), ConfigSource::String(), ThisModuleId, TLogger::TruncateOnOpen(), and WORM_MODULE_INVALID. Referenced by TModuleBase::HandleConfigLine(), CMFCDialogModuleBase::HandleConfigLine(), and main().

void TGlobalUtils::LoadFiles | ( |  | ) | `[private]`

| Definition at line 705 of file globalutils.cpp. References TComFileParser::Close(), COMFILE_EOF, COMFILE_ERROR, ConfigFileCount, TConfigurable::ConfigState, ConfigSource::Error(), ConfigSource::GetCurrentLine(), ConfigSource::IsTokenNull(), TLogger::Logit(), ConfigSource::NextToken(), TComFileParser::Open(), ParseLookupLine(), TComFileParser::ReadLine(), and WORM_STAT_SUCCESS. Referenced by TGlobalUtils().

const WORM_INSTALLATION_ID TGlobalUtils::LookupInstallationId | ( | const char * | p_name | ) | `[static]`

| Definition at line 786 of file globalutils.cpp. References InstallIds, TLogger::Logit(), WORM_INSTALLATION_ID, and WORM_INSTALLATION_INVALID. Referenced by RingReaderServer::HandleConfigLine(), MutableServerBase::HandleConfigLine(), CMFCDialogModuleBase::HandleConfigLine(), RingReaderServer::MainThreadActions(), MutableServerBase::Stacker(), CMFCDialogModuleBase::StatusAndReadLoop(), and TGlobalUtils().

const WORM_MSGTYPE_ID TGlobalUtils::LookupMessageTypeId | ( | const char * | p_name | ) | `[static]`

| Definition at line 843 of file globalutils.cpp. References TLogger::Logit(), MessageTypeIds, WORM_MSGTYPE_ID, and WORM_MSGTYPE_INVALID. Referenced by MutableServerBase::CheckConfig(), TModuleBase::CheckConfig(), CMFCDialogModuleBase::CheckConfig(), RingReaderServer::HandleConfigLine(), MutableServerBase::HandleConfigLine(), CMFCDialogModuleBase::HandleConfigLine(), RingReaderServer::MainThreadActions(), RingReaderServer::PrepareToRun(), WormServerBase::SendStatus(), MutableServerBase::Stacker(), CMFCDialogModuleBase::StatusAndReadLoop(), and WormServerBase::WormServerBase().

const WORM_MODULE_ID TGlobalUtils::LookupModuleId | ( | const char * | p_name | ) | `[static]`

| Definition at line 824 of file globalutils.cpp. References TLogger::Logit(), ModuleIds, WORM_MODULE_ID, and WORM_MODULE_INVALID. Referenced by RingReaderServer::HandleConfigLine(), MutableServerBase::HandleConfigLine(), CMFCDialogModuleBase::HandleConfigLine(), HandleConfigLine(), RingReaderServer::MainThreadActions(), MutableServerBase::Stacker(), and CMFCDialogModuleBase::StatusAndReadLoop().

const WORM_RING_ID TGlobalUtils::LookupRingKey | ( | const char * | p_name | ) | `[static]`

| Definition at line 805 of file globalutils.cpp. References TLogger::Logit(), RingIds, WORM_RING_ID, and WORM_RING_INVALID. Referenced by WormServerBase::HandleConfigLine(), RingReaderServer::HandleConfigLine(), MutableServerBase::HandleConfigLine(), TModuleBase::HandleConfigLine(), and CMFCDialogModuleBase::HandleConfigLine().

bool TGlobalUtils::ParseLookupLine | ( | const char * | p_filename,
|  | ConfigSource & | p_parser
| ) | `[protected, virtual]`

| Definition at line 418 of file globalutils.cpp. References InstallIds, ConfigSource::Int(), ConfigSource::INVALID_INT, ConfigSource::INVALID_LONG, ConfigSource::Its(), TLogger::Logit(), LogLevel, ConfigSource::Long(), MAX_INSTALLNAME_LEN, MAX_MODNAME_LEN, MAX_MSGTYPENAME_LEN, MAX_RINGNAME_LEN, MessageTypeIds, ModuleIds, ConfigSource::NextToken(), RingIds, ConfigSource::String(), WORM_LOG_MU, and WORM_RING_ID. Referenced by LoadFiles().

void TGlobalUtils::SetFileLoggingState | ( | bool | p_newstate | ) | `[inline, static]`

| Definition at line 161 of file globalutils.h.

void TGlobalUtils::SetTerminateFlag | ( |  | ) | `[inline, static]`

| Definition at line 141 of file globalutils.h. Referenced by SignalHandler().

bool TGlobalUtils::WriteLogFile | ( |  | ) | `[inline, static]`

| Definition at line 166 of file globalutils.h. Referenced by TLogger::Logit().

## Member Data Documentation

int TGlobalUtils::ConfigFileCount = 0`[static, private]`

| Definition at line 36 of file globalutils.cpp. Referenced by CheckConfig(), LoadFiles(), and TGlobalUtils().

std::vector< std::string > TGlobalUtils::ConfigFiles`[static, private]`

| Definition at line 35 of file globalutils.cpp. Referenced by TGlobalUtils().

bool TGlobalUtils::DoLogFile = true`[static, protected]`

| Definition at line 33 of file globalutils.cpp. Referenced by HandleConfigLine().

long TGlobalUtils::HeartBeatInt = -1`[static, protected]`

| Definition at line 29 of file globalutils.cpp. Referenced by HandleConfigLine().

LOG_DIRECTORY TGlobalUtils::HomeDirectory`[static, protected]`

| Definition at line 27 of file globalutils.cpp.

INSTALLATION_MAP TGlobalUtils::InstallIds`[static, protected]`

| Definition at line 38 of file globalutils.cpp. Referenced by CheckConfig(), LookupInstallationId(), and ParseLookupLine().

WORM_LOGGING_LEVEL TGlobalUtils::LogLevel = WORM_LOG_ERRORS`[static, protected]`

| Definition at line 32 of file globalutils.cpp. Referenced by HandleConfigLine(), and ParseLookupLine().

MESSAGETYPE_MAP TGlobalUtils::MessageTypeIds`[static, protected]`

| Definition at line 41 of file globalutils.cpp. Referenced by CheckConfig(), LookupMessageTypeId(), and ParseLookupLine().

MODULE_MAP TGlobalUtils::ModuleIds`[static, protected]`

| Definition at line 40 of file globalutils.cpp. Referenced by CheckConfig(), LookupModuleId(), and ParseLookupLine().

PROGRAM_NAME TGlobalUtils::ProgramName = { "Uninitialized" }`[static, protected]`

| Definition at line 24 of file globalutils.cpp.

RING_MAP TGlobalUtils::RingIds`[static, protected]`

| Definition at line 39 of file globalutils.cpp. Referenced by CheckConfig(), LookupRingKey(), and ParseLookupLine().

volatile bool TGlobalUtils::TerminateFlag = false`[static, protected]`

| Definition at line 43 of file globalutils.cpp.

WORM_INSTALLATION_ID TGlobalUtils::ThisInstallation = WORM_INSTALLATION_INVALID`[static, protected]`

| Definition at line 25 of file globalutils.cpp. Referenced by CheckConfig(), and TGlobalUtils().

WORM_MODULE_ID TGlobalUtils::ThisModuleId = WORM_MODULE_INVALID`[static, protected]`

| Definition at line 26 of file globalutils.cpp. Referenced by HandleConfigLine().

char TGlobalUtils::Version`[static, protected]`

| Definition at line 28 of file globalutils.cpp.

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

- globalutils.h
- globalutils.cpp