IRSOL
C++ code implementing socket server for interacting with Baumer camera.
factory.hpp
Go to the documentation of this file.
1
9
#pragma once
10
11
#include "
irsol/server/handlers/context.hpp
"
12
#include "
irsol/server/handlers/lambda_handler.hpp
"
13
14
namespace
irsol
{
15
namespace
server {
16
namespace
handlers {
17
26
template
<
typename
HandlerT
,
typename
...
Args
>
27
constexpr
auto
28
makeHandler
(std::shared_ptr<Context> ctx,
Args
&&...
args
)
29
{
30
return
HandlerT
(ctx, std::forward<Args>(
args
)...);
31
}
32
41
template
<
typename
InMessageT,
typename
LambdaT>
42
constexpr
auto
43
makeLambdaHandler
(std::shared_ptr<Context> ctx,
LambdaT
&&
lambda
)
44
{
45
return
LambdaHandler<InMessageT>
{
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
}
51
}
52
}
53
}
irsol::server::handlers::LambdaHandler
Handler class that delegates protocol message processing to a lambda or callable.
Definition
lambda_handler.hpp:63
context.hpp
Declaration of the handler context struct.
lambda_handler.hpp
Declaration of the LambdaHandler class for protocol message handling.
irsol::server::handlers::makeLambdaHandler
constexpr auto makeLambdaHandler(std::shared_ptr< Context > ctx, LambdaT &&lambda)
Constructs a lambda handler for the specified message type.
Definition
factory.hpp:43
irsol::server::handlers::makeHandler
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
Definition
factory.hpp:28
irsol
Definition
assert.hpp:140
src
irsol
include
irsol
server
handlers
factory.hpp
Generated by
1.9.8