rGeddei::AbstractProcessor Class Reference
[rGeddei's core classes.]

Abstract interface class for handling Geddei Processor objects. More...

#include <abstractprocessor.h>

Inheritance diagram for rGeddei::AbstractProcessor:

Inheritance graph
[legend]
Collaboration diagram for rGeddei::AbstractProcessor:

Collaboration graph
[legend]
List of all members.

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 RemoteProcessorcreate (RemoteSession &session, const QString &type)
static LocalProcessorcreate (LocalSession &session, const QString &type)
static LocalProcessorcreate (LocalSession &session, Processor *processor)
static LocalProcessorcreate (LocalSession &session, Processor &processor)

Protected Member Functions

virtual void doInit (const QString &name, AbstractProcessorGroup *g, const Properties &p)=0

Detailed Description

Abstract interface class for handling Geddei Processor objects.

Author:
Gav Wood <gav@cs.york.ac.uk>
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.


Member Function Documentation

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 .

Parameters:
g The group this AbstractProcessor is to become a member of.
Note:
Unlike other methods, this operation concerns this object, not the Processor that it represents.
See also:
setNoGroup()

void rGeddei::AbstractProcessor::setNoGroup (  ) 

Resets the group of this object. The AbstractProcessor will not be associated with any group after this call.

Note:
Unlike other methods, this operation concerns this object, not the Processor that it represents.
For internal concern: This should be made at the end of any derived types' destructors.

See also:
setGroup()

virtual const bool rGeddei::AbstractProcessor::go (  )  [pure virtual]

Sends a message to the Processor object that this represents, telling it to start.

Returns:
true iff the Processor was primed to start OK.
See also:
Geddei::Processor::go()

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.

Parameters:
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.
Returns:
A Geddei::Processor::ErrorType value describing the type of error (if any that occured in starting the Processor object.
See also:
Geddei::Processor::waitUntilGoing()

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.

See also:
Geddei::Processor::waitUntilDone()

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.

See also:
Geddei::Processor::stop()

Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.

virtual void rGeddei::AbstractProcessor::reset (  )  [pure virtual]

Sends a message to the Processor object that this represents, telling it to reset.

See also:
Geddei::Processor::reset()

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.

Parameters:
sourceIndex The output port index to be split.
See also:
Geddei::Processor::split()

Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.

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.

Parameters:
sourceIndex The output port index to be share.
See also:
Geddei::Processor::share()

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.

Parameters:
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.
Returns:
true if the connection succeeded.
See also:
Geddei::Processor::connect()

Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.

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.

Parameters:
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.
Returns:
true if the connection succeeded.
See also:
Geddei::Processor::connect()

Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.

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).

Parameters:
sourceIndex The output port from whom all connection are to be destroyed.
See also:
Geddei::Processor::disconnect()

Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.

virtual void rGeddei::AbstractProcessor::disconnectAll (  )  [pure virtual]

Disguard all connections going from this object.

See also:
Geddei::Processor::disconnectAll()

Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.

virtual const QString rGeddei::AbstractProcessor::name (  )  const [pure virtual]

Retreive the unique identifier of this object.

Returns:
The name of the Processor object this represents, and by extension, this object.
See also:
Geddei::Processor::name()

Implemented in rGeddei::LocalProcessor, and rGeddei::RemoteProcessor.

void rGeddei::AbstractProcessor::init ( const QString &  name,
AbstractProcessorGroup g,
const Properties p = Properties() 
) [inline]

Initialises the Processor object this represents.

Parameters:
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.

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.

Parameters:
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.
The processor will not initially be a member of any group.

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.

Parameters:
port The index of the port that you wish to reference.
Returns:
A ProcessorPort object that refers to the given i/o port. Due to the linearity of the parameter, input and output cannot be differentiated here and is instead left to later on in its usage for clarification.

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.

Note:
This object will not take ownership of processor . You must delete it when finished with.
However, you should not attempt to control any of the base Geddei functionality directly. Use this class for that control instead.

Example:

 MyCustomProcessor p;
 AbstractProcessor *a = AbstractProcessor::create(mySession, p);

 // Correct:
 l.init();

 // Wrong:
 //p.init();
 
 delete a;

Parameters:
session The LocalSession under which to create the Processor object.
processor A reference to the processor which this LocalProcessor object will...

LocalProcessor * rGeddei::AbstractProcessor::create ( LocalSession session,
Processor processor 
) [static]

Constructs a LocalProcessor object that adopts the given Processor object.

Note:
This object will take ownership of processor . You should not attempt to delete it or other control any of the base Geddei functionality. Use this class for that control instead. Typically you will use this constructor with a "new" operator:
 AbstractProcessor *l = AbstractProcessor::create(
     mySession, new MyCustomProcessorSubClass);

Parameters:
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,
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.

Parameters:
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.

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).

Parameters:
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.


The documentation for this class was generated from the following files:
Generated on Thu Jul 13 06:56:48 2006 for Exscalibar by  doxygen 1.4.7