Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
nanorpc::core::server< TPacker > Class Template Referencefinal

#include <server.h>

Public Member Functions

type::buffer execute (type::buffer buffer)
 
template<typename TFunc >
void handle (std::string name, TFunc func)
 
template<typename TFunc >
void handle (type::id id, TFunc func)
 

Private Types

using deserializer_type = typename packer_type::deserializer_type
 
using handler_type = std::function< void(deserializer_type &, serializer_type &)>
 
using handlers_type = std::map< type::id, handler_type >
 
using packer_type = TPacker
 
using serializer_type = typename packer_type::serializer_type
 

Static Private Member Functions

template<typename TFunc , typename TArgs >
static std::enable_if_t<!is_same_v< std::decay_t< decltype(invoke_hpp::apply(std::declval< TFunc >), std::declval< TArgs >))) >, void >, void > apply (TFunc func, TArgs args, serializer_type &serializer)
 
template<typename TFunc , typename TArgs >
static std::enable_if_t< is_same_v< std::decay_t< decltype(invoke_hpp::apply(std::declval< TFunc >), std::declval< TArgs >))) >, void >, void > apply (TFunc func, TArgs args, serializer_type &serializer)
 

Private Attributes

handlers_type handlers_
 

Detailed Description

template<typename TPacker>
class nanorpc::core::server< TPacker >

Definition at line 40 of file server.h.

Member Typedef Documentation

◆ deserializer_type

template<typename TPacker >
using nanorpc::core::server< TPacker >::deserializer_type = typename packer_type::deserializer_type
private

Definition at line 136 of file server.h.

◆ handler_type

template<typename TPacker >
using nanorpc::core::server< TPacker >::handler_type = std::function<void (deserializer_type &, serializer_type &)>
private

Definition at line 137 of file server.h.

◆ handlers_type

template<typename TPacker >
using nanorpc::core::server< TPacker >::handlers_type = std::map<type::id, handler_type>
private

Definition at line 138 of file server.h.

◆ packer_type

template<typename TPacker >
using nanorpc::core::server< TPacker >::packer_type = TPacker
private

Definition at line 134 of file server.h.

◆ serializer_type

template<typename TPacker >
using nanorpc::core::server< TPacker >::serializer_type = typename packer_type::serializer_type
private

Definition at line 135 of file server.h.

Member Function Documentation

◆ apply() [1/2]

template<typename TPacker >
template<typename TFunc , typename TArgs >
static std::enable_if_t<!is_same_v<std::decay_t< decltype( invoke_hpp::apply(std::declval<TFunc>), std::declval<TArgs>)) ) >, void>, void> nanorpc::core::server< TPacker >::apply ( TFunc  func,
TArgs  args,
serializer_type serializer 
)
inlinestaticprivate

Definition at line 145 of file server.h.

◆ apply() [2/2]

template<typename TPacker >
template<typename TFunc , typename TArgs >
static std::enable_if_t<is_same_v< std::decay_t< decltype( invoke_hpp::apply(std::declval<TFunc>), std::declval<TArgs>)) ) > , void>, void> nanorpc::core::server< TPacker >::apply ( TFunc  func,
TArgs  args,
serializer_type serializer 
)
inlinestaticprivate

Definition at line 155 of file server.h.

◆ execute()

template<typename TPacker >
type::buffer nanorpc::core::server< TPacker >::execute ( type::buffer  buffer)
inline

Definition at line 72 of file server.h.

◆ handle() [1/2]

template<typename TPacker >
template<typename TFunc >
void nanorpc::core::server< TPacker >::handle ( std::string  name,
TFunc  func 
)
inline

Definition at line 44 of file server.h.

◆ handle() [2/2]

template<typename TPacker >
template<typename TFunc >
void nanorpc::core::server< TPacker >::handle ( type::id  id,
TFunc  func 
)
inline

Definition at line 50 of file server.h.

Member Data Documentation

◆ handlers_

template<typename TPacker >
handlers_type nanorpc::core::server< TPacker >::handlers_
private

Definition at line 140 of file server.h.


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


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20