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

Contains all logic for dispatching and implementing protocol message handlers. More...

Namespaces

namespace  internal
 

Classes

class  AssignmentFrameRateHandler
 Handler for assignment of the frame rate parameter. More...
 
class  AssignmentInputSequenceLengthHandler
 Handler for assignment of the input sequence length parameter isl. More...
 
class  AssignmentIntegrationTimeHandler
 Handler for assignment of the camera integration time (exposure). More...
 
class  CommandAbortHandler
 Handler for aborting ongoing operations for a client session. More...
 
class  CommandGIHandler
 Handler for the gi command (single frame acquisition). More...
 
class  CommandGISHandler
 Handler for the gis command (sequence frame acquisition). More...
 
struct  Context
 Context object passed to all handler classes. More...
 
class  InquiryFrameRateHandler
 Handler for inquiry of the current frame rate parameter. More...
 
class  InquiryInputSequenceLengthHandler
 Handler for inquiry of the input sequence length parameter. More...
 
class  InquiryIntegrationTimeHandler
 Handler for inquiry of the camera integration time (exposure). More...
 
class  LambdaHandler
 Handler class that delegates protocol message processing to a lambda or callable. More...
 
class  MessageHandler
 Binds incoming protocol messages to the appropriate per-client logic. More...
 

Typedefs

using AssignmentImgLeftHandler = internal::AssignmentImgHandlerBase< internal::AssignmentCameraImageAttributeLeft >
 Handler for assigning the left offset ("OffsetX") of the camera image.
 
using AssignmentImgTopHandler = internal::AssignmentImgHandlerBase< internal::AssignmentCameraImageAttributeTop >
 Handler for assigning the top offset ("OffsetY") of the camera image.
 
using AssignmentImgWidthHandler = internal::AssignmentImgHandlerBase< internal::AssignmentCameraImageAttributeWidth >
 Handler for assigning the width ("Width") of the camera image.
 
using AssignmentImgHeightHandler = internal::AssignmentImgHandlerBase< internal::AssignmentCameraImageAttributeHeight >
 Handler for assigning the height ("Height") of the camera image.
 
using in_message_t = protocol::InMessage
 
using out_message_t = protocol::OutMessage
 
using AssignmentHandler = internal::HandlerBase< protocol::Assignment >
 Handler type for assignment messages.
 
using InquiryHandler = internal::HandlerBase< protocol::Inquiry >
 Handler type for inquiry messages.
 
using CommandHandler = internal::HandlerBase< protocol::Command >
 Handler type for command messages.
 
using InquiryImgLeftHandler = internal::InquiryImgHandlerBase< internal::InquiryCameraImageAttributeLeft >
 Handler for inquiring the left offset ("OffsetX") of the camera image.
 
using InquiryImgTopHandler = internal::InquiryImgHandlerBase< internal::InquiryCameraImageAttributeTop >
 Handler for inquiring the top offset ("OffsetY") of the camera image.
 
using InquiryImgWidthHandler = internal::InquiryImgHandlerBase< internal::InquiryCameraImageAttributeWidth >
 Handler for inquiring the width ("Width") of the camera image.
 
using InquiryImgHeightHandler = internal::InquiryImgHandlerBase< internal::InquiryCameraImageAttributeHeight >
 Handler for inquiring the height ("Height") of the camera image.
 

Functions

template<typename HandlerT , typename... Args>
constexpr auto makeHandler (std::shared_ptr< Context > ctx, Args &&... args)
 Constructs a handler instance of the given type.
 
template<typename InMessageT , typename LambdaT >
constexpr auto makeLambdaHandler (std::shared_ptr< Context > ctx, LambdaT &&lambda)
 Constructs a lambda handler for the specified message type.
 

Detailed Description

Contains all logic for dispatching and implementing protocol message handlers.

The handlers namespace encapsulates the entire message handling subsystem of the server. It provides:

  • Handler base classes and templates for different protocol message categories.
  • Concrete handler classes for each supported protocol message (assignment, inquiry, command).
  • The LambdaHandler class for inline or dynamic handler logic.
  • Factories and utilities for handler instantiation and registration.

Handlers are responsible for:

  • Validating incoming protocol messages.
  • Executing the corresponding application logic (e.g., camera parameter changes, frame requests).
  • Generating and returning appropriate protocol responses.

The namespace acts as the glue between the protocol parsing layer and the per-client application logic, ensuring a clean separation of concerns and facilitating extensibility.

See also
irsol::server::handlers::MessageHandler
irsol::protocol

Typedef Documentation

◆ AssignmentHandler

Handler type for assignment messages.

Definition at line 88 of file base.hpp.

◆ AssignmentImgHeightHandler

◆ AssignmentImgLeftHandler

◆ AssignmentImgTopHandler

◆ AssignmentImgWidthHandler

◆ CommandHandler

Handler type for command messages.

Definition at line 96 of file base.hpp.

◆ in_message_t

◆ InquiryHandler

Handler type for inquiry messages.

Definition at line 92 of file base.hpp.

◆ InquiryImgHeightHandler

◆ InquiryImgLeftHandler

Handler for inquiring the left offset ("OffsetX") of the camera image.

Definition at line 96 of file inquiry_image_size.hpp.

◆ InquiryImgTopHandler

Handler for inquiring the top offset ("OffsetY") of the camera image.

Definition at line 101 of file inquiry_image_size.hpp.

◆ InquiryImgWidthHandler

◆ out_message_t

Function Documentation

◆ makeHandler()

template<typename HandlerT , typename... Args>
constexpr auto irsol::server::handlers::makeHandler ( std::shared_ptr< Context ctx,
Args &&...  args 
)
constexpr

Constructs a handler instance of the given type.

Template Parameters
HandlerTHandler class type.
ArgsConstructor argument types.
Parameters
ctxHandler context.
argsAdditional arguments for the handler constructor.
Returns
Handler instance.

Definition at line 28 of file factory.hpp.

29{
30 return HandlerT(ctx, std::forward<Args>(args)...);
31}

◆ makeLambdaHandler()

constexpr auto irsol::server::handlers::makeLambdaHandler ( std::shared_ptr< Context ctx,
LambdaT &&  lambda 
)
constexpr

Constructs a lambda handler for the specified message type.

Template Parameters
InMessageTIncoming message type.
LambdaTLambda function type.
Parameters
ctxHandler context.
lambdaLambda function to invoke for the message.
Returns
LambdaHandler instance.

Definition at line 43 of file factory.hpp.

44{
46 ctx,
47 std::function<std::vector<protocol::OutMessage>(
48 std::shared_ptr<Context>, std::shared_ptr<irsol::server::ClientSession>, InMessageT &&)>(
49 std::forward<LambdaT>(lambda))};
50}
Handler class that delegates protocol message processing to a lambda or callable.