Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

MntPump Class Reference

#include <mnt_pump.h>

Inheritance diagram for MntPump:

MntComponent MntMPEGFileRTPizer MntRTPFileReader List of all members.

Public Member Functions

 MntPump ()
virtual void start_pumping ()
virtual void stop_pumping ()
virtual int pump_some ()
virtual int is_running ()
int command (int argc, const char *const *argv)

Public Attributes

MntPump::PumpTimer pump_timer_

Classes

class  PumpTimer

Detailed Description

An MntPump object is a special component which does not receive data from anyone. Rather, the role of a pump is to periodically send data other objects.

The method start_pumping and stop_pumping is called to start and stop the periodic timer respectively. Periodically, pump_some() is called. Method is_running() can be used to check if the pump is working.

To use a pump, typically a subclass is created, with pump_some() overwritten to generate proper data and send push() to components downstream. pump_some() should check if the pump is running, and schedule the next pump_some() to be called before exits. Further, a Tcl instproc called "on_stop_pumping" should be defined as a callback whenever stop_pumping is called. This Tcl procedure may clean up data/files at the Tcl-level.


Constructor & Destructor Documentation

MntPump::MntPump  )  [inline]
 

Empty constructor


Member Function Documentation

int MntPump::command int  argc,
const char *const *  argv
 

Overwrites TclObject::command() to define additional mapping between C++ methods and Tcl methods.

Reimplemented from MntComponent.

virtual int MntPump::is_running  )  [inline, virtual]
 

Return 1 if the pump is running, otherwise returns 0.

virtual int MntPump::pump_some  )  [inline, virtual]
 

Do nothing here. Subclass should define this method.

Reimplemented in MntRTPFileReader.

virtual void MntPump::start_pumping  )  [inline, virtual]
 

Begin to pump. pump_some() will be called to push the first batch of data down stream.

virtual void MntPump::stop_pumping  )  [inline, virtual]
 

Stop pumping. Tcl procedure "on_stop_pumping" will be called.


Member Data Documentation

MntPump::PumpTimer MntPump::pump_timer_
 

This inner class of MntPump is responsilble for scheduling the next call to pump_some(). Each MntPump has a instance of PumpTimer, called pump_timer_. Each pump_some() can schedule when to pump the next batch of data by calling the msched() method of Timer.

Note: Timer is a class provided by the TclCL package.


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 14:07:39 2005 for mnt by  doxygen 1.4.4