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

MntComponent Class Reference

MntComponent is the base class of all Mnt components. More...

#include <mnt_component.h>

Inheritance diagram for MntComponent:

MntMPEGFrameDecoder MntMPEGRTPReassembler MntPPMWriter MntPSNRCalculator MntPump MntRTPDropper MntRTPFileWriter MntRTPPayloadDumper List of all members.

Public Member Functions

virtual void recv (MntData *)
 This method should be overwritten by subclass.
virtual void flush ()
 Some MntComponent object may buffer some data instead of processing them immediately.
virtual void push (MntComponent *component, MntData *data)
 This method sends processed data to the a specific component.
virtual void push (MntData *data)
 This method sends processed data to all components down stream.
virtual void flush_next ()
 This method calls flush method of all components down stream.
virtual void push (MntComponent *component, MntClientData data)
 ???
virtual void pull (MntClientData param)
 This method pull data from the upstream node when needed.
char * eval_instproc (const char *method)
 This methods is the hook from C++ to Tcl methods.
MntComponentlookup_tcl_object (const char *name)
 Given the name of a Tcl object, returns the pointer to the corresponding C++ object.
 MntComponent ()
 Constructor for MntComponent, initialize every member to NULL.
void add_link_to (MntComponent *c)
 Add a link from this object to another component c.
void del_link_to (MntComponent *c)
 Remove the link from this object to component c.
int command (int, const char *const *)
 This method overwrites TclObject command method and adds additional mapping from C++ functions to Tcl function.

Public Attributes

MntComponentdown_stream_
MntComponentup_stream_
MntComponentnext_

Detailed Description

MntComponent is the base class of all Mnt components.

A component is a C++ object that can be accessed using Tcl interface. A MntComponent typically receives some data, processes it, and passes it to zero or more other components.

To use MntComponent, two things are typically needed. First, overwrite the recv() method to process the data. Second, create a static class object to expose the component to Tcl.

MntComponent objects can be linked at the Tcl-level to create a tree of components. Data flows through the tree, and are processed along the way.

An MntComponent object maintains a link list of other components "downstream", i.e., nodes to pass data to.


Member Function Documentation

void MntComponent::add_link_to MntComponent c  ) 
 

Add a link from this object to another component c.

Parameters:
c component to linked to.

void MntComponent::del_link_to MntComponent c  ) 
 

Remove the link from this object to component c.

If c is not a valid down stream object, nothing happens. If for some reasons multiple c exists, all instances of c is removed.

Parameters:
c component to remove.

char* MntComponent::eval_instproc const char *  method  )  [inline]
 

This methods is the hook from C++ to Tcl methods.

It allows invocation Tcl methods from C++.

Parameters:
method the name of the Tcl method to invoke. This string, can optionally contains arguments to the method as well.

virtual void MntComponent::flush  )  [inline, virtual]
 

Some MntComponent object may buffer some data instead of processing them immediately.

In such cases, it may be necessary to call flush() at appropriate point of the program to push the buffered data down stream.

MntComponent* MntComponent::lookup_tcl_object const char *  name  )  [inline]
 

Given the name of a Tcl object, returns the pointer to the corresponding C++ object.

Parameters:
name A string containing the name of the Tcl object to looked up.

virtual void MntComponent::pull MntClientData  param  )  [inline, virtual]
 

This method pull data from the upstream node when needed.

???

virtual void MntComponent::push MntData data  )  [inline, virtual]
 

This method sends processed data to all components down stream.

Parameters:
data Processed data to pass down stream.

virtual void MntComponent::push MntComponent component,
MntData data
[inline, virtual]
 

This method sends processed data to the a specific component.

Parameters:
component Component to pass data to.
data Processed data object to pass to component.

virtual void MntComponent::recv MntData  )  [inline, virtual]
 

This method should be overwritten by subclass.

This is where most actions happens. Whenever some data is received, this method is called. Typically, a component will process the data in this method, and call push() to push processed data to the nodes down stream.

Reimplemented in MntMPEGFrameDecoder, MntMPEGRTPReassembler, MntPPMWriter, MntPSNRCalculator, MntRTPDropper, MntRTPFileWriter, and MntRTPPayloadDumper.


Member Data Documentation

MntComponent* MntComponent::down_stream_
 

first node to passed data to

MntComponent* MntComponent::next_
 

next node in the link list of downstream nodes

Reimplemented in MntMPEGFrameDecoder.

MntComponent* MntComponent::up_stream_
 

node this component will received data from


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