RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IO::Connector Class Reference

#include <io.h>

Inheritance diagram for IO::Connector:
Settings::Object

Public Member Functions

void foreachBlock (void(*callback)(Block *, void *), void *param)
 
void foreachConnection (void(*callback)(Block *, size_t, Block *, size_t, void *), void *param)
 
void connect (IO::Block *outputBlock, size_t outputChannel, IO::Block *inputBlock, size_t inputChannel)
 
void disconnect (IO::Block *outputBlock, size_t outputChannel, IO::Block *inputBlock, size_t inputChannel)
 
bool connected (IO::Block *outputBlock, size_t outputChannel, IO::Block *inputBlock, size_t inputChannel)
 
- Public Member Functions inherited from Settings::Object
 Object (void)
 
virtual ~Object (void)
 
ID getID (void) const
 
State save (void) const
 
void load (const State &)
 
void deferred (const State &)
 

Static Public Member Functions

static ConnectorgetInstance (void)
 

Private Member Functions

void doDeferred (const Settings::Object::State &)
 
void doSave (Settings::Object::State &) const
 
 Connector (void)
 
 ~Connector (void)
 
 Connector (const Connector &)
 
Connectoroperator= (const Connector &)
 
void insertBlock (Block *)
 
void removeBlock (Block *)
 

Private Attributes

Mutex mutex
 
std::list< Block * > blockList
 

Static Private Attributes

static Connectorinstance = 0
 

Friends

class Block
 

Additional Inherited Members

- Public Types inherited from Settings::Object
typedef unsigned long ID
 
- Static Public Attributes inherited from Settings::Object
static const ID INVALID = 0
 
- Protected Member Functions inherited from Settings::Object
virtual void doLoad (const State &)
 

Detailed Description

Acts as a central meeting point between Blocks. Provides interfaces for finding and connecting blocks.

See also
IO::Block

Definition at line 71 of file io.h.

Constructor & Destructor Documentation

IO::Connector::Connector(void )
inlineprivate

Definition at line 164 of file io.h.

IO::Connector::~Connector(void )
inlineprivate

Definition at line 165 of file io.h.

IO::Connector::Connector(const Connector)
inlineprivate

Definition at line 166 of file io.h.

Member Function Documentation

void IO::Connector::connect(IO::BlockoutputBlock,
size_t outputChannel,
IO::BlockinputBlock,
size_t inputChannel 
)

Create a connection between the two specified Blocks.

Parameters
outputBlockThe source of the data.
outputChannelThe source channel of the data.
inputBlockThe destination of the data.
inputChannelThe destination channel of the data.
See also
IO::Block
IO::Block::input()
IO::Block::output()

Definition at line 274 of file io.cpp.

bool IO::Connector::connected(IO::BlockoutputBlock,
size_t outputChannel,
IO::BlockinputBlock,
size_t inputChannel 
)

Determine whether two channels are connected or not.

Parameters
outputBlockThe source of the data.
outputChannelTHe source channel of the data.
inputBlockThe destination of the data.
inputChannelThe destination channel of the data.
See also
IO::Block::connect()
IO::Block::disconnect()

Definition at line 312 of file io.cpp.

void IO::Connector::disconnect(IO::BlockoutputBlock,
size_t outputChannel,
IO::BlockinputBlock,
size_t inputChannel 
)

Break a connection between the two specified Blocks.

Parameters
outputBlockThe source of the data.
outputChannelThe source channel of the data.
inputBlockThe destination of the data.
inputChannelThe destination channel of the data.
See also
IO::Block
IO::Block::input()
IO::Block::output()

Definition at line 293 of file io.cpp.

void IO::Connector::doDeferred(const Settings::Object::States)
privatevirtual

Reimplemented from Settings::Object.

Definition at line 343 of file io.cpp.

void IO::Connector::doSave(Settings::Object::States)const
privatevirtual

Reimplemented from Settings::Object.

Definition at line 360 of file io.cpp.

void IO::Connector::foreachBlock(void(*)(Block *, void *) callback,
void * param 
)

Loop through each Block and execute a callback. The callback takes two parameters, a Block pointer and param, the second parameter to foreachBlock.

Parameters
callbackThe callback function.
paramA parameter to the callback function.
See also
IO::Block

Definition at line 257 of file io.cpp.

void IO::Connector::foreachConnection(void(*)(Block *, size_t, Block *, size_t, void *) callback,
void * param 
)

Loop through each Connection and execute callback. The callback takes 5 parameters: The source block The source output. The destination block. The destination input. The last parameter to foreachConnection.

Parameters
callbackThe callback function.
paramA parameter to the callback function.
See also
IO::Block

Definition at line 264 of file io.cpp.

IO::Connector * IO::Connector::getInstance(void )
static

Connector is a Singleton, which means that there can only be one instance. This function returns a pointer to that single instance.

Returns
The instance of Connector.

Definition at line 421 of file io.cpp.

void IO::Connector::insertBlock(IO::Blockblock)
private

Definition at line 378 of file io.cpp.

Connector& IO::Connector::operator=(const Connector)
inlineprivate

Definition at line 167 of file io.h.

void IO::Connector::removeBlock(IO::Blockblock)
private

Definition at line 401 of file io.cpp.

Friends And Related Function Documentation

friend class Block
friend

Definition at line 74 of file io.h.

Member Data Documentation

std::list<Block *> IO::Connector::blockList
private

Definition at line 178 of file io.h.

IO::Connector * IO::Connector::instance = 0
staticprivate

Definition at line 170 of file io.h.

Mutex IO::Connector::mutex
private

Definition at line 177 of file io.h.


The documentation for this class was generated from the following files: