3#include "state_representation/IOState.hpp"
19 explicit DigitalIOState(
const std::string& name,
unsigned int nb_ios = 0);
26 DigitalIOState(
const std::string& name,
const std::vector<std::string>& io_names);
48 static DigitalIOState Zero(
const std::string& name,
const std::vector<std::string>& names);
79 bool is_true(
const std::string& name)
const;
87 bool is_true(
unsigned int io_index)
const;
95 bool is_false(
const std::string& name)
const;
103 bool is_false(
unsigned int io_index)
const;
110 void set_true(
const std::string& name);
117 void set_true(
unsigned int io_index);
141 void reset()
override;
std::string to_string() const override
Convert the state to its string representation.
void set_false()
Set all digital IOs false.
friend void swap(DigitalIOState &state1, DigitalIOState &state2)
Swap the values of the IO states.
static DigitalIOState Zero(const std::string &name, unsigned int nb_ios)
Constructor for a zero digital IO state.
bool is_true(const std::string &name) const
Check if a digital IO is true by its name, if it exists.
void reset() override
Reset the object to a post-construction state.
DigitalIOState()
Empty constructor for a digital IO state.
DigitalIOState & operator=(const DigitalIOState &state)
Copy assignment operator that has to be defined to the custom assignment operator.
DigitalIOState copy() const
Return a copy of the digital IO state.
bool is_false(const std::string &name) const
Check if a digital IO is false by its name, if it exists.
friend std::ostream & operator<<(std::ostream &os, const DigitalIOState &state)
Overload the ostream operator for printing.
void set_true(const std::string &name)
Set the a digital IO to true by its name.
static DigitalIOState Random(const std::string &name, unsigned int nb_ios)
Constructor for a digital IO state with random data.
Core state variables and objects.
void swap(AnalogIOState &state1, AnalogIOState &state2)