dmuChain
Inherits from: dmuObj
#include "dmuChain.h"
Overview
This object takes a chain of dmuObjects and wraps them up into a single
object. This allows you to create another level of abstraction above
the individual objects.
This chain object does not deal with fan-out right now. You can only
have one drain in the chain contained by this object
The dmuChain object can be used in a couple
of different ways. It can be used to encapsulate sets of objects that
are used often. It could also be inherited from and built up to
create diffent chains depending on a certain input. For example, if
you want to have a movie source, there are two objects that output movie.
You could make a dmuChain object that would create an appropriate movie
object depending on the movie type. The children would only see the
dmuChain object as the parent and the chain inside could be different
depending on the movie type.
See the source code for more info and implementation details.
Public Methods
- dmuChain()
Constructor: creates an object that contains no chain
- ~dmuChain()
Destructor
- virtual int setup()
This method is intended to be overridden to allow you to create a
chain of object internally for this object to contain instead of
passing a chain in to this object.
This method does not do anything on this object, but if you inherit
from this object, you can override this method to create a chain
and call setup on all of the object in the chain
- int addSrcConstraints(DMparams *params)
If this class is acting as a destination for another object in a
chain, this method is used to notify the parent object (i.e. the
source object) of any constraints which the head object of the chain
may have on its source. These constraints are added to the params
parameter structure. This method is used to ensure that the
DMbuffers that the parent object sends to this object are in a
format that can be received and used propperly.
addSrcConstraints() is ususally called internally in the library
during the init() method, and is rarely, if ever, used by user
programs.
- int addDstConstraints(DMparams *params)
This method adds to the params structure, any constraints
that may be associated with the output of the tail object of the
chain. Normally, this method is called internal to the
object to set up the parameters of a DMbuffer pool which the object
will use as a
drain. This can be useful for child objects (or dmu programs) to
obtain information about the constraints used in the creation of
the DMbuffer pool associated with an object that drains into
DMbuffers.
- int init(dmuParams *params = NULL)
This method call Init on the head of the chain. Because init is
propagated by any useable object, calling init on the head object
initializes the whole chain.
- int addObject(dmuObj *newObj)
This method addes newObj as a child of the last object in the chain.
- int start(int propagate = DMU_PROPAGATE)
This method calls start on the head of the chain.
- int getFD()
this method does not have any meaning on the chain object because
there are potentially more than one FD within the chain.
Use the setFD method instead.
- int setFD(fd_set *fdSet,int *maxFD,int propagate = 1)
This method sets the fd in the fdSet for each object in the chain.
- int receive(DMbuffer inBuffer)
This method will pass the inBuffer to the head of the chain.
- int setChain(dmuObj *newHead)
Set the chain that this collection will contain.
- int handleEvents(fd_set fdSet)
This method will go and call handle event on all of the objects in
the object chain. This means that the handleEvent method for each
object should check to see if it's own file descriptor has been set
before it does anything.
Overview Object List Object Hierarchy
Sample Apps