#include <Connector.h>
Inheritance diagram for Connector:
Definition at line 60 of file Connector.h.
Public Member Functions | |
Connector (Source *source) throw ( Exception ) | |
Constructor based on a Source. | |
Connector (Source *source, Sink *sink) throw ( Exception ) | |
Constructor based on a Source and a Sink. | |
Connector (const Connector &connector) throw ( Exception ) | |
Copy constructor. | |
virtual | ~Connector (void) throw ( Exception ) |
Destructor. | |
virtual Connector & | operator= (const Connector &connector) throw ( Exception ) |
Assignment operator. | |
virtual unsigned int | getNumSinks (void) const throw () |
Get the number of Sinks in the Connector. | |
virtual void | attach (Sink *sink) throw ( Exception ) |
Attach a Sink to the Source of this Connector. | |
virtual bool | open (void) throw ( Exception ) |
Open the connector. | |
virtual unsigned int | transfer (unsigned long bytes, unsigned int bufSize, unsigned int sec, unsigned int usec) throw ( Exception ) |
Transfer a given amount of data from the Source to all the Sinks attached. | |
virtual void | close (void) throw ( Exception ) |
Close the Connector. | |
Protected Member Functions | |
Connector (void) throw ( Exception ) | |
Default constructor. | |
virtual bool | detach (Sink *sink) throw ( Exception ) |
Detach an already attached Sink from the Source of this Connector. | |
Protected Attributes | |
Ref< Source > | source |
The source to read from. | |
Ref< Sink > * | sinks |
The sinks to connect the source to. | |
unsigned int | numSinks |
Total number of sinks. |
|
Default constructor. Always throws an Exception.
Definition at line 105 of file Connector.h. |
|
Constructor based on a Source.
Definition at line 130 of file Connector.h. References source. |
|
Constructor based on a Source and a Sink.
Definition at line 143 of file Connector.h. |
|
Copy constructor.
Definition at line 87 of file Connector.cpp. References attach(). |
|
Destructor.
Definition at line 164 of file Connector.h. |
|
Attach a Sink to the Source of this Connector.
Definition at line 127 of file Connector.cpp. References Ref< T >::get(), numSinks, and sinks. Referenced by Connector(), and operator=(). |
|
Close the Connector. The Source and all Sinks are closed.
Reimplemented in MultiThreadedConnector. Definition at line 332 of file Connector.cpp. References numSinks, sinks, and source. Referenced by MultiThreadedConnector::close(). |
|
Detach an already attached Sink from the Source of this Connector.
Definition at line 156 of file Connector.cpp. |
|
Get the number of Sinks in the Connector.
Definition at line 186 of file Connector.h. References numSinks. |
|
Open the connector. Opens the Source and the Sinks if necessary.
Reimplemented in MultiThreadedConnector. Definition at line 217 of file Connector.cpp. |
|
Assignment operator.
Definition at line 103 of file Connector.cpp. References attach(). Referenced by MultiThreadedConnector::operator=(). |
|
Transfer a given amount of data from the Source to all the Sinks attached. If an attached Sink closes or encounteres an error during the process, it is detached and the function carries on with the rest of the Sinks. If no Sinks remain, or an error is encountered with the Source, the function returns prematurely.
Reimplemented in MultiThreadedConnector. Definition at line 256 of file Connector.cpp. |
|
Total number of sinks.
Definition at line 97 of file Connector.h. Referenced by attach(), close(), detach(), getNumSinks(), and open(). |
|
The sinks to connect the source to.
Definition at line 92 of file Connector.h. |
|
The source to read from.
Definition at line 87 of file Connector.h. Referenced by close(), Connector(), and open(). |