VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
DtOutputPort Class Reference

DtOutputPorts are data ports owned by data producers. More...

Inheritance diagram for DtOutputPort:
Inheritance graph
[legend]

Public Member Functions

 DtOutputPort (const DtString &portName)
 Constructor.
virtual ~DtOutputPort ()
 Destructor.
virtual bool init ()
 Call after the constructor.
virtual const DtStringname () const
 Returns the string name of this port.
virtual const DtString type () const =0
 Override for each derrived class to return a unique type string.
virtual void createPortData ()=0
 Override for each derrived class to create and set the internal DtPortData representation.
virtual void sendData ()
 Sends the contents of myData to all connections.
virtual void addConnection (DtPortConnection *conn)
 Add a connection to the outgoing connection list.
virtual void removeConnection (DtPortConnection *conn)
 Remove a connection from the outgoing connection list.
virtual bool attemptToActivate ()
 Calls attemptToActivate on all connections in the connection list and returns true if any one of them was able to activate.
virtual bool attemptToActivateAtLowestPriority ()
 Calls attemptToActivate on all connections in the connection list and returns true if any one of them was able to activate, but will not override data from any others and will allow deactivation in the case another wants to provide data.
virtual bool canActivate () const
 Calls canActivate on all connections in the connection list and returns true if any one of them can be activated.
virtual void deactivate ()
 Calls deactivate on all connections in the connection list.
virtual void allowDeactivation ()
 Calls allowDeactivation on all connections in the connection list.
virtual bool active () const
 Returns true if any one of the outgoing connection are active.
virtual const DtList * connectionList () const
 Returns the list of output connections to this port.
virtual void setConnectionPriority (int priority)
 Sets the priority of all existing outgoing connections from this port to the new priority.
virtual DtPortDatadata ()
 Returns a pointer to the underlying port.
virtual const DtPortDatadata () const
virtual bool enabled () const
 Enables/disables the port.
virtual void setEnabled (bool flag)

Protected Attributes

DtString myName
bool myEnabled
DtPortDatamyData
 locally instantiated.
DtList myConnectionList
 List of outgoing connections.

Private Member Functions

 DtOutputPort ()
 Default constructor not implemented.
 DtOutputPort (const DtOutputPort &)
 Not implemented.
DtOutputPortoperator= (const DtOutputPort &)
 Not implemented.

Detailed Description

DtOutputPorts are data ports owned by data producers.

They are connected to DtPortConnections and send any new data placed on them to all connections which are attached.

A DtInputPort should attemptToActivate() before data is set on it. This operation will turn on any outgoing connections, if the priority of those connections is good enough. If attemptToActivate() returns false, this indicates that no input ports are connection to this port, and no one is listening to the data, so it is not necessary to calculate new values.

sendData() should be called every time the data producer has provided new values to the port and wishes those values to be propigated to the network. Derived Output Ports may automatically call sendData when new values are set.

When the user of an output port determines they no longer want to produce output, they should call either deactivate() or allowDeactivation().

This is an abstract base class. Derived classes operate on different subtypes of DtPortData. A derived class must provide a type() method that indicates the type of DtPortData this port will send, as well as a createPortData() method which creates that type of DtPortData. Also, they should provide an interface for setting the value of the port data.

Constructor & Destructor Documentation

DtOutputPort::DtOutputPort ( const DtString portName)

Constructor.

Provide a name which this port will be referenced by.

virtual DtOutputPort::~DtOutputPort ( )
virtual

Destructor.

DtOutputPort::DtOutputPort ( )
private

Default constructor not implemented.

DtOutputPort::DtOutputPort ( const DtOutputPort )
private

Not implemented.

Member Function Documentation

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

Not implemented.

virtual bool DtOutputPort::init ( )
virtual

Call after the constructor.

Calls createPortData()

Reimplemented in DtSensorContactListOutputPort.

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

Returns the string name of this port.

virtual const DtString DtOutputPort::type ( ) const
pure virtual
virtual void DtOutputPort::createPortData ( )
pure virtual
virtual DtPortData* DtOutputPort::data ( )
virtual

Returns a pointer to the underlying port.

This is used by the inputPort to get the port interface address.

virtual const DtPortData* DtOutputPort::data ( ) const
virtual
virtual void DtOutputPort::sendData ( )
virtual

Sends the contents of myData to all connections.

virtual void DtOutputPort::addConnection ( DtPortConnection conn)
virtual

Add a connection to the outgoing connection list.

virtual void DtOutputPort::removeConnection ( DtPortConnection conn)
virtual

Remove a connection from the outgoing connection list.

virtual bool DtOutputPort::attemptToActivate ( )
virtual

Calls attemptToActivate on all connections in the connection list and returns true if any one of them was able to activate.

Call this when you have data which you want to supply.

virtual bool DtOutputPort::attemptToActivateAtLowestPriority ( )
virtual

Calls attemptToActivate on all connections in the connection list and returns true if any one of them was able to activate, but will not override data from any others and will allow deactivation in the case another wants to provide data.

Call this when you have data which you want to supply.

virtual bool DtOutputPort::canActivate ( ) const
virtual

Calls canActivate on all connections in the connection list and returns true if any one of them can be activated.

virtual void DtOutputPort::deactivate ( )
virtual

Calls deactivate on all connections in the connection list.

Call this when you have no data to supply.

virtual void DtOutputPort::allowDeactivation ( )
virtual

Calls allowDeactivation on all connections in the connection list.

Call this when you have data to supply, but will allow your data to be overridden by others.

virtual bool DtOutputPort::active ( ) const
virtual

Returns true if any one of the outgoing connection are active.

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

Returns the list of output connections to this port.

virtual void DtOutputPort::setConnectionPriority ( int  priority)
virtual

Sets the priority of all existing outgoing connections from this port to the new priority.

virtual bool DtOutputPort::enabled ( ) const
virtual

Enables/disables the port.

virtual void DtOutputPort::setEnabled ( bool  flag)
virtual

Member Data Documentation

DtString DtOutputPort::myName
protected
bool DtOutputPort::myEnabled
protected
DtPortData* DtOutputPort::myData
protected

locally instantiated.

DtList DtOutputPort::myConnectionList
protected

List of outgoing connections.


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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)