10 : internal::CommandGIBaseHandler(ctx)
13std::vector<irsol::protocol::OutMessage>
16 std::shared_ptr<irsol::server::ClientSession>
session)
const
19 std::vector<out_message_t>
result;
21 if(
state.gisParams.inputSequenceLength == 0) {
24 message,
"Gis inputSequenceLength param is 0, this is not allowed"));
27 if(
state.gisParams.frameRate <= 0) {
29 session->id(),
"Gis frameRate param is non-positive, this is not allowed.");
31 message,
"Gis frameRate param is non-positive, this is not allowed."));
40 std::shared_ptr<irsol::server::ClientSession>
session)
const
42 const auto&
state =
session->userData().frameListeningState;
43 return state.gisParams.inputSequenceLength;
48 std::shared_ptr<irsol::server::ClientSession>
session)
const
50 const auto&
state =
session->userData().frameListeningState;
51 return state.gisParams.frameRate;
CommandGISHandler(std::shared_ptr< Context > ctx)
Constructs the CommandGISHandler.
double getFrameRate(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const override
Returns the frame rate for the gis command.
uint64_t getInputSequenceLength(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const override
Returns the input sequence length for the gis command.
std::vector< irsol::protocol::OutMessage > validate(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const override
Validates the gis command parameters.
Declaration of the CommandGISHandler class.
#define IRSOL_NAMED_LOG_WARN(name,...)
Logs a warning-level message using a named logger.
#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.
Declaration of the ClientSession class.
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.