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

OmniEvents::omniEventsLog Class Reference

#include <omniEventsLog.h>

Collaboration diagram for OmniEvents::omniEventsLog:

Collaboration graph
[legend]
List of all members.

Public Methods

 omniEventsLog (int port, const char *logdir=NULL)
void init (EventChannelFactory_i *&)
int getPort ()
void checkpoint (void)
void output (ostream &os)

Static Public Methods

void persist ()

Private Methods

void initializeFileNames (const char *logdir)
 Sets the values of 'active', 'backup' and 'checkpt' file names. More...

void setFilename (char *&filename, const char *logdir, const char *sep, const char *logname, const char *hostname, const char *ext)
 Helper function that sets the value of the first parameter to the concatenation of all the subsequent parameters. More...

void openOfstream (ofstream &s, const char *filename, int modeflags=0, int *fd=NULL)
 Helper method that opens an output file stream using whatever method is available. More...


Private Attributes

int port
ofstream logfile
int firstTime
char * active
char * backup
char * checkpt
omni_thread * recorder
EventChannelFactory_ifactory
int checkpointNeeded
omni_mutex _lock

Static Private Attributes

omniEventsLog * theLog = NULL

Constructor & Destructor Documentation

OmniEvents::omniEventsLog::omniEventsLog int    port,
const char *    logdir = NULL
 

Definition at line 226 of file omniEventsLog.cc.

References active, backup, file, firstTime, OEP_cfps::getPort(), initializeFileNames(), port, OmniEvents::timestamp::t(), yyin, and yyparse().


Member Function Documentation

void OmniEvents::omniEventsLog::checkpoint void   
 

Definition at line 415 of file omniEventsLog.cc.

References _lock, active, backup, checkpointNeeded, checkpt, DEFAULT_IDLE_TIME_BTW_CHKPT, logfile, openOfstream(), output(), and OmniEvents::timestamp::t().

int OmniEvents::omniEventsLog::getPort  
 

Definition at line 409 of file omniEventsLog.cc.

References port.

void OmniEvents::omniEventsLog::init EventChannelFactory_i *&   
 

Definition at line 330 of file omniEventsLog.cc.

References _lock, active, checkpointNeeded, factory, firstTime, OEP_cfps::getChannels(), OEP_cfps::getPort(), logfile, OMNIEVENTS_LOGDIR_ENV_VAR, openOfstream(), output(), port, recorder, and OmniEvents::timestamp::t().

void OmniEvents::omniEventsLog::initializeFileNames const char *    logdir [private]
 

Sets the values of 'active', 'backup' and 'checkpt' file names.

The files are placed in the log file directory, that is specified by:

  • command line parameter -l, OR ELSE
  • OMNIEVENTS_LOGDIR_ENV_VAR env. var. (default `OMNIEVENTS_LOGDIR'), OR ELSE
  • OMNIEVENTS_LOG_DEFAULT_LOCATION (set in include/config.h), OR ELSE
  • Unix: /var/omniEvents, Win32: C:\TEMP, VMS: []
The current hostname is incorporated into the file names.

Definition at line 589 of file omniEventsLog.cc.

References active, backup, checkpt, gethostname(), MAXHOSTNAMELEN, OMNIEVENTS_LOGDIR_ENV_VAR, setFilename(), OmniEvents::timestamp::t(), and VMS_SEMICOLON.

Referenced by omniEventsLog().

void OmniEvents::omniEventsLog::openOfstream ofstream &    s,
const char *    filename,
int    flags = 0,
int *    fd = NULL
[private]
 

Helper method that opens an output file stream using whatever method is available.

Available flags are:

  • FLAG_TRUNCATE
  • FLAG_APPEND
  • FLAG_SYNC
Parameters:
s  reference to the ofstream object.
filename  the name of the file to open.
modeflags 
fd  reference to a file descriptor. If used, this parameter is set to the fd that was opened, if any.

Definition at line 674 of file omniEventsLog.cc.

Referenced by checkpoint(), and init().

void OmniEvents::omniEventsLog::output ostream &    os
 

Definition at line 402 of file omniEventsLog.cc.

References factory, and OmniEvents::EventChannelFactory_i::output().

Referenced by checkpoint(), init(), and persist().

void OmniEvents::omniEventsLog::persist   [static]
 

Definition at line 389 of file omniEventsLog.cc.

References _lock, checkpointNeeded, factory, logfile, and output().

void OmniEvents::omniEventsLog::setFilename char *&    filename,
const char *    logdir,
const char *    sep,
const char *    logname,
const char *    hostname,
const char *    ext
[private]
 

Helper function that sets the value of the first parameter to the concatenation of all the subsequent parameters.

Definition at line 649 of file omniEventsLog.cc.

References len.

Referenced by initializeFileNames().


Member Data Documentation

omni_mutex OmniEvents::omniEventsLog::_lock [private]
 

Definition at line 127 of file omniEventsLog.h.

Referenced by checkpoint(), init(), and persist().

char* OmniEvents::omniEventsLog::active [private]
 

Definition at line 120 of file omniEventsLog.h.

Referenced by checkpoint(), init(), initializeFileNames(), and omniEventsLog().

char* OmniEvents::omniEventsLog::backup [private]
 

Definition at line 121 of file omniEventsLog.h.

Referenced by checkpoint(), initializeFileNames(), and omniEventsLog().

int OmniEvents::omniEventsLog::checkpointNeeded [private]
 

Definition at line 125 of file omniEventsLog.h.

Referenced by checkpoint(), init(), and persist().

char* OmniEvents::omniEventsLog::checkpt [private]
 

Definition at line 122 of file omniEventsLog.h.

Referenced by checkpoint(), and initializeFileNames().

EventChannelFactory_i* OmniEvents::omniEventsLog::factory [private]
 

Definition at line 124 of file omniEventsLog.h.

Referenced by init(), output(), and persist().

int OmniEvents::omniEventsLog::firstTime [private]
 

Definition at line 119 of file omniEventsLog.h.

Referenced by init(), and omniEventsLog().

ofstream OmniEvents::omniEventsLog::logfile [private]
 

Definition at line 118 of file omniEventsLog.h.

Referenced by checkpoint(), init(), and persist().

int OmniEvents::omniEventsLog::port [private]
 

Definition at line 117 of file omniEventsLog.h.

Referenced by getPort(), init(), and omniEventsLog().

omni_thread* OmniEvents::omniEventsLog::recorder [private]
 

Definition at line 123 of file omniEventsLog.h.

Referenced by init().

omniEventsLog * OmniEvents::omniEventsLog::theLog = NULL [static, private]
 

Definition at line 224 of file omniEventsLog.cc.


The documentation for this class was generated from the following files:
Generated on Fri Dec 12 10:53:14 2003 for OmniEvents by doxygen1.2.15