Geddei::ProcessorPort Class Reference
[Geddei's core classes.]

Model of a Processor connection port. More...

#include <processorport.h>

Collaboration diagram for Geddei::ProcessorPort:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void connect (MultiProcessor &input) const
void connect (const ProcessorPort &input) const
void disconnect () const
void operator-- (int) const
void operator>>= (MultiProcessor &input) const
void operator>>= (const ProcessorPort &input) const
ProcessorPortsetSize (const uint bufferSize)
void share () const
void split () const

Friends

class Processor

Detailed Description

Model of a Processor connection port.

Author:
Gav Wood <gav@cs.york.ac.uk>
This is a convenience class meant primarily as an adjunct to the Processor class to allow subscripting (['s and ]'s) to be used to manage connections.

See the operators and methods for more information about general use.

Note:
There is no difference between input and output ports in ProcessorPort. A ProcessorPort object determines use depending on context.


Member Function Documentation

void Geddei::ProcessorPort::connect ( const ProcessorPort input  )  const

Assert that this port represents an output port, and create a connection between it and input (asserted as an input port).

Example, given P and Q are Processor subclass objects, P with two output ports and Q with two input ports:

 P[0].connect(Q[0]);
 P[1].connect(Q[1]);

Parameters:
input ProcessorPort object which, it is asserted describes an input port.
See also:
disconnect()

void Geddei::ProcessorPort::disconnect (  )  const

Assert that this port represents an output port and delete the connection it is sourcing.

Example, given P and Q are Processor subclass objects:

 P[0].connect(Q[0]);
 // Do some processing...
 P[0].disconnect();

See also:
connect()

void Geddei::ProcessorPort::operator-- ( int   )  const [inline]

Shorthand operator for disconnecting. Does the same as the disconnect() method.

Example, given P and Q are Processor subclass objects:

 P[0].connect(Q[0]);
 // Do some processing...
 P[0]--;

See also:
disconnect()

void Geddei::ProcessorPort::operator>>= ( MultiProcessor input  )  const [inline]

Shorthand operator for connecting to a multiprocessor. Does the same as the connect() method. This will share the stream and connect each to the MultiProcessor's inputs. The MultiProcessor must already know its multiplicity.

This port must not already be connected, split or shared.

Example, given P is a Processor subclass object, Q is a MultiProcessor:

 P[0] >>= Q;
 // Do some processing...
 P[0].disconnect();

Parameters:
input MultiProcessor object.
See also:
connect()

void Geddei::ProcessorPort::operator>>= ( const ProcessorPort input  )  const [inline]

Shorthand operator for connecting. Does the same as the connect() method.

Example, given P and Q are Processor subclass objects:

 P[0] >>= Q[0];
 // Do some processing...
 P[0].disconnect();

Parameters:
input ProcessorPort object which, it is asserted describes an input port.
See also:
connect()

ProcessorPort & Geddei::ProcessorPort::setSize ( const uint  bufferSize  ) 

Set a minimum size for the buffer (in elements).

This method rarely needs to be used. It is generally considered the job of the Processor subclass to determine how much buffer space if needed, however this method may be used in some extreme cases to tweak buffer usage in the case that a particular amount of high-speed memory is available.

Ignore this otherwise.

Parameters:
bufferSize The minimum number of elements to be used for this connection's buffer.
Returns:
A reference to this object.
See also:
Processor::specifyInputSpace()

Processor::specifyOutputSpace()

void Geddei::ProcessorPort::share (  )  const

Share the output of a Processor object.

See Processor::share() for more details.

Example, given P, Q, R are Processor subclass objects:

 // Share the first output port of P
 P[0].share();
 // Connect the first output port of P to the first input port of Q
 P[0].connect(Q[0]);
 // Connect the same output to the second port of Q
 P[0].connect(Q[1]);
 // Connect the same output to the first port of R
 P[0].connect(R[0]);

void Geddei::ProcessorPort::split (  )  const

Split the output of a Processor object.

See Processor::split() for more details.

Example, given P, Q are Processor subclass objects:

 // Share the first output port of P
 P[0].split();
 // Connect the first output port of P to the first input port of Q
 P[0].connect(Q[0]);
 // Connect the same output to the second port of Q
 P[0].connect(Q[1]);
 // Connect the same output to the first input of some remote Processor
 P.connect(0, someRemoteHost, someRemoteKey, someProcessorsName, 0);


The documentation for this class was generated from the following files:
Generated on Fri Nov 10 21:58:35 2006 for Exscalibar by  doxygen 1.5.1