#include <abstractprocessor.h>
Inheritance diagram for rGeddei::AbstractProcessor:
Public Member Functions | |
virtual const bool | connect (const uint sourceIndex, const LocalProcessor *sink, const uint sinkIndex, const uint bufferSize=1)=0 |
virtual const bool | connect (const uint sourceIndex, const RemoteProcessor *sink, const uint sinkIndex, const uint bufferSize=1)=0 |
virtual void | disconnect (const uint sourceIndex)=0 |
virtual void | disconnectAll ()=0 |
virtual const bool | go ()=0 |
void | init (const QString &name="", const Properties &p=Properties()) |
void | init (const QString &name, AbstractProcessorGroup &g, const Properties &p=Properties()) |
virtual const QString | name () const=0 |
AbstractProcessorPort | operator[] (const uint port) |
virtual void | reset ()=0 |
void | setGroup (AbstractProcessorGroup &g) |
void | setNoGroup () |
virtual void | share (const uint sourceIndex)=0 |
virtual void | split (const uint sourceIndex)=0 |
virtual void | stop ()=0 |
virtual void | waitUntilDone ()=0 |
virtual const Processor::ErrorType | waitUntilGoing (int *errorData=0)=0 |
Static Public Member Functions | |
static RemoteProcessor * | create (RemoteSession &session, const QString &type) |
static LocalProcessor * | create (LocalSession &session, const QString &type) |
static LocalProcessor * | create (LocalSession &session, Processor *processor) |
static LocalProcessor * | create (LocalSession &session, Processor &processor) |
Protected Member Functions | |
virtual void | doInit (const QString &name, AbstractProcessorGroup *g, const Properties &p)=0 |
The AbstractProcessor class is the result of the powerful abstaction technique in rGeddei. It defines an interface to both Geddei Processor objects that reside inside this session (i.e. LocalProcessor objects) and Geddei Processor objects that reside in sessions that are non-local (i.e. RemoteProcessor objects).
Because both LocalProcessor objects and RemoteProcessor objects are derived from AbstractProcessor objects they can be used whereever an AbstractProcessor pointer is called for.
You might like to think of an AbstractProcessor object as a proxy or representative of a real Geddei Processor object. An AbstractProcessor has no actual "guts" - it is merely an abstract container, or a location transparent pointer to a real Processor object.
virtual const bool rGeddei::AbstractProcessor::connect | ( | const uint | sourceIndex, | |
const LocalProcessor * | sink, | |||
const uint | sinkIndex, | |||
const uint | bufferSize = 1 | |||
) | [pure virtual] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Attempts to create a connection between the Processor object this represents and another LocalProcessor object.
The connection will be formed between the output port of index sourceIndex of the Processor object this represents and the input port sinkIndex of the Processor represented by the LocalProcessor sink.
sourceIndex | The index of the output port on this side of the connection. | |
sink | The LocalProcessor object to whose Processor object we wish to connect. | |
sinkIndex | The index of the input port on the opposite side of the connection. | |
bufferSize | A minimum size of Buffer. Leave this at 1 unless you have a good reason not to. |
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
virtual const bool rGeddei::AbstractProcessor::connect | ( | const uint | sourceIndex, | |
const RemoteProcessor * | sink, | |||
const uint | sinkIndex, | |||
const uint | bufferSize = 1 | |||
) | [pure virtual] |
Attempts to create a connection between the Processor object this represents and another RemoteProcessor object.
The connection will be formed between the output port of index sourceIndex of the Processor object this represents and the input port sinkIndex of the Processor represented by the RemoteProcessor sink.
sourceIndex | The index of the output port on this side of the connection. | |
sink | The RemoteProcessor object to whose Processor object we wish to connect. | |
sinkIndex | The index of the input port on the opposite side of the connection. | |
bufferSize | A minimum size of Buffer. Leave this at 1 unless you have a good reason not to. |
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
RemoteProcessor * rGeddei::AbstractProcessor::create | ( | RemoteSession & | session, | |
const QString & | type | |||
) | [static] |
Constructs a RemoteProcessor object together with a Processor object in the RemoteSession (i.e. on that object's host).
session | The RemoteSession under which to create the Processor object. | |
type | The Processor-derived subclass to be created. You should check the availability and version with the RemoteSession object before construction. |
Reimplemented in rGeddei::AbstractDomProcessor.
LocalProcessor * rGeddei::AbstractProcessor::create | ( | LocalSession & | session, | |
const QString & | type | |||
) | [static] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Constructs a LocalProcessor object together with its associated (and owned) Processor object.
session | The LocalSession under which to create the Processor object. | |
type | The Processor-derived subclass to be created. The resident ProcessorFactory singleton will be used for creation, so the Processor derived subclass must be available as a plugin. |
Reimplemented in rGeddei::AbstractDomProcessor.
LocalProcessor * rGeddei::AbstractProcessor::create | ( | LocalSession & | session, | |
Processor * | processor | |||
) | [static] |
Constructs a LocalProcessor object that adopts the given Processor object.
AbstractProcessor *l = AbstractProcessor::create( mySession, new MyCustomProcessorSubClass);
session | The LocalSession under which to create the Processor object. | |
processor | A pointer to the processor which this LocalProcessor object will take ownership. |
LocalProcessor * rGeddei::AbstractProcessor::create | ( | LocalSession & | session, | |
Processor & | processor | |||
) | [static] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Constructs a LocalProcessor object that uses, but does not adopt the given Processor object.
Example:
MyCustomProcessor p; AbstractProcessor *a = AbstractProcessor::create(mySession, p); // Correct: l.init(); // Wrong: //p.init(); delete a;
session | The LocalSession under which to create the Processor object. | |
processor | A reference to the processor which this LocalProcessor object will... |
virtual void rGeddei::AbstractProcessor::disconnect | ( | const uint | sourceIndex | ) | [pure virtual] |
Disguard all connections going from a given port (generally only one, unless the port has a split() or share() operation carried out on it).
sourceIndex | The output port from whom all connection are to be destroyed. |
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
virtual void rGeddei::AbstractProcessor::disconnectAll | ( | ) | [pure virtual] |
Disguard all connections going from this object.
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
virtual const bool rGeddei::AbstractProcessor::go | ( | ) | [pure virtual] |
Sends a message to the Processor object that this represents, telling it to start.
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
void rGeddei::AbstractProcessor::init | ( | const QString & | name = "" , |
|
const Properties & | p = Properties() | |||
) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Initialises the Processor object this represents.
This Processor object will not initially belong to any group.
name | is the unique name the Processor object this represents is given. If an empty string(default) then a unique name will be created. Never specifiy a non-unique (session-wide) name! | |
p | defines the Properties the object this represents is initialised with. |
void rGeddei::AbstractProcessor::init | ( | const QString & | name, | |
AbstractProcessorGroup & | g, | |||
const Properties & | p = Properties() | |||
) | [inline] |
Initialises the Processor object this represents.
name | is the unique name (application-wide) you may refer to this object by with the AbstractProcessorGroup. | |
g | is the AbstractProcessorGroup it will belong to. | |
p | defines the Properties the object this represents is initialised with. |
virtual const QString rGeddei::AbstractProcessor::name | ( | ) | const [pure virtual] |
Retreive the unique identifier of this object.
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
AbstractProcessorPort rGeddei::AbstractProcessor::operator[] | ( | const uint | port | ) | [inline] |
Returns convenience object that represents one of the Processor object's input/outputs. It can be used for creating connections in a simple manner.
port | The index of the port that you wish to reference. |
virtual void rGeddei::AbstractProcessor::reset | ( | ) | [pure virtual] |
Sends a message to the Processor object that this represents, telling it to reset.
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
void rGeddei::AbstractProcessor::setGroup | ( | AbstractProcessorGroup & | g | ) |
Sets the AbstractProcessorGroup that this object is a member of g. If this object is already a member of another group it will first be removed before joining g .
g | The group this AbstractProcessor is to become a member of. |
void rGeddei::AbstractProcessor::setNoGroup | ( | ) |
Resets the group of this object. The AbstractProcessor will not be associated with any group after this call.
virtual void rGeddei::AbstractProcessor::share | ( | const uint | sourceIndex | ) | [pure virtual] |
Sends a message to the Processor object that this represents, telling it to share the output port sourceIndex.
sourceIndex | The output port index to be share. |
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
virtual void rGeddei::AbstractProcessor::split | ( | const uint | sourceIndex | ) | [pure virtual] |
Sends a message to the Processor object that this represents, telling it to split the output port sourceIndex.
sourceIndex | The output port index to be split. |
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
virtual void rGeddei::AbstractProcessor::stop | ( | ) | [pure virtual] |
Sends a message to the Processor object that this represents, telling it to stop.
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
virtual void rGeddei::AbstractProcessor::waitUntilDone | ( | ) | [pure virtual] |
Sends a message to the Processor object that this represents, telling it to wait until the processor() operation has completed.
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.
virtual const Processor::ErrorType rGeddei::AbstractProcessor::waitUntilGoing | ( | int * | errorData = 0 |
) | [pure virtual] |
Sends a message to the Processor object that this represents, telling it to wait until the start() operation has completed.
errorData | Pointer to an integer, which if non-zero will be filled with some data pertaining to the error (if any) that occured in starting the Processor object. |
Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.