InstantIO::BasicOutSlot Class Reference

Abstract ancestor of all OutSlots. More...

#include <InstantIO/BasicOutSlot.h>

Inheritance diagram for InstantIO::BasicOutSlot:
InstantIO::Slot InstantIO::OutSlot< T >

List of all members.

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.

Detailed Description

Abstract ancestor of all OutSlots.

Applications do not use this class directly, instead they use one of its descendants (OutSlot).

See also:
OutSlot
Author:
Patrick Dähne

Constructor & Destructor Documentation

InstantIO::BasicOutSlot::BasicOutSlot ( const std::string &  description = std::string()  )  [explicit, protected]

Creates a new BasicOutSlot object.

Parameters:
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.

Member Function Documentation

virtual Direction InstantIO::BasicOutSlot::getDirection (  )  const [virtual]

Returns the direction of the Slot (In or Out).

Returns:
The direction (always Slot::Out for OutSlots)

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.

Parameters:
listener The listener.
See also:
Listener Listener
removeListener removeListener
startOutSlot startOutSlot
stopOutSlot stopOutSlot
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.

Parameters:
listener The Listener.
See also:
addListener addListener
void InstantIO::BasicOutSlot::invalidateValue (  ) 

Makes the current value of the OutSlot invalid.

The current value is the last data value written into the OutSlot. By default, the current value is invalid until the first data value is written into the OutSlot.

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.

Parameters:
inSlot The InSlot.
See also:
disconnect

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.

Parameters:
inSlot The InSlot.
See also:
connect connect

Implemented in InstantIO::OutSlot< T >.

virtual void InstantIO::BasicOutSlot::startOutSlot (  )  [protected, virtual]

Gets called when an OutSlot gets connected to the first InSlot.

You can override this method to get a notification when you should start writing values to an OutSlot. The default implementation of this method calls the startOutSlot method of all listeners.

virtual void InstantIO::BasicOutSlot::stopOutSlot (  )  [protected, virtual]

Gets called when an OutSlot gets disconnected from the last InSlot.

You can override this method to get a notification when you can stop writing values to an OutSlot. The default implementation of this method calls the stopOutSlot method of all listeners.


The documentation for this class was generated from the following file:
Generated on Thu Jul 31 17:17:32 2014 by  doxygen 1.6.3