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

MntComponent Class Reference

#include <mnt_component.h>

Inheritance diagram for MntComponent:

MntPump MntRTPFileWriter MntRTPPayloadDumper MntMPEGFileRTPizer MntRTPFileReader List of all members.

Public Member Functions

virtual void recv (MntData *)
virtual void flush ()
virtual void push (MntComponent *component, MntData *data)
virtual void push (MntData *data)
virtual void flush_next ()
virtual void push (MntComponent *component, MntClientData data)
virtual void pull (MntClientData param)
char * eval_instproc (const char *method)
MntComponent * lookup_tcl_object (const char *name)
 MntComponent ()
void add_link_to (MntComponent *c)
void del_link_to (MntComponent *c)
int command (int, const char *const *)

Public Attributes

MntComponent * down_stream_
MntComponent * up_stream_
MntComponent * next_

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.


Constructor & Destructor Documentation

MntComponent::MntComponent (   ) 
 

Constructor for MntComponent, initialize every member to NULL.


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.

int MntComponent::command (  int  argc,
const char *const *  argv
) 
 

This method overwrites TclObject command method and adds additional mapping from C++ functions to Tcl function.

Reimplemented in MntPump.

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.

virtual void MntComponent::flush_next (   )  [inline, virtual]
 

This method calls flush method of all components 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 (  MntComponent *  component,
MntClientData  data
)  [inline, virtual]
 

???

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 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

MntComponent* MntComponent::up_stream_
 

node this component will received data from


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