IRSOL
C++ code implementing socket server for interacting with Baumer camera.
irsol::server::handlers::CommandGIHandler Class Reference

Handler for the gi command (single frame acquisition). More...

#include <command_gi.hpp>

Inheritance diagram for irsol::server::handlers::CommandGIHandler:
irsol::server::handlers::internal::CommandGIBaseHandler irsol::server::handlers::internal::HandlerBase< T, >

Public Member Functions

 CommandGIHandler (std::shared_ptr< Context > ctx)
 Constructs the CommandGIHandler.
 
- Public Member Functions inherited from irsol::server::handlers::internal::CommandGIBaseHandler
 CommandGIBaseHandler (std::shared_ptr< Context > ctx)
 Constructs the CommandGIBaseHandler.
 
- Public Member Functions inherited from irsol::server::handlers::internal::HandlerBase< T, >
virtual std::vector< out_message_toperator() (const irsol::types::client_id_t &clientId, T &&message)
 Invokes the handler for a given client and message.
 

Private Member Functions

std::vector< irsol::protocol::OutMessagevalidate (const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const override
 Validates the gi command parameters.
 
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).
 
double getFrameRate (const protocol::Command &message, std::shared_ptr< irsol::server::ClientSession > session) const override
 Returns the frame rate for the gi command.
 

Additional Inherited Members

- Protected Member Functions inherited from irsol::server::handlers::internal::CommandGIBaseHandler
std::vector< out_message_tprocess (std::shared_ptr< irsol::server::ClientSession > session, protocol::Command &&message) final override
 Processes a frame acquisition command, starting the frame collection thread.
 
- Protected Member Functions inherited from irsol::server::handlers::internal::HandlerBase< T, >
 HandlerBase (std::shared_ptr< Context > ctx)
 Constructs the handler base.
 
virtual std::vector< out_message_tprocess (std::shared_ptr< irsol::server::ClientSession > session, T &&message)=0
 Processes the protocol message for the given session.
 
- Protected Attributes inherited from irsol::server::handlers::internal::HandlerBase< T, >
std::shared_ptr< Contextctx
 Handler context (provides access to app and utilities).
 

Detailed Description

Handler for the gi command (single frame acquisition).

Processes the gi command to acquire a single frame from the camera.

Definition at line 24 of file command_gi.hpp.

Constructor & Destructor Documentation

◆ CommandGIHandler()

irsol::server::handlers::CommandGIHandler::CommandGIHandler ( std::shared_ptr< Context ctx)

Constructs the CommandGIHandler.

Parameters
ctxHandler context.

Definition at line 13 of file command_gi.cpp.

14 : internal::CommandGIBaseHandler(ctx)
15{}
std::shared_ptr< Context > ctx
Handler context (provides access to app and utilities).
Definition base.hpp:81

Member Function Documentation

◆ getFrameRate()

double irsol::server::handlers::CommandGIHandler::getFrameRate ( const protocol::Command message,
std::shared_ptr< irsol::server::ClientSession session 
) const
overrideprivatevirtual

Returns the frame rate for the gi command.

Parameters
messageThe command message.
sessionThe client session.
Returns
Frame rate (always -1.0 for single frame).

Implements irsol::server::handlers::internal::CommandGIBaseHandler.

Definition at line 35 of file command_gi.cpp.

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}

◆ getInputSequenceLength()

uint64_t irsol::server::handlers::CommandGIHandler::getInputSequenceLength ( const protocol::Command message,
std::shared_ptr< irsol::server::ClientSession session 
) const
overrideprivatevirtual

Returns the input sequence length for the gi command (always 1).

Parameters
messageThe command message.
sessionThe client session.
Returns
Number of frames to acquire (always 1).

Implements irsol::server::handlers::internal::CommandGIBaseHandler.

Definition at line 27 of file command_gi.cpp.

30{
31 // For 'gi' command, we always capture only 1 frame at the time
32 return 1;
33}

◆ validate()

std::vector< irsol::protocol::OutMessage > irsol::server::handlers::CommandGIHandler::validate ( const protocol::Command message,
std::shared_ptr< irsol::server::ClientSession session 
) const
overrideprivatevirtual

Validates the gi command parameters.

Parameters
messageThe command message.
sessionThe client session.
Returns
Vector of outbound error messages (empty if valid).

Implements irsol::server::handlers::internal::CommandGIBaseHandler.

Definition at line 18 of file command_gi.cpp.

21{
22 // For 'gi' command, no further validation to do.
23 return {};
24}

The documentation for this class was generated from the following files: