Abstract ancestor of all OutSlots. More...
#include <InstantIO/BasicOutSlot.h>
Classes | |
class | Listener |
Allows to receive information about the status of an OutSlot. More... | |
Public Member Functions | |
virtual | ~BasicOutSlot () |
This destroys the BasicOutSlot object. | |
virtual Direction | getDirection () const |
Returns the direction of the Slot (In or Out). | |
void | addListener (Listener &listener) |
Adds a Listener to the OutSlot. | |
void | removeListener (Listener &listener) |
Removes a Listener from the OutSlot. | |
void | invalidateValue () |
Makes the current value of the OutSlot invalid. | |
virtual void | connect (BasicInSlot *inSlot)=0 |
Connects an InSlot to this OutSlot. | |
virtual void | disconnect (BasicInSlot *inSlot)=0 |
Disconnects an InSlot from this OutSlot. | |
Protected Member Functions | |
BasicOutSlot (const std::string &description=std::string()) | |
Creates a new BasicOutSlot object. | |
virtual void | startOutSlot () |
Gets called when an OutSlot gets connected to the first InSlot. | |
virtual void | stopOutSlot () |
Gets called when an OutSlot gets disconnected from the last InSlot. | |
Protected Attributes | |
bool | valueIsValid_ |
Flag that is true when the OutSlot has a valid data value. |
Abstract ancestor of all OutSlots.
Applications do not use this class directly, instead they use one of its descendants (OutSlot).
InstantIO::BasicOutSlot::BasicOutSlot | ( | const std::string & | description = std::string() |
) | [explicit, protected] |
Creates a new BasicOutSlot object.
description | The description of this OutSlot. This information is not used by the InstantIO system directly, instead it is displayed for information purposes in user interfaces used to configure the InstantIO system. |
virtual Direction InstantIO::BasicOutSlot::getDirection | ( | ) | const [virtual] |
Returns the direction of the Slot (In or Out).
Implements InstantIO::Slot.
void InstantIO::BasicOutSlot::addListener | ( | Listener & | listener | ) |
Adds a Listener to the OutSlot.
After calling this methods, the listener receives status information from the OutSlot.
Listeners can be used to receive notifications when the status of an OutSlot changes, i.e. when the first InSlot connects to the OutSlot, the last InSlot disconnects from the OutSlot. Instead of implementing the Listener interface, you can also create a descendant of the OutSlot class and override the startOutSlot and stopOutSlot methods.
listener | The listener. |
void InstantIO::BasicOutSlot::removeListener | ( | Listener & | listener | ) |
Removes a Listener from the OutSlot.
After calling this method, the listener does not receive status notifications any more.
listener | The Listener. |
void InstantIO::BasicOutSlot::invalidateValue | ( | ) |
virtual void InstantIO::BasicOutSlot::connect | ( | BasicInSlot * | inSlot | ) | [pure virtual] |
Connects an InSlot to this OutSlot.
Usually, InSlots and OutSlots are not connected manually. They are connected automatically by adding them to Namespaces. This method just exists for rare special circumstances where it might be helpful to connect slots manually.
It is only possible to connect InSlots to this OutSlot that have the same data type.
It is possible to add the same InSlot more than once to an OutSlot. Nevertheless, just one connection is created. For each call of the connect
method, there has to be a corresponding call to the disconnect
method. The slots do not get disconnected until the last call of the disconnect method.
inSlot | The InSlot. |
Implemented in InstantIO::OutSlot< T >.
virtual void InstantIO::BasicOutSlot::disconnect | ( | BasicInSlot * | inSlot | ) | [pure virtual] |
Disconnects an InSlot from this OutSlot.
Usually, InSlots and OutSlots are not disconnected manually. The are disconnected automatically by removing them from Namespaces. This method just exists for rare special circumstances where it might be helpful to disconnect slots manually.
It is possible to add the same InSlot more than once to an OutSlot. Nevertheless, just one connection is created. For each call of the connect
method, there has to be a corresponding call of the disconnect
method. The slots do not get disconnected until the last call of the disconnect method.
inSlot | The InSlot. |
Implemented in InstantIO::OutSlot< T >.
virtual void InstantIO::BasicOutSlot::startOutSlot | ( | ) | [protected, virtual] |
virtual void InstantIO::BasicOutSlot::stopOutSlot | ( | ) | [protected, virtual] |