Program Listing for File channel.h

Return to documentation for file (measurements/channel.h)

#pragma once

#include <unordered_set>

#include "lupnt/core/config.h"
#include "lupnt/core/definitions.h"

namespace lupnt {

  class Device;

  class Channel {
  public:
    Channel() = default;

    Channel(Config& config);
    ~Channel() = default;

    void AddDevice(Device* device);

    std::string GetName() const { return name_; }

    void Send(Device* tx, Real t, void* data);

    void Receive(Device* rx, Real t);

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

  protected:
    std::string name_;
    std::unordered_set<Device*> devices_;
  };

}  // namespace lupnt