VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
DtInputPort Class Reference

Instances of DtInputPort are are data ports owned by data consumers. More...

Inheritance diagram for DtInputPort:
Inheritance graph
[legend]

Public Member Functions

 DtInputPort (const DtString &portName)
 Constructor.
virtual ~DtInputPort ()
 Destructor.
virtual const DtStringname () const
 Returns the name string of this port.
virtual bool acceptType (const DtString &type) const =0
 Returns true if this port should accept the recipt of the specified DtPortData type.
virtual void receiveData (DtPortData *data, const DtPortConnection *connection)=0
 clones the specified DtPortData into myData, and sets the newDataFlag to true.
virtual bool attemptToActivateConnection (DtPortConnection *conn, int connectionPriority)=0
 Attempt to make this connection the active connection providing data to this port with the specified priority.
virtual bool canActivate (const DtPortConnection *conn, int connectionPriority) const =0
 Checks if this connection can be the active connection.
virtual void deactivateConnection (DtPortConnection *conn)=0
 Deactivate conn if it is currently active.
virtual bool activeConnection () const =0
 Returns true if there is an active connection into this port.
virtual bool connectionActive (const DtPortConnection *connection) const =0
 Returns true if the specified connection is currently active.
virtual int connectionPriority () const =0
 Returns the current connection priority.
virtual void addConnection (DtPortConnection *conn)
 Add an incomming connection to this port.
virtual void removeConnection (DtPortConnection *conn)
 Remove an incomming connection to this port.
virtual const DtList * connectionList () const
 Returns the list of input connections to this port.
virtual bool newData () const
 Returns true if there is new data on this port that has not been received.
virtual void dataReceived ()
 Clears the newData flag on this port.
virtual bool enabled () const
 Enables/disables the port.
virtual void setEnabled (bool flag)
 Enables/disables the port.

Protected Attributes

DtString myName
bool myNewDataFlag
bool myEnabled
DtList myConnectionList

Private Member Functions

 DtInputPort ()
 Not implemented.
 DtInputPort (const DtInputPort &)
 Not implemented.
DtInputPortoperator= (const DtInputPort &)
 Not implemented.

Detailed Description

Instances of DtInputPort are are data ports owned by data consumers.

They receive data from a DtPortConnection, and make that data available to the user of the input port. Users of the port should call newData() to check if new data has arrived on this port, and then call dataReceived() to signal that they have received and processed the data currently on the port.

This is an abstract base class. Derived types must provide the implementation for activating and deactivating connetions and accepting data from connections.

DtSingleConnectionInputPort and DtMultiConnectionInputPort implement this functionallity for different mechanisms of accepting data.

Note
Any types which derived from DtInputPort in VR-Forces versions 3.8 and earlier should be changed to derive from DtSingleConnectionInputPort to work with VR-Forces 3.9 and later.

Constructor & Destructor Documentation

DtInputPort::DtInputPort ( const DtString portName)

Constructor.

virtual DtInputPort::~DtInputPort ( )
virtual

Destructor.

DtInputPort::DtInputPort ( )
private

Not implemented.

DtInputPort::DtInputPort ( const DtInputPort )
private

Not implemented.

Member Function Documentation

DtInputPort& DtInputPort::operator= ( const DtInputPort )
private

Not implemented.

virtual const DtString& DtInputPort::name ( ) const
virtual

Returns the name string of this port.

virtual bool DtInputPort::acceptType ( const DtString type) const
pure virtual
virtual void DtInputPort::receiveData ( DtPortData data,
const DtPortConnection connection 
)
pure virtual

clones the specified DtPortData into myData, and sets the newDataFlag to true.

Implemented in DtMultiConnectionInputPort, and DtSingleConnectionInputPort.

virtual bool DtInputPort::attemptToActivateConnection ( DtPortConnection conn,
int  connectionPriority 
)
pure virtual

Attempt to make this connection the active connection providing data to this port with the specified priority.

Returns true if the activation was successful.

Implemented in DtMultiConnectionInputPort, and DtSingleConnectionInputPort.

virtual bool DtInputPort::canActivate ( const DtPortConnection conn,
int  connectionPriority 
) const
pure virtual

Checks if this connection can be the active connection.

Implemented in DtMultiConnectionInputPort, and DtSingleConnectionInputPort.

virtual void DtInputPort::deactivateConnection ( DtPortConnection conn)
pure virtual

Deactivate conn if it is currently active.

Implemented in DtMultiConnectionInputPort, and DtSingleConnectionInputPort.

virtual bool DtInputPort::activeConnection ( ) const
pure virtual

Returns true if there is an active connection into this port.

Implemented in DtMultiConnectionInputPort, and DtSingleConnectionInputPort.

virtual bool DtInputPort::connectionActive ( const DtPortConnection connection) const
pure virtual

Returns true if the specified connection is currently active.

Implemented in DtMultiConnectionInputPort, and DtSingleConnectionInputPort.

virtual int DtInputPort::connectionPriority ( ) const
pure virtual

Returns the current connection priority.

Implemented in DtMultiConnectionInputPort, and DtSingleConnectionInputPort.

virtual void DtInputPort::addConnection ( DtPortConnection conn)
virtual

Add an incomming connection to this port.

virtual void DtInputPort::removeConnection ( DtPortConnection conn)
virtual

Remove an incomming connection to this port.

virtual const DtList* DtInputPort::connectionList ( ) const
virtual

Returns the list of input connections to this port.

virtual bool DtInputPort::newData ( ) const
virtual

Returns true if there is new data on this port that has not been received.

virtual void DtInputPort::dataReceived ( )
virtual

Clears the newData flag on this port.

virtual bool DtInputPort::enabled ( ) const
virtual

Enables/disables the port.

virtual void DtInputPort::setEnabled ( bool  flag)
virtual

Enables/disables the port.

Member Data Documentation

DtString DtInputPort::myName
protected
bool DtInputPort::myNewDataFlag
protected
bool DtInputPort::myEnabled
protected
DtList DtInputPort::myConnectionList
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)