![]() |
VR-Forces 4.3.1 Class Documentation
|
DtOutputPorts are data ports owned by data producers. More...

Public Member Functions | |
| DtOutputPort (const DtString &portName) | |
| Constructor. | |
| virtual | ~DtOutputPort () |
| Destructor. | |
| virtual bool | init () |
| Call after the constructor. | |
| virtual const DtString & | name () 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 | 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 DtPortData * | data () |
| Returns a pointer to the underlying port. | |
| virtual const DtPortData * | data () const |
| Returns a pointer to the underlying port. | |
| virtual bool | enabled () const |
| Enables/disables the port. | |
| virtual void | setEnabled (bool flag) |
| Enables/disables the port. | |
Protected Attributes | |
| DtString | myName |
| bool | myEnabled |
| DtPortData * | myData |
| locally instantiated. | |
| DtList | myConnectionList |
| List of outgoing connections. | |
Private Member Functions | |
| DtOutputPort () | |
| Default constructor not implemented. | |
| DtOutputPort (const DtOutputPort &) | |
| Not implemented. | |
| DtOutputPort & | operator= (const DtOutputPort &) |
| Not implemented. | |
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.
| DtOutputPort::DtOutputPort | ( | const DtString & | portName | ) |
Constructor.
Provide a name which this port will be referenced by.
|
virtual |
Destructor.
|
private |
Default constructor not implemented.
|
private |
Not implemented.
|
private |
Not implemented.
|
virtual |
|
virtual |
Returns the string name of this port.
|
pure virtual |
Override for each derrived class to return a unique type string.
This type string is the type of the DtPortData which this port will send.
Implemented in DtLaserDetectorOutputPort, DtSensorContactListOutputPort, DtStringOutputPort, DtVectorOutputPort, DtOrientationOutputPort, DtCollisionOutputPort, DtAmmunitionOutputPort, DtDualAxisAnalogOutputPort, DtObjectIdOutputPort, DtAnalogOutputPort, DtObjectTypesListOutputPort, DtBooleanOutputPort, DtIntegerOutputPort, and DtEntityListOutputPort.
|
pure virtual |
Override for each derrived class to create and set the internal DtPortData representation.
Implemented in DtLaserDetectorOutputPort, DtSensorContactListOutputPort, DtStringOutputPort, DtVectorOutputPort, DtOrientationOutputPort, DtCollisionOutputPort, DtAmmunitionOutputPort, DtDualAxisAnalogOutputPort, DtObjectIdOutputPort, DtAnalogOutputPort, DtObjectTypesListOutputPort, DtBooleanOutputPort, DtIntegerOutputPort, and DtEntityListOutputPort.
|
virtual |
Returns a pointer to the underlying port.
This is used by the inputPort to get the port interface address.
|
virtual |
Returns a pointer to the underlying port.
This is used by the inputPort to get the port interface address.
|
virtual |
Sends the contents of myData to all connections.
|
virtual |
Add a connection to the outgoing connection list.
|
virtual |
Remove a connection from the outgoing connection list.
|
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 |
Calls canActivate on all connections in the connection list and returns true if any one of them can be activated.
|
virtual |
Calls deactivate on all connections in the connection list.
Call this when you have no data to supply.
|
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 |
Returns true if any one of the outgoing connection are active.
|
virtual |
Returns the list of output connections to this port.
|
virtual |
Sets the priority of all existing outgoing connections from this port to the new priority.
|
virtual |
Enables/disables the port.
|
virtual |
Enables/disables the port.
|
protected |
|
protected |
|
protected |
locally instantiated.
|
protected |
List of outgoing connections.