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

MntPump Class Reference

An MntPump object is a special component which does not receive data from anyone. More...

#include <mnt_pump.h>

Inheritance diagram for MntPump:

MntComponent MntMPEGFileRTPizer MntRTPFileReader List of all members.

Public Member Functions

 MntPump ()
 Empty constructor.
virtual void start_pumping ()
 Begin to pump.
virtual void stop_pumping ()
 Stop pumping.
virtual int pump_some ()
 Do nothing here.
virtual int is_running ()
 Return 1 if the pump is running, otherwise returns 0.
int command (int argc, const char *const *argv)
 Overwrites TclObject::command() to define additional mapping between C++ methods and Tcl methods.

Public Attributes

MntPump::PumpTimer pump_timer_
 This inner class of MntPump is responsilble for scheduling the next call to pump_some().

Private Attributes

int running_

Classes

class  PumpTimer
 This inner class of MntPump is responsilble for scheduling the next call to pump_some(). More...

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.


Member Function Documentation

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

Do nothing here.

Subclass should define this method.

Reimplemented in MntMPEGFileRTPizer, and 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.

int MntPump::running_ [private]
 

1 if the pump is running, 0 otherwise


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 12:37:13 2005 for mnt by  doxygen 1.4.4