FilterData.h File Reference

#include "FilterDev.h"
#include <Task/Task.h>
#include "Ports.h"
#include "constants.h"

Include dependency graph for FilterData.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _LibData_
 the information about the library of the filter More...
struct  __FilterData__
 the data that filter needs to run More...

Typedefs

typedef _LibData_ LibData
 the information about the library of the filter
typedef __FilterData__ FilterData
 the data that filter needs to run

Functions

FilterDatacreateFilterData ()
 constructor
void destroyFilterData (FilterData *fd)
 destroyer
int recvFilterData ()
 when the filter runs this, hell receive all data he needs to run the pipeline
void runFilter ()
 runs the filter
int setFDName (FilterData *fd, char *name)
 Sets the name of filter.
int setFDHostName (FilterData *fd, char *hostName)
 Sets the name of the machine where the filter is runnig.
int setFDNumInputs (FilterData *fd, int numInp)
 Sets the number of inputs of the filter.
int setFDNumOutputs (FilterData *fd, int numOut)
 Sets the number of output.
int setFDLibName (FilterData *fd, char *libName)
 Sets the libname of the filter: Used to load the filter.
int setFDMachineMem (FilterData *fd, int mem)
 sets the machine memory declared inside the XML file
int setFDLocalInstances (FilterData *fd, int numLocalInst)
 sets the number of instances this filter has in current machine
int setFDNumInstances (FilterData *fd, int numInstances)
 Sets the number of instances of this type of filter.
void setFDRank (FilterData *fd, int rank)
 Sets the rank of this instance in his set of filters.
void setFDIdFilter (FilterData *fd, int id)
 Sets the id of this filter - unique for all filters.
void setFDTids (FilterData *fd, int *tids)
 sets the tids of this filter, mine and brothers
int getFDMachineMem (FilterData *fd)
 Gets the ammount of memory the machine this filter runs on has.
int getFDLocalInstances (FilterData *fd)
 get the number of brothers I have in this same machine
char * getFDName (FilterData *fd)
 Gets the name of filter.
int getFDNumInstances (FilterData *fd)
 Gets the number of instances of this type of filter.
int addFDInputPort (FilterData *fd, InputPort *p)
 adds another inputPort to filteData: we only point to InputPort received -- dont free it
int addFDOutputPort (FilterData *fd, OutputPort *p)
 adds another OutputPort to filteData: we only point to OutputPort received -- dont free it
int loadFDLibFunctions (FilterData *fd)
 this function loads the filter libraries(init process finalize)

Variables

FilterDatafd
 Global variable that points to data of filter.


Typedef Documentation

typedef struct __FilterData__ FilterData
 

the data that filter needs to run

typedef struct _LibData_ LibData
 

the information about the library of the filter


Function Documentation

int addFDInputPort FilterData fd,
InputPort p
 

adds another inputPort to filteData: we only point to InputPort received -- dont free it

Definition at line 202 of file FilterData.c.

References __FilterData__::inputPorts, MAXINPSTREAMS, and __FilterData__::numInportsAdded.

int addFDOutputPort FilterData fd,
OutputPort p
 

adds another OutputPort to filteData: we only point to OutputPort received -- dont free it

Definition at line 214 of file FilterData.c.

References MAXOUTSTREAMS, __FilterData__::numOutportsAdded, and __FilterData__::outputPorts.

Referenced by recvFilterData().

FilterData* createFilterData  ) 
 

constructor

Definition at line 51 of file FilterData.c.

References instCreate(), MAX_HNAME_LENGTH, __FilterData__::numInportsAdded, __FilterData__::numInputPorts, __FilterData__::numOutportsAdded, __FilterData__::numOutputPorts, and trcCreateData().

Referenced by runFilter().

Here is the call graph for this function:

void destroyFilterData FilterData fd  ) 
 

destroyer

Todo:
Only free FilterData. Needs to free input e output port.

Definition at line 82 of file FilterData.c.

References destroyInputPort(), __FilterData__::inputPorts, __FilterData__::libdata, _LibData_::libHandler, and __FilterData__::numInputPorts.

Here is the call graph for this function:

int getFDLocalInstances FilterData fd  ) 
 

get the number of brothers I have in this same machine

Definition at line 317 of file FilterData.c.

References __FilterData__::numLocalInstances.

Referenced by dsGetLocalInstances().

int getFDMachineMem FilterData fd  ) 
 

Gets the ammount of memory the machine this filter runs on has.

Definition at line 308 of file FilterData.c.

References __FilterData__::memory.

Referenced by dsGetMachineMemory().

char* getFDName FilterData fd  ) 
 

Gets the name of filter.

Definition at line 132 of file FilterData.c.

References __FilterData__::name.

int getFDNumInstances FilterData fd  ) 
 

Gets the number of instances of this type of filter.

Definition at line 168 of file FilterData.c.

References __FilterData__::numInstances.

int loadFDLibFunctions FilterData fd  ) 
 

this function loads the filter libraries(init process finalize)

Definition at line 241 of file FilterData.c.

References error, _LibData_::finalize, _LibData_::init, __FilterData__::libdata, _LibData_::libHandler, _LibData_::name, and _LibData_::process.

Referenced by recvFilterData().

int recvFilterData  ) 
 

when the filter runs this, hell receive all data he needs to run the pipeline

Returns:
1 if all goes well, -1 if an error is found

void runFilter  ) 
 

runs the filter

Todo:
An error ocourred! We should notify manager of this!!
Bug:
Resetting the ports even before receiving the UOW ISN'T SAFE. Before we even recieve the UOW, the other filters can already started to run and sending valid data to this filter. The only safe way is: send EOW at the end of finalizeFilter() and only drain data from the channels that doesn't recieved a EOW until recieve it
if the message type is end of filter, which means, all done

Todo:
put a signal handler to clean the cache on SIGTERM recievement
used to notify manager this filter ended its work

Definition at line 563 of file FilterData.c.

References createFilterData(), initTerminationDetection(), __FilterData__::inputPorts, __FilterData__::numInputPorts, __FilterData__::numOutputPorts, __FilterData__::outputPorts, recvFilterData(), resetInputPort(), resetOutputPort(), and tdd.

Referenced by initDs().

Here is the call graph for this function:

int setFDHostName FilterData fd,
char *  hostName
 

Sets the name of the machine where the filter is runnig.

Definition at line 153 of file FilterData.c.

References __FilterData__::hostName, and MAX_HNAME_LENGTH.

Referenced by recvFilterData().

void setFDIdFilter FilterData fd,
int  id
 

Sets the id of this filter - unique for all filters.

Definition at line 185 of file FilterData.c.

References __FilterData__::id.

Referenced by recvFilterData().

int setFDLibName FilterData fd,
char *  libName
 

Sets the libname of the filter: Used to load the filter.

Definition at line 225 of file FilterData.c.

References __FilterData__::libdata, MAX_LNAME_LENGTH, and _LibData_::name.

Referenced by recvFilterData().

int setFDLocalInstances FilterData fd,
int  numLocalInst
 

sets the number of instances this filter has in current machine

int setFDMachineMem FilterData fd,
int  mem
 

sets the machine memory declared inside the XML file

Todo:
Read memory. Now its hardcoded to 512MB

Definition at line 295 of file FilterData.c.

References __FilterData__::memory.

Referenced by recvFilterData().

int setFDName FilterData fd,
char *  name
 

Sets the name of filter.

Definition at line 137 of file FilterData.c.

References MAX_FNAME_LENGTH, and __FilterData__::name.

Referenced by recvFilterData().

int setFDNumInputs FilterData fd,
int  numInp
 

Sets the number of inputs of the filter.

Definition at line 118 of file FilterData.c.

References MAXINPSTREAMS, and __FilterData__::numInputPorts.

Referenced by recvFilterData().

int setFDNumInstances FilterData fd,
int  numInstances
 

Sets the number of instances of this type of filter.

Definition at line 172 of file FilterData.c.

References MAXINSTANCES, and __FilterData__::numInstances.

Referenced by recvFilterData().

int setFDNumOutputs FilterData fd,
int  numOut
 

Sets the number of output.

Definition at line 126 of file FilterData.c.

References __FilterData__::numOutputPorts.

Referenced by recvFilterData().

void setFDRank FilterData fd,
int  rank
 

Sets the rank of this instance in his set of filters.

Definition at line 180 of file FilterData.c.

References __FilterData__::myRank.

Referenced by recvFilterData().

void setFDTids FilterData fd,
int *  tids
 

sets the tids of this filter, mine and brothers

Definition at line 190 of file FilterData.c.

References __FilterData__::numInstances, and __FilterData__::tids.

Referenced by recvFilterData().


Variable Documentation

FilterData* fd
 

Global variable that points to data of filter.

Referenced by dsCloseOutputPort(), dsCreateTask(), dsEndTask(), dsExit(), dsGetCurrentTask(), dsGetFilterId(), dsGetFilterName(), dsGetInputPortByName(), dsGetInputPortNames(), dsGetLocalInstances(), dsGetMachineMemory(), dsGetMyRank(), dsGetNumInputPorts(), dsGetNumOutputPorts(), dsGetNumReaders(), dsGetNumUpStreamsRunning(), dsGetNumWriters(), dsGetOutputPortByName(), dsGetOutputPortNames(), dsGetTotalInstances(), dsInitPack(), dsInitReceive(), dsInstEnterState(), dsInstLeaveState(), dsInstSetStates(), dsInstSwitchState(), dsMCast(), dsPackData(), dsProbe(), dsReadBuffer(), dsReadNonBlockingBuffer(), dsSend(), dsSetCurrentTask(), dsUnpackData(), dsWriteBuffer(), dsWritePackedBuffer(), endTaskSend(), initTerminationDetection(), and taskSend().


Generated on Tue Jan 17 19:20:21 2006 for Void by  doxygen 1.4.6