RTXI  2.4
The Real-Time eXperiment Interface Documentation
Data Structures | Public Member Functions | Protected Member Functions | Friends
IO::Block Class Reference

#include <io.h>

Inheritance diagram for IO::Block:
Inheritance graph
Collaboration diagram for IO::Block:
Collaboration graph

Public Member Functions

 Block (std::string name, channel_t *channels, size_t size)
 
virtual ~Block (void)
 
std::string getName (void) const
 
virtual size_t getCount (flags_t type) const
 
virtual std::string getName (flags_t type, size_t index) const
 
virtual std::string getDescription (flags_t type, size_t index) const
 
virtual double getValue (flags_t type, size_t index) const
 
double input (size_t index) const
 
double output (size_t index) const
 
- 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 &)
 

Protected Member Functions

double & output (size_t index)
 
- Protected Member Functions inherited from Settings::Object
virtual void doLoad (const State &)
 
virtual void doDeferred (const State &)
 
virtual void doSave (State &) const
 

Friends

class Connector
 

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
 

Detailed Description

An object that provides an interface for transparently manipulating external data.

See also
Settings::Object

Definition at line 188 of file io.h.

Constructor & Destructor Documentation

◆ Block()

IO::Block::Block(std::string name,
IO::channel_tchannel,
size_t size 
)

The constructor needs to be provided with a specification of the channels that will be embedded in this block in the channels parameter. Fields that are not of type INPUT or OUTPUT will be safely ignored. Size should be the number of total fields in the channels parameter, regardless of type.

Parameters
nameThe name of the block.
channelsThe channel specification for this block.
sizeThe number of channels in the specification.
See also
IO::channel_t

Definition at line 30 of file io.cpp.

Here is the call graph for this function:

◆ ~Block()

IO::Block::~Block(void )
virtual

Definition at line 66 of file io.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ getCount()

size_t IO::Block::getCount(IO::flags_t type)const
virtual

Get the number of channels of the specified type.

Parameters
typeThe type of the channels to be counted.
Returns
The number of channels of the specified type.

Reimplemented in Workspace::Instance.

Definition at line 82 of file io.cpp.

◆ getDescription()

std::string IO::Block::getDescription(IO::flags_t type,
size_t index 
)const
virtual

Get the description of the specified channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The description of the channel.

Reimplemented in Workspace::Instance.

Definition at line 100 of file io.cpp.

◆ getName() [1/2]

std::string IO::Block::getName(IO::flags_t type,
size_t index 
)const
virtual

Get the name of the specified channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The name of the channel.

Reimplemented in Workspace::Instance.

Definition at line 91 of file io.cpp.

◆ getName() [2/2]

std::string IO::Block::getName(void )const
inline

Get the name of the block.

Returns
Tbe name of the block.

Definition at line 215 of file io.h.

◆ getValue()

double IO::Block::getValue(IO::flags_t type,
size_t index 
)const
virtual

Get the value of the specified channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The value of the channel.

Reimplemented in Workspace::Instance.

Definition at line 109 of file io.cpp.

◆ input()

double IO::Block::input(size_t index)const

Get the value of the specified input channel.

Parameters
indexThe input channel's index.
Returns
The value of the specified input channel.

Definition at line 118 of file io.cpp.

◆ output() [1/2]

double & IO::Block::output(size_t index)
protected

Get a reference to the value of the specified output channel. This method can be used to set the value of specified output.

Parameters
indexThe output channel's index.
Returns
A reference to the value of the specified output channel.
See also
IO::Block::output()

Definition at line 138 of file io.cpp.

◆ output() [2/2]

double IO::Block::output(size_t index)const

Get the value of the specified output channel.

Parameters
indexThe output channel's index.
Returns
The value of the specified output channel.
See also
IO::Block::output()

Definition at line 129 of file io.cpp.

Friends And Related Function Documentation

◆ Connector

friend class Connector
friend

Definition at line 191 of file io.h.


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