Class Channel

Class Documentation

class Channel

Public Functions

Channel() = default
Channel(Config &config)

Construct a channel from a YAML config node, reading its name field (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/Receive know 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 data from transmitting device tx to every other registered device on the channel that can receive (a Receiver or Transponder), invoking their Receive(t, data).

Called by a Transmitter/Transponder device when it sends data at time t, 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)

  • tSimulation 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 Transmitter or Transponder) to send at time t, causing receiving device rx to get their data via Send.

Called by a Receiver/Transponder device when it samples/listens at time t, to pull data from all transmitting devices sharing this channel.

Parameters:
  • rx – Receiving device (must be non-null; skipped as its own sender)

  • tSimulation time of the receive [s]

Public Static Functions

static std::shared_ptr<Channel> FromConfig(Config &config)

Construct a Channel (or registered subclass) from a YAML config node’s class field, via the AssetFactory<Channel, Config&> registry.

Protected Attributes

std::string name_
std::unordered_set<Device*> devices_