RTXI  2.4
The Real-Time eXperiment Interface Documentation
Public Member Functions | Static Public Member Functions | Friends
IO::Connector Class Reference

#include <io.h>

Inheritance diagram for IO::Connector:
Inheritance graph
Collaboration diagram for IO::Connector:
Collaboration graph

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)
 

Friends

class Block
 

Additional Inherited Members

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

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.

Member Function Documentation

◆ connect()

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.

◆ connected()

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.

Here is the call graph for this function:

◆ disconnect()

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.

◆ foreachBlock()

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.

◆ foreachConnection()

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.

◆ getInstance()

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.

Friends And Related Function Documentation

◆ Block

friend class Block
friend

Definition at line 74 of file io.h.


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