PiPo
Plug In Plug Out / Plugin Interface for Processing Objects
PiPoChain Class Reference

#include <PiPoHost.h>

Inheritance diagram for PiPoChain:
PiPoSequence PiPo mimo_host

Public Member Functions

 PiPoChain (PiPo::Parent *parent, PiPoModuleFactory *moduleFactory=NULL)
 
 PiPoChain (const PiPoChain &other)
 
const PiPoChainoperator= (const PiPoChain &other)
 
PiPoChain setup methods
void clear ()
 
size_t parse (const char *str)
 
bool instantiate (void)
 
void copyPiPoAttributes ()
 
PiPoChain query methods
int getSize ()
 
int getIndex (const char *instanceName)
 
PiPogetPiPo (const char *instanceName)
 
const char * getInstanceName (unsigned int index)
 
- Public Member Functions inherited from PiPoSequence
 PiPoSequence (PiPo::Parent *parent)
 
 PiPoSequence (const PiPoSequence &other)
 
const PiPoSequenceoperator= (const PiPoSequence &other)
 
void add (PiPo *pipo, bool autoconnect=true)
 
void add (PiPo &pipo, bool autoconnect=true)
 
void clear ()
 
bool connect (PiPo *receiver)
 
int getSize () const
 
PiPogetHead () const
 
PiPogetTail () const
 
PiPogetPiPo (unsigned int index) const
 
void setParent (PiPo::Parent *parent)
 Sets PiPo parent. More...
 
void setReceiver (PiPo *receiver, bool add=false)
 Sets a PiPo modules receiver (call only by the PiPo host) More...
 
int streamAttributes (bool hasTimeTags, double rate, double offset, unsigned int width, unsigned int height, const char **labels, bool hasVarSize, double domain, unsigned int maxFrames)
 
int reset ()
 Resets processing (optional) More...
 
int frames (double time, double weight, PiPoValue *values, unsigned int size, unsigned int num)
 Processes a single frame or a block of frames. More...
 
int finalize (double inputEnd)
 Finalizes processing (optinal) More...
 
- Public Member Functions inherited from PiPo
 PiPo (Parent *parent, PiPo *receiver=NULL)
 
 PiPo (const PiPo &other)
 
int propagateStreamAttributes (bool hasTimeTags, double rate, double offset, unsigned int width, unsigned int height, const char **labels, bool hasVarSize, double domain, unsigned int maxFrames)
 Propagates a module's output stream attributes to its receiver. More...
 
int propagateReset (void)
 Propagates the reset control event. More...
 
int propagateFrames (double time, double weight, PiPoValue *values, unsigned int size, unsigned int num)
 Propagates a module's output frames to its receiver. More...
 
int propagateFinalize (double inputEnd)
 Propagates the finalize control event. More...
 
virtual PiPogetReceiver (unsigned int index=0)
 Gets a PiPo modules receiver (call only by the PiPo host) More...
 
virtual int segment (double time, bool start)
 Signals segment start or end. More...
 
void streamAttributesChanged (Attr *attr)
 
void signalError (std::string errorMsg)
 
void signalWarning (std::string errorMsg)
 
void addAttr (PiPo *pipo, const char *name, const char *descr, Attr *attr, bool clear=false)
 att attribute
 
AttrgetAttr (unsigned int index)
 Gets PiPo attribute by index. More...
 
AttrgetAttr (const char *name)
 Gets PiPo attribute by name. More...
 
AttrgetAttr (const char *piponame, const char *name)
 Gets PiPo attribute by qualified name. More...
 
bool setAttr (unsigned int index, int value, bool silently=false)
 
bool setAttr (unsigned int index, int *values, unsigned int numValues, bool silently=false)
 
bool setAttr (unsigned int index, double val, bool silently=false)
 
bool setAttr (unsigned int index, double *values, unsigned int numValues, bool silently=false)
 
unsigned int getNumAttrs (void)
 Gets number of attributes. More...
 
void cloneAttrs (PiPo *other)
 Copies current parent and attributes values. More...
 
void cloneAttr (PiPo::Attr *attr)
 Copies current value(s) of given attribute. More...
 

Additional Inherited Members

- Public Types inherited from PiPo
enum  Type {
  Undefined, Bool, Enum, Int,
  Float, Double, String
}
 
enum  Enumerate
 
- Static Public Member Functions inherited from PiPo
static float getVersion ()
 
- Protected Attributes inherited from PiPo
Parentparent
 
std::vector< PiPo * > receivers
 
std::vector< Attr * > attrs
 

Detailed Description

A PiPo host is built around the class PiPoChain that represents a sequence of PiPo modules piping data into each other.

The PiPoChain is setup with the following steps:

  1. parse chain definition string by calling parse()
  2. instantiate each PiPoModule in the chain by calling instantiate(), using a PiPoModuleFactory
  3. connect PiPos by calling PiPoSequence::connect()

A PiPoChain is itself also a PiPo module, i.e. data processing works the same as for a simple module:

The host registers as the receiver for the last PiPo module in the PiPoChain.

Member Function Documentation

◆ instantiate()

bool PiPoChain::instantiate ( void  )
inline

go through list of PiPoOp in ops and instantiate PiPoModule using PiPoModuleFactory

◆ parse()

size_t PiPoChain::parse ( const char *  str)
inline

parse pipo chain specification from string

creates list of PiPoOp in member ops