Class Channel¶
Defined in File channel.h
Class Documentation¶
-
class Channel¶
Public Functions
-
Channel() = default¶
-
Channel(Config &config)¶
Construct a channel from a YAML config node, reading its
namefield (defaults to “channel” if absent).Invoked by Channel::FromConfig / AssetFactory when building the simulation’s communication topology from a scenario config file.
-
~Channel() = default¶
-
void AddDevice(Device *device)¶
Register a device as a participant on this channel.
Called when wiring up agents/devices during simulation setup so that
Send/Receiveknow which other devices share this channel.
-
inline std::string GetName() const¶
Name of this channel (as set from config, or “channel” by default).
-
void Send(Device *tx, Real t, void *data)¶
Broadcast
datafrom transmitting devicetxto every other registered device on the channel that can receive (aReceiverorTransponder), invoking theirReceive(t, data).Called by a
Transmitter/Transponderdevice when it sends data at timet, to deliver that data to all other devices sharing this channel (e.g. a ground-station receiver picking up a satellite’s transmission).- Parameters:
tx – Sending device (must be non-null; skipped as its own recipient)
t – Simulation time of the send [s]
data – Opaque pointer to the data payload being sent (must be non-null)
-
void Receive(Device *rx, Real t)¶
Trigger every other registered device on the channel that can transmit (a
TransmitterorTransponder) to send at timet, causing receiving devicerxto get their data viaSend.Called by a
Receiver/Transponderdevice when it samples/listens at timet, to pull data from all transmitting devices sharing this channel.- Parameters:
rx – Receiving device (must be non-null; skipped as its own sender)
t – Simulation time of the receive [s]
Public Static Functions
-
Channel() = default¶