37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
#ifndef PROCESS_COMMAND_RECEIVER_HPP
|
|
#define PROCESS_COMMAND_RECEIVER_HPP
|
|
|
|
#include <asap/asap.hpp>
|
|
|
|
#include "process/process_collection.hpp"
|
|
|
|
#include "process_command.hpp"
|
|
|
|
namespace process::controller {
|
|
class CommandListener;
|
|
|
|
class CommandReceiver {
|
|
public:
|
|
CommandReceiver(const std::shared_ptr<ProcessCollection>& collection,
|
|
const std::shared_ptr<asap::Participant>& participant,
|
|
const std::string& topic_name);
|
|
CommandReceiver(const std::shared_ptr<ProcessCollection>& collection,
|
|
const std::shared_ptr<asap::Participant>& participant,
|
|
const std::string& topic_name,
|
|
const std::function<bool(const ProcessCommand&)>& validator);
|
|
virtual ~CommandReceiver() = default;
|
|
|
|
CommandReceiver(CommandReceiver&&) = delete;
|
|
CommandReceiver& operator=(CommandReceiver&&) & = delete;
|
|
CommandReceiver(const CommandReceiver&) = delete;
|
|
CommandReceiver& operator=(const CommandReceiver&) & = delete;
|
|
|
|
private:
|
|
const std::string m_participant_topic;
|
|
std::shared_ptr<CommandListener> m_cmd_listener;
|
|
std::shared_ptr<asap::Participant> participant;
|
|
std::shared_ptr<asap::Subscriber<ProcessCommand>> subscriber;
|
|
};
|
|
}
|
|
|
|
#endif //PROCESS_COMMAND_RECEIVER_HPP
|