IRSOL
C++ code implementing socket server for interacting with Baumer camera.
command_gi.cpp
Go to the documentation of this file.
2
3#include "irsol/macros.hpp"
4#include "irsol/protocol.hpp"
6
7#include <sstream>
8
9namespace irsol {
10namespace server {
11namespace handlers {
12
13CommandGIHandler::CommandGIHandler(std::shared_ptr<Context> ctx)
14 : internal::CommandGIBaseHandler(ctx)
15{}
16
17std::vector<irsol::protocol::OutMessage>
20 IRSOL_MAYBE_UNUSED std::shared_ptr<irsol::server::ClientSession> session) const
21{
22 // For 'gi' command, no further validation to do.
23 return {};
24}
25
29 IRSOL_MAYBE_UNUSED std::shared_ptr<irsol::server::ClientSession> session) const
30{
31 // For 'gi' command, we always capture only 1 frame at the time
32 return 1;
33}
34double
37 IRSOL_MAYBE_UNUSED std::shared_ptr<irsol::server::ClientSession> session) const
38{
39 // for 'gi' command we mock the FPS to -1, so that the FrameCollector knows we're only
40 // interested in 1 frame
41 return -1.0;
42}
43
44} // namespace handlers
45} // namespace server
46} // namespace irsol
double getFrameRate(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const override
Returns the frame rate for the gi command.
std::vector< irsol::protocol::OutMessage > validate(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const override
Validates the gi command parameters.
CommandGIHandler(std::shared_ptr< Context > ctx)
Constructs the CommandGIHandler.
uint64_t getInputSequenceLength(const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const override
Returns the input sequence length for the gi command (always 1).
Declaration of the CommandGIHandler class.
Common portability and diagnostic macros for the irsol library.
#define IRSOL_MAYBE_UNUSED
Suppresses compiler warnings about unused variables or parameters.
Definition macros.hpp:39
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
Definition factory.hpp:28
Declaration of the ClientSession class.
Represents a command invocation in the protocol.
Definition command.hpp:33