59#ifndef Channels_DEFINED
60#define Channels_DEFINED
64#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
100 void reset() { memset(
this, 0,
sizeof(*
this)); }
105#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
112 std::ostringstream ss;
116 ss << (first ?
"" :
",") << i ;
126 std::istringstream iss(str);
128 for (
size_t i=0; i<
CHANNELS_COUNT && getline(iss, token,
','); i++)
130 const int n = atoi(token.c_str());
Class which emulates the 2-process channel synchronisation system from UPPAAL.
bool operator==(const Channels &other) const
comparison operator
Channels(const std::string &channel_values)
string constructor
void from_string(const std::string &str)
convert from a string
void reset()
reset all channel signals to zero
void send(int channel)
synchronise two machines: sender
std::string description() const
convert to a string
bool waiting(int channel)
check if a signal has been sent on a channel
void clear(int channel)
clear sync signal from a channel
UPPAAL style synchronisation channels.
#define CHANNEL_WAITING(s, n)
Return the state of the channel.
#define CHANNELS_COUNT
channels available
#define CHANNEL_CLEAR(s, n)
Set channel state OFF.
#define CHANNEL_SEND(s, n)
Set channel state ON.
#define IO_PIN_BIT_SIZE
bits available