Inlets and Outlets are objects which manage the incoming and outgoing parameters of pipeline modules.
Every module has either inlets or outlets and some have both. Filters have both inlets and outlets; sources have outlets only; sinks only have inlets. The methods for managing inlets and outlets are identical for all types of modules.
Modules with a fixed set of inlets and outlets are the easiest to implement. Usually inlets and outlets of specific types are created inside a module's constructor and then added to the module's internal list of inlets and outlets using the method AddInlet() or AddOutlet() as follows:
void AddInlet(PDLInlet* inlet); void AddOutlet(PDLOutlet* outlet);
Once a module has some inlets and outlets, the number of them can be determined by the method NumInlets() or NumOutlets(). Also, a specific inlet or outlet can be retrieved by name using FindInlet() or FindOutlet() as follows:
int NumInlets(); int NumOutlets(); PDLInlet* FindInlet(const char* name); PDLOutlet* FindOutlet(const char* name);
Some modules require a variable set of inlets and outlets as specified in the module's text definition. Modules of this type use AddNewInlet() or AddNewOutlet() in conjunction with InstallNewInlets() or InstallNewOutlets().
void AddNewInlet(PDLInlet* inlet); void AddNewOutlet(PDLOutlet* outlet); void InstallNewInlets(); void InstallNewOutlets();
AddNewInlet() and AddNewOutlet() place an inlet or outlet on an internal holding list. When the corresponding method InstallNewInlets() or InstallNewOutlets() is called, all old inlets or outlets are cleared and replaced by the new ones.