IRSOL
C++ code implementing socket server for interacting with Baumer camera.
command_gi_base.hpp
Go to the documentation of this file.
1
13#pragma once
14
17
18namespace irsol {
19namespace server {
20namespace handlers {
21namespace internal {
22
33{
34public:
39 CommandGIBaseHandler(std::shared_ptr<Context> ctx);
40
41protected:
48 std::vector<out_message_t> process(
49 std::shared_ptr<irsol::server::ClientSession> session,
50 protocol::Command&& message) final override;
51
52private:
59 std::string getDescription(
61 std::shared_ptr<irsol::server::ClientSession> session) const;
62
72 virtual std::vector<irsol::protocol::OutMessage> validate(
74 std::shared_ptr<irsol::server::ClientSession> session) const = 0;
75
88 std::shared_ptr<irsol::server::ClientSession> session) const = 0;
89
99 virtual double getFrameRate(
101 std::shared_ptr<irsol::server::ClientSession> session) const = 0;
102
112 std::shared_ptr<irsol::server::ClientSession> session,
113 std::shared_ptr<irsol::server::frame_collector::FrameCollector::frame_queue_t> queue,
115 const std::string& description);
116};
117} // namespace internal
118} // namespace handlers
119} // namespace server
120} // namespace irsol
Base handler templates for protocol message processing.
Base handler for frame acquisition commands (gi, gis).
std::vector< out_message_t > process(std::shared_ptr< irsol::server::ClientSession > session, protocol::Command &&message) final override
Processes a frame acquisition command, starting the frame collection thread.
void startListeningThread(std::shared_ptr< irsol::server::ClientSession > session, std::shared_ptr< irsol::server::frame_collector::FrameCollector::frame_queue_t > queue, protocol::Command &&command, const std::string &description)
Starts the frame listening thread for the client session.
virtual std::vector< irsol::protocol::OutMessage > validate(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const =0
Validates parameters before starting listener thread.
virtual double getFrameRate(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const =0
Retrieves the frame rate to use to start the listening.
std::string getDescription(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const
Generates a description string for the command execution.
virtual uint64_t getInputSequenceLength(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const =0
Retrieves the input sequence length to use to start the listening.
Generic handler base class for protocol messages.
Definition base.hpp:39
std::shared_ptr< Context > ctx
Handler context (provides access to app and utilities).
Definition base.hpp:81
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
Definition factory.hpp:28
Represents a command invocation in the protocol.
Definition command.hpp:33
auto description