GWOLLUM 4.2.0
Tools for gravitational-wave analyses
Loading...
Searching...
No Matches
Monitor Class Reference

Monitor a GWOLLUM processing. More...

#include <Monitor.h>

Inheritance diagram for Monitor:
Collaboration diagram for Monitor:

Public Member Functions

string GetProcessDate (void)
 Returns the current process date (UTC) as a formatted string.
 
unsigned int GetProcessingTime (void)
 Returns the current processing duration [s].
 
string GetProcessingTimeString (void)
 Returns the current processing duration as a string.
 
bool GetStatus (void)
 Returns the object status.
 
unsigned int GetVerbosityLevel (void)
 Returns the verbosity level.
 
void SetMessageType (const MonitorMessageType aMessageType)
 Sets the message type.
 
void SetStatus (const bool aNewStatus)
 Sets a new object status.
 
void SetVerbosityLevel (const unsigned int aVerbosity)
 Sets the verbosity level.
 
void UpdateStatus (const bool aStatus)
 Updates the object status.
 
Constructors and destructors
 Monitor (const string aProcessName)
 Constructor of the Monitor class.
 
virtual ~Monitor (void)
 Destructor of the Monitor class.
 

Private Member Functions

void MakeMessage (char aChar)
 Builds the message one character at a time.
 
int overflow (int aChar) override
 Overrides the std::basic_streambuf::overflow() function.
 
void PrintMessage (void)
 Prints the current message.
 

Private Attributes

string message
 Message.
 
MonitorMessageType message_type
 Message type.
 
string procname
 Process name.
 
struct tm * ptm
 GMT time.
 
bool status
 Object status.
 
time_t timer
 Timer.
 
time_t timer_start
 Timer start.
 
unsigned int verbosity
 Verbosity level.
 

Detailed Description

Monitor a GWOLLUM processing.

This class is designed to monitor a GWOLLUM processing. It manages:

  • The verbosity level.
  • The production of messages.

The verbosity level must be set with SetVerbosityLevel(). It defines the quantity of information printed in the standard C error output stream stdout. Before printing a message, the message type must be defined with SetMessageType(). Then use the << operator to output the message.

Similarly error message are printed in the standard C error output stream stderr.

See also
MonitorMessageType for the message definition.

Constructor & Destructor Documentation

◆ Monitor()

Monitor::Monitor ( const string  aProcessName)

Constructor of the Monitor class.

Parameters
[in]aProcessNameProcess name.

◆ ~Monitor()

Monitor::~Monitor ( void  )
virtual

Destructor of the Monitor class.

Member Function Documentation

◆ GetProcessDate()

string Monitor::GetProcessDate ( void  )

Returns the current process date (UTC) as a formatted string.

Formatted string: "YYYY-MM-DD, hh:mm:ss UTC"

◆ GetProcessingTime()

unsigned int Monitor::GetProcessingTime ( void  )
inline

Returns the current processing duration [s].

◆ GetProcessingTimeString()

string Monitor::GetProcessingTimeString ( void  )

Returns the current processing duration as a string.

◆ GetStatus()

bool Monitor::GetStatus ( void  )
inline

Returns the object status.

◆ GetVerbosityLevel()

unsigned int Monitor::GetVerbosityLevel ( void  )
inline

Returns the verbosity level.

◆ MakeMessage()

void Monitor::MakeMessage ( char  aChar)
private

Builds the message one character at a time.

The message is printed (PrintMessage()) when a new line is detected.

Parameters
[in]aCharCharacter.

◆ overflow()

int Monitor::overflow ( int  aChar)
overrideprivate

Overrides the std::basic_streambuf::overflow() function.

Parameters
[in]aCharCharacter.

◆ PrintMessage()

void Monitor::PrintMessage ( void  )
private

Prints the current message.

Error/Fatal/Warning messages are always printed in the standard C error output stream stderr. Nominal messages are printed in the standard C error output stream stdout depending on the verbosity level.

◆ SetMessageType()

void Monitor::SetMessageType ( const MonitorMessageType  aMessageType)
inline

Sets the message type.

Parameters
[in]aMessageTypeMessage type.

◆ SetStatus()

void Monitor::SetStatus ( const bool  aNewStatus)
inline

Sets a new object status.

Parameters
[in]aNewStatusNew object status.

◆ SetVerbosityLevel()

void Monitor::SetVerbosityLevel ( const unsigned int  aVerbosity)
inline

Sets the verbosity level.

Verbosity levels:

  • 0: no prints.
  • 1: MonitorMessageType::monitor_info_1.
  • 2: MonitorMessageType::monitor_info_2.
  • 3: MonitorMessageType::monitor_info_3.
Parameters
[in]aVerbosityVerbosity level.

◆ UpdateStatus()

void Monitor::UpdateStatus ( const bool  aStatus)
inline

Updates the object status.

Parameters
[in]aStatusStatus update.

Member Data Documentation

◆ message

string Monitor::message
private

Message.

◆ message_type

MonitorMessageType Monitor::message_type
private

Message type.

◆ procname

string Monitor::procname
private

Process name.

◆ ptm

struct tm* Monitor::ptm
private

GMT time.

◆ status

bool Monitor::status
private

Object status.

◆ timer

time_t Monitor::timer
private

Timer.

◆ timer_start

time_t Monitor::timer_start
private

Timer start.

◆ verbosity

unsigned int Monitor::verbosity
private

Verbosity level.


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