Initial version
This commit is contained in:
commit
04b878f078
28 changed files with 1771 additions and 0 deletions
37
example/include/process/command_receiver.hpp
Normal file
37
example/include/process/command_receiver.hpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue