IRSOL
C++ code implementing socket server for interacting with Baumer camera.
irsol::server::handlers::internal::InquiryImgHandlerBase< InquiryCameraImageAttribute > Class Template Reference

Base handler template for inquiring a camera image region parameter. More...

#include <inquiry_image_size.hpp>

Inheritance diagram for irsol::server::handlers::internal::InquiryImgHandlerBase< InquiryCameraImageAttribute >:
irsol::server::handlers::internal::HandlerBase< T, >

Public Member Functions

 InquiryImgHandlerBase (std::shared_ptr< Context > ctx)
 Constructs the handler.
 
- 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.
 

Protected Member Functions

std::vector< out_message_tprocess (IRSOL_MAYBE_UNUSED std::shared_ptr< irsol::server::ClientSession > session, protocol::Inquiry &&message) final override
 Processes an inquiry message to retrieve the camera image parameter.
 
- 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.
 

Static Private Attributes

static constexpr std::string_view name = InquiryCameraImageAttribute::name
 

Additional Inherited Members

- Protected Attributes inherited from irsol::server::handlers::internal::HandlerBase< T, >
std::shared_ptr< Contextctx
 Handler context (provides access to app and utilities).
 

Detailed Description

template<typename InquiryCameraImageAttribute>
class irsol::server::handlers::internal::InquiryImgHandlerBase< InquiryCameraImageAttribute >

Base handler template for inquiring a camera image region parameter.

Template Parameters
InquiryCameraImageAttributeTag type specifying the parameter name.

Handles inquiry messages to retrieve a specific camera image region parameter.

Definition at line 62 of file inquiry_image_size.hpp.

Constructor & Destructor Documentation

◆ InquiryImgHandlerBase()

Constructs the handler.

Parameters
ctxHandler context.

Definition at line 71 of file inquiry_image_size.hpp.

std::shared_ptr< Context > ctx
Handler context (provides access to app and utilities).
Definition base.hpp:81
internal::HandlerBase< protocol::Inquiry > InquiryHandler
Handler type for inquiry messages.
Definition base.hpp:92

Member Function Documentation

◆ process()

Processes an inquiry message to retrieve the camera image parameter.

Parameters
sessionThe client session.
messageThe inquiry message.
Returns
Vector of outbound messages containing the parameter value.

Definition at line 80 of file inquiry_image_size.hpp.

83 {
84 auto& cam = ctx->app.camera();
85 int value = cam.getParam<int>(std::string(name));
86 std::vector<out_message_t> result;
88 return result;
89 }
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
Definition factory.hpp:28
std::variant< int, double, std::string > protocol_value_t
Variant type representing protocol values that can be one of several types.
Definition types.hpp:150
static Success from(const Assignment &msg, std::optional< irsol::types::protocol_value_t > overrideValue=std::nullopt)
Creates a success message from an Assignment.
Definition success.hpp:75
auto value
auto result

Member Data Documentation

◆ name

constexpr std::string_view irsol::server::handlers::internal::InquiryImgHandlerBase< InquiryCameraImageAttribute >::name = InquiryCameraImageAttribute::name
staticconstexprprivate

Definition at line 64 of file inquiry_image_size.hpp.


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