13std::vector<out_message_t>
15 std::shared_ptr<irsol::server::ClientSession>
session,
18 auto& frameListeningState =
session->userData().frameListeningState;
19 if(frameListeningState.running()) {
21 session->id(),
"Session is already listening to frames. Cannot set a frameRate.");
22 std::vector<out_message_t>
result;
24 message,
"Session is already listening to frames. Cannot set a frameRate."));
30 std::vector<out_message_t>
result;
36 frameListeningState.gisParams.frameRate = frameRate;
37 std::vector<out_message_t>
result;
Declaration of the AssignmentFrameRateHandler class.
std::vector< out_message_t > process(std::shared_ptr< irsol::server::ClientSession > session, protocol::Assignment &&message) final override
Processes an assignment message to set the frame rate.
AssignmentFrameRateHandler(std::shared_ptr< Context > ctx)
Constructs the AssignmentFrameRateHandler.
Generic handler base class for protocol messages.
#define IRSOL_NAMED_LOG_INFO(name,...)
Logs an info-level message using a named logger.
#define IRSOL_NAMED_LOG_WARN(name,...)
Logs a warning-level message using a named logger.
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
double toDouble(const irsol::types::protocol_value_t &x)
Converts a protocol value to a double.
Declaration of the ClientSession class.
Represents an assignment operation 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.
General utility functions used throughout the irsol library.