pars 0.2.1
Loading...
Searching...
No Matches
pars::net::rep Class Reference

Represents an nng_rep protocol. More...

#include <rep.h>

Public Member Functions

 rep (ev::hf_registry &h, ev::enqueuer &r)
 Construct a rep.
 
socketsock ()
 Get the socket.
 
const socketsock () const
 Get the socket.
 
context_registryctxs ()
 Get the context_registry.
 
void stop ()
 Stop socket and all contexts.
 
template<template< typename > typename kind_of, ev::event_c event_t, typename class_t>
requires ev::kind_c<kind_of>
void on (void(class_t::*hf)(ev::hf_arg< kind_of, event_t >), class_t *self)
 
template<template< typename > typename kind_of, ev::event_c event_t>
requires ev::kind_c<kind_of>
void insert (ev::handler_f< kind_of, event_t > hf)
 

Detailed Description

Represents an nng_rep protocol.

Definition at line 44 of file rep.h.

Constructor & Destructor Documentation

◆ rep()

pars::net::rep::rep ( ev::hf_registry & h,
ev::enqueuer & r )
inline

Construct a rep.

Definition at line 48 of file rep.h.

49 : sock_m{r, nngxx::rep::v0::make_socket().value_or_abort()}
50 , ctx_registry_m{r, sock_m}
51 , hf_registry_m{h}
52 {
53 }

References rep().

Referenced by rep().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ ctxs()

context_registry & pars::net::rep::ctxs ( )
inline

Get the context_registry.

Definition at line 62 of file rep.h.

62{ return ctx_registry_m; }

◆ insert()

template<template< typename > typename kind_of, ev::event_c event_t>
requires ev::kind_c<kind_of>
void pars::net::rep::insert ( ev::handler_f< kind_of, event_t > hf)
inline

Definition at line 82 of file rep.h.

83 {
84 hf_registry_m.insert(sock_m.id(), std::move(hf));
85 }

Referenced by on().

Here is the caller graph for this function:

◆ on()

template<template< typename > typename kind_of, ev::event_c event_t, typename class_t>
requires ev::kind_c<kind_of>
void pars::net::rep::on ( void(class_t::* hf )(ev::hf_arg< kind_of, event_t >),
class_t * self )
inline

Definition at line 75 of file rep.h.

76 {
78 }
void insert(ev::handler_f< kind_of, event_t > hf)
Definition rep.h:82
handler_f< kind_of, event_t > make_hf(mem_fn_t &mem_fn, class_t *self)
Definition make_hf.h:58

References insert(), and pars::ev::make_hf().

Here is the call graph for this function:

◆ sock() [1/2]

socket & pars::net::rep::sock ( )
inline

Get the socket.

Definition at line 56 of file rep.h.

56{ return sock_m; }

◆ sock() [2/2]

const socket & pars::net::rep::sock ( ) const
inline

Get the socket.

Definition at line 59 of file rep.h.

59{ return sock_m; }

◆ stop()

void pars::net::rep::stop ( )
inline

Stop socket and all contexts.

Definition at line 65 of file rep.h.

66 {
67 sock_m.stop();
68
69 ctx_registry_m.stop_all();
70 }

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