In file DMTBase/DMTBase.hh:

class DMTBase

Frame processor base class for data monitors.


Public Methods

DMTBase (int argc, const char *argv[])
Class constructor.
virtual ~DMTBase (void)
Class destructor.
void MainLoop (void)
Main loop over frames.
virtual void ProcessFrame (const FrameCPP::FrameH *frame)
Process a data frame (Supplied by user).
virtual void Attention (void)
Attention interrupt handler (Supplied by user).
void finish (void)
Stop data processing and go away cleanly.
int Debug (void) const
Get the debug level.
bool Boundary (void) const
Test for a time-gap before this frame.
Dacc& getDacc (void)
Get the data accessor.
int getNFrames (void) const
Get the number of frames processed.
int getNContig (void) const
Get the number of discontinuities in the frame stream.
bool isEnvArg (const char* arg) const
this function returns true if the aprguemt is a command line keyword used by the base-class
void setBuffer (int nbuf)
Set buffering depth.


The frame processing base class defines the basic routines necessary for a frame processing application. The strategy for writing a monitor program is to create a class (myclass) based on DMTBase including a constructor, destructor and ProcessFrame() method. EXECDMT(myclass) is used to generate the main function. These steps are described in DMTemplate.h and The base class constructor recognizes the following command line arguments: "-infile <file>" instructs the base class to read frames from the specified file, "-partition <part>" causes the frames to be read from the named shared memory partition. If no input option is specified, the frames are read from the partition specified by LIGOSMPART if this is undefined from "LIGO_Online". The debug print level can be specified with "-debug n".
DMTBase(int argc, const char *argv[])
The class constructor gets all the command line arguments in the usual Unix/C argument list format. It sets up the environment for processing and opens the frame input stream as directed by the command line arguments.
argc - Number of arguments defined.
argv - Address of a vector of pointers to the arguments.

virtual ~DMTBase(void)
Close the frame stream and go away.

void MainLoop(void)
This function is provided by the DMT base class. MainLoop reads frames and invokes ProcessFrame for each frame successfully read in. MainLoop exits when a SIGINT or SIGTERM signal is caught, or when finish is called by a subsidary function (e.g. by ProcessFrame).

virtual void ProcessFrame(const FrameCPP::FrameH *frame)
ProcessFrame performs the monitor specific processing on a single data frame. It must be defined as part of the derived monitor class implementation.
frame - pointer to a frame in the local format.

virtual void Attention(void)
Attention performs the monitor specific attention interrupt processing. Its definition as part of the derived monitor class is optional.

void finish(void)
finish stops processing by setting a flag that breaks the main loop. Note that finish returns to the calling method (generally ProcessFrame) which must exit normally for the process to terminate.

int Debug(void) const
Debug returns the value specified by the "-debug nnn" command line argument. If "-debug" isn't specified in the command line it defaults to 0.
Debug level.

bool Boundary(void) const
Boundary is set if the current frame is not contiguous in time with the previously read frame. The first frame read by an application is considered to be a boundary frame.
true if the last frame read was a boundary frame.

Dacc& getDacc(void)
Get a reference to the data accessor.
Data accessor reference.

int getNFrames(void) const
The frame count is incremented each time a new frame is read by the base class functions.
Number of frames read.

int getNContig(void) const
This function returns a counter that is incremented every time a boundary frame is found (see Boundary).
The number of discontinuities found in the frame stream.

bool isEnvArg(const char* arg) const
this function returns true if the aprguemt is a command line keyword used by the base-class

void setBuffer(int nbuf)
Set the Dacc buffering depth. The buffering depth is the number of buffer that may be reserved for this process. If the the buffering depth is specified as -1, all buffers will be read in. Note that setting a large number of buffer (or -1) could starve other processes of data if the current process is unable to keep up with the data stream or if it terminates without releasing the input partition. The buffer depth has no effect when reading data from files.
nbuf - Number of buffers to be reserved or -1 to read all.

This class has no child classes.
John G. Zweizig
1.3; Last modified August 3, 1999

alphabetic index hierarchy of classes

Please send questions and comments to

generated by doc++