23std::vector<out_message_t>
25 std::shared_ptr<irsol::server::ClientSession>
session,
34 std::vector<out_message_t>
result;
57 std::shared_ptr<irsol::server::ClientSession>
session)
const
66 std::shared_ptr<irsol::server::ClientSession>
session,
67 std::shared_ptr<irsol::server::frame_collector::FrameCollector::frame_queue_t> queue,
75 std::shared_ptr<std::atomic<bool>>
stopRequest)
mutable {
78 state.gisParams.inputSequenceNumber = 0;
81 session->id(),
"Started frame listening thread for {}",
message.toString());
83 std::unique_ptr<frame_collector::Frame>
framePtr;
88 "Sending frame {} to client: {}",
89 state.gisParams.inputSequenceNumber,
92 auto lock = std::scoped_lock(
session->socketMutex());
93 std::vector<irsol::protocol::OutMessage>
result;
96 "isn", {
static_cast<int>(
state.gisParams.inputSequenceNumber)}));
99 ++
state.gisParams.inputSequenceNumber;
107 session->id(),
"Stopping execution of frame-collection due to stop-request.");
113 auto lock = std::scoped_lock(
session->socketMutex());
Main server application managing client connections and camera streaming.
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.
CommandGIBaseHandler(std::shared_ptr< Context > ctx)
Constructs the CommandGIBaseHandler.
Generic handler base class for protocol messages.
std::shared_ptr< Context > ctx
Handler context (provides access to app and utilities).
Declaration of the CommandGIBaseHandler class.
#define IRSOL_NAMED_LOG_INFO(name,...)
Logs an info-level message using a named logger.
#define IRSOL_NAMED_LOG_DEBUG(name,...)
Logs a debug-level message using a named logger.
#define IRSOL_NAMED_LOG_WARN(name,...)
Logs a warning-level message using a named logger.
std::variant< Success, BinaryDataBuffer, ImageBinaryData, ColorImageBinaryData, Error > OutMessage
Variant type representing any outgoing message.
Logging utilities and configuration for the irsol library.
Common portability and diagnostic macros for the irsol library.
#define IRSOL_MAYBE_UNUSED
Suppresses compiler warnings about unused variables or parameters.
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
Represents a command invocation in the protocol.
static Error from(const T &msg, const std::string &description)
Creates an error from a specific incoming message type.
static Success from(const Assignment &msg, std::optional< irsol::types::protocol_value_t > overrideValue=std::nullopt)
Creates a success message from an Assignment.
static Success asStatus(const std::string &identifier, irsol::types::protocol_value_t value)
Creates a standalone status message with a value.
Core type definitions for networking, time handling, and protocol values used throughout the irsol li...
General utility functions used throughout the irsol library.