VR-Forces Developer's Guide
 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 Referenceabstract

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.

Inheritance diagram for DtOutputPort:
Inheritance graph
[legend]

Public Member Functions

 DtOutputPort (const DtString &portName)
 
virtual ~DtOutputPort ()
 
virtual bool init ()
 
virtual const DtStringname () const
 
virtual const DtString type () const =0
 
virtual void createPortData ()=0
 
virtual void sendData ()
 
virtual void addConnection (DtPortConnection *conn)
 
virtual void removeConnection (DtPortConnection *conn)
 
virtual bool attemptToActivate ()
 
virtual bool attemptToActivateAtLowestPriority ()
 
virtual bool canActivate () const
 
virtual void deactivate ()
 
virtual void allowDeactivation ()
 
virtual bool active () const
 
virtual const DtList * connectionList () const
 
virtual void setConnectionPriority (int priority)
 
virtual DtPortDatadata ()
 
virtual const DtPortDatadata () const
 
virtual bool enabled () const
 
virtual void setEnabled (bool flag)
 

Protected Attributes

DtString myName
 
bool myEnabled
 
DtPortDatamyData
 
DtList myConnectionList
 

Private Member Functions

 DtOutputPort ()
 
 DtOutputPort (const DtOutputPort &)
 
DtOutputPortoperator= (const DtOutputPort &)
 

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

Returns a pointer to the underlying port. This is used by the inputPort to get the port interface address.

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

Enables/disables the port.

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 Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)