#include <io.hpp>
Interface class for IO data between RTXI devices and plugins.
Definition at line 78 of file io.hpp.
◆ Block() [1/3]
IO::Block::Block | ( | std::string | blockname, |
| | const std::vector< channel_t > & | channels, |
| | bool | isdependent |
| ) | | |
The constructor needs to be provided with a specification of the channels that will be embedded in this block in the channels parameter. Fields could be IO::INPUT, IO::OUTPUT. It also needs to specify whether the block is dependent on other blocks for real-time scheduling. This base class is not meant to be inherited directly and Widget::Component is recommended instead
- Parameters
blockname | The name of the block. |
channels | The lis of channel specifications for this block. |
- See also
- Widgets::Component
- IO::channel_t
Definition at line 29 of file io.cpp.
◆ Block() [2/3]
IO::Block::Block | ( | const Block & | block | ) | |
| default |
◆ Block() [3/3]
IO::Block::Block | ( | Block && | | ) | |
| delete |
◆ ~Block()
virtual IO::Block::~Block | ( | | ) | |
| virtualdefault |
◆ assignID()
void IO::Block::assignID | ( | size_t | block_id | ) | |
| inline |
Assign unique ID to the block. Used by the Real-Time thread
- Parameters
block_id | The id to assign to the block |
Definition at line 195 of file io.hpp.
◆ dependent()
bool IO::Block::dependent | ( | | ) | const |
| inline |
Returns the dependency property of the block
Some blocks are dependent on the output of others. It is crucial for these blocks to be scheduled in real-time to follow their dependencies, or else risk large errors in time dependent calculations.
- Returns
- True for a dependent IO::Block, false otherwise
Definition at line 173 of file io.hpp.
◆ getActive()
bool IO::Block::getActive | ( | | ) | const |
| inline |
Returns activity state of the block
- Returns
- True for active block, false otherwise
Definition at line 180 of file io.hpp.
◆ getChannelDescription()
std::string IO::Block::getChannelDescription | ( | IO::flags_t | type, |
| | size_t | index |
| ) | | const |
Get the description of the specified channel.
- Parameters
index | The channel's index. |
- Returns
- The description of the channel.
Definition at line 58 of file io.cpp.
◆ getChannelName()
std::string IO::Block::getChannelName | ( | IO::flags_t | type, |
| | size_t | index |
| ) | | const |
Get the name of the specified channel.
- Parameters
type | Port type. |
index | The channel's index. |
- Returns
- The name of the channel.
Definition at line 52 of file io.cpp.
◆ getCount()
Get the number of channels of the specified type.
- Parameters
type | The type of the channels to be counted. |
- Returns
- The number of channels of the specified type.
Definition at line 46 of file io.cpp.
◆ getID()
size_t IO::Block::getID | ( | | ) | const |
| inline |
Retrieve the assigned id of the block
- Returns
- The id of the block
Definition at line 202 of file io.hpp.
◆ getName()
std::string IO::Block::getName | ( | | ) | const |
| inline |
Get the name of the block.
- Returns
- The name of the block.
Definition at line 108 of file io.hpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ readinput()
double & IO::Block::readinput | ( | size_t | index | ) | |
| protected |
Read the input sent to this block. Only the block itself has access.
Reads the buffered values from all external inputs and resets the buffer to zero. This function should only be accessed once per scope or risk getting previously read values overwirten. This function assumes reading input channels.
- Parameters
index | The channel to read the sent input from |
- Returns
- A reference to input value written
- See also
- IO::Block::writeinput()
Definition at line 70 of file io.cpp.
◆ readPort()
const double & IO::Block::readPort | ( | IO::flags_t | direction, |
| | size_t | index |
| ) | | |
Get the values of the specified output channel.
This function can read values from both input and output types. This does not reset the values on the channel
- Parameters
index | The output channel's index. |
direction | The channel direction represented by IO::flags_t |
- Returns
- The value of the specified output channel.
Definition at line 85 of file io.cpp.
◆ setActive()
void IO::Block::setActive | ( | bool | act | ) | |
| inline |
Sets the activity state of the block. Only used by Real-Time thread
/param act The activity state to set the block to. True if the block is in the active state. False otherwise.
Definition at line 188 of file io.hpp.
◆ writeinput()
void IO::Block::writeinput | ( | size_t | index, |
| | const double & | data |
| ) | | |
write the values of the specified input channel.
This function is responsible for writing external values to the specified input channel. Additional writes to input result in adding to existing values in the channel, and is only reset to zero during readinput function call.
- Parameters
index | The input channel's index. |
data | the data to push into the block |
- Returns
- The value of the specified input channel.
- See also
- IO::Block::readinput()
Definition at line 65 of file io.cpp.
◆ writeoutput()
void IO::Block::writeoutput | ( | size_t | index, | | | const double & | data | | ) | | |
| protected |
Writes output to specified channel. Only the block itself has access.
- Parameters
index | The channel to write the output to |
data | A reference to value to send |
Definition at line 80 of file io.cpp.
The documentation for this class was generated from the following files: