pars 0.2.1
Loading...
Searching...
No Matches
nngxx Namespace Reference

Namespaces

namespace  pull
 
namespace  push
 
namespace  rep
 
namespace  req
 

Classes

struct  msg_body
 
struct  msg_header
 
struct  opt_getter
 
struct  opt_setter
 
struct  opt_to_nng_type
 
struct  opt_to_nng_type< opt::recvtimeo >
 
struct  opt_to_nng_type< opt::req_resend_tick >
 
struct  opt_to_nng_type< opt::req_resend_time >
 
struct  opt_to_nng_type< opt::sendtimeo >
 
struct  opt_to_nng_type< opt::sockname >
 
struct  value
 

Concepts

concept  nng_value_c
 
concept  nng_with_set_opt_c
 
concept  nng_with_get_opt_c
 
concept  nng_c
 
concept  uint_c
 
concept  move_only_constructible_c
 
concept  move_only_assignable_c
 
concept  movable_only_c
 

Typedefs

using aio_view = clev::iface<nng_aio*>
 
using aio = clev::own<nng_aio*>
 
using ctx_view = clev::iface<nng_ctx>
 
using ctx = clev::own<nng_ctx>
 
using dialer_view = clev::iface<nng_dialer>
 
using dialer = clev::own<nng_dialer>
 
using listener_view = clev::iface<nng_listener>
 
using listener = clev::own<nng_listener>
 
using msg_view = clev::iface<nng_msg*>
 
using msg = clev::own<nng_msg*>
 
template<opt o>
using opt_to_nng_type_t = opt_to_nng_type<o>::return_type
 
using pipe_view = clev::iface<nng_pipe>
 
using socket_view = clev::iface<nng_socket>
 
using socket = clev::own<nng_socket>
 

Enumerations

enum class  err {
  success = 0 , intr = NNG_EINTR , nomem = NNG_ENOMEM , inval = NNG_EINVAL ,
  busy = NNG_EBUSY , timedout = NNG_ETIMEDOUT , connrefused = NNG_ECONNREFUSED , closed = NNG_ECLOSED ,
  again = NNG_EAGAIN , notsup = NNG_ENOTSUP , addrinuse = NNG_EADDRINUSE , state = NNG_ESTATE ,
  noent = NNG_ENOENT , proto = NNG_EPROTO , unreachable = NNG_EUNREACHABLE , addrinval = NNG_EADDRINVAL ,
  perm = NNG_EPERM , msgsize = NNG_EMSGSIZE , connaborted = NNG_ECONNABORTED , connreset = NNG_ECONNRESET ,
  canceled = NNG_ECANCELED , nofiles = NNG_ENOFILES , nospc = NNG_ENOSPC , exist = NNG_EEXIST ,
  readonly = NNG_EREADONLY , writeonly = NNG_EWRITEONLY , crypto = NNG_ECRYPTO , peerauth = NNG_EPEERAUTH ,
  noarg = NNG_ENOARG , ambiguous = NNG_EAMBIGUOUS , badtype = NNG_EBADTYPE , connshut = NNG_ECONNSHUT ,
  internal = NNG_EINTERNAL , syserr = NNG_ESYSERR , tranerr = NNG_ETRANERR
}
 
enum class  opt {
  sockname , raw , recvbuf , sendbuf ,
  recvfd , sendfd , recvtimeo , sendtimeo ,
  locaddr , remaddr , url , maxttl ,
  recvmaxsz , reconnmint , reconnmaxt , peergid ,
  peerpid , peeruid , peerzoneid , req_resend_time ,
  req_resend_tick
}
 
enum class  opt_overload {
  integer , boolean , string , size ,
  sockaddr , duration , uint64
}
 
enum class  pipe_ev { add_pre = NNG_PIPE_EV_ADD_PRE , add_post = NNG_PIPE_EV_ADD_POST , rem_post = NNG_PIPE_EV_REM_POST , num = NNG_PIPE_EV_NUM }
 

Functions

std::error_code make_error_code (err e) noexcept
 
template<typename ret_t, typename arg_t, typename... args_t>
clev::expected< std::remove_pointer_t< arg_t > > make (ret_t(*f)(arg_t, args_t...), args_t... args) noexcept
 
template<typename ret_t, typename... args_t>
requires (!std::is_void_v<ret_t>)
clev::expected< void > invoke (ret_t(*f)(args_t...), args_t... args) noexcept
 
template<typename... args_t>
clev::expected< void > invoke (void(*f)(args_t...), args_t... args) noexcept
 
nng_pipe_ev cast_pipe_ev (pipe_ev ev) noexcept
 
pipe_ev cast_pipe_ev (nng_pipe_ev ev) noexcept
 

Typedef Documentation

◆ aio

using nngxx::aio = clev::own<nng_aio*>

Definition at line 39 of file aio.h.

◆ aio_view

using nngxx::aio_view = clev::iface<nng_aio*>

Definition at line 37 of file aio.h.

◆ ctx

using nngxx::ctx = clev::own<nng_ctx>

Definition at line 39 of file ctx.h.

◆ ctx_view

using nngxx::ctx_view = clev::iface<nng_ctx>

Definition at line 37 of file ctx.h.

◆ dialer

using nngxx::dialer = clev::own<nng_dialer>

Definition at line 39 of file dialer.h.

◆ dialer_view

using nngxx::dialer_view = clev::iface<nng_dialer>

Definition at line 37 of file dialer.h.

◆ listener

using nngxx::listener = clev::own<nng_listener>

Definition at line 39 of file listener.h.

◆ listener_view

using nngxx::listener_view = clev::iface<nng_listener>

Definition at line 37 of file listener.h.

◆ msg

using nngxx::msg = clev::own<nng_msg*>

Definition at line 39 of file msg.h.

◆ msg_view

using nngxx::msg_view = clev::iface<nng_msg*>

Definition at line 37 of file msg.h.

◆ opt_to_nng_type_t

template<opt o>
using nngxx::opt_to_nng_type_t = opt_to_nng_type<o>::return_type

Definition at line 260 of file opt.h.

◆ pipe_view

using nngxx::pipe_view = clev::iface<nng_pipe>

Definition at line 37 of file pipe.h.

◆ socket

using nngxx::socket = clev::own<nng_socket>

Definition at line 45 of file socket_decl.h.

◆ socket_view

using nngxx::socket_view = clev::iface<nng_socket>

Definition at line 43 of file socket_decl.h.

Enumeration Type Documentation

◆ err

enum class nngxx::err
strong
Enumerator
success 
intr 
nomem 
inval 
busy 
timedout 
connrefused 
closed 
again 
notsup 
addrinuse 
state 
noent 
proto 
unreachable 
addrinval 
perm 
msgsize 
connaborted 
connreset 
canceled 
nofiles 
nospc 
exist 
readonly 
writeonly 
crypto 
peerauth 
noarg 
ambiguous 
badtype 
connshut 
internal 
syserr 
tranerr 

Definition at line 73 of file err.h.

74{
75 success = 0,
76 intr = NNG_EINTR,
77 nomem = NNG_ENOMEM,
78 inval = NNG_EINVAL,
79 busy = NNG_EBUSY,
80 timedout = NNG_ETIMEDOUT,
81 connrefused = NNG_ECONNREFUSED,
82 closed = NNG_ECLOSED,
83 again = NNG_EAGAIN,
84 notsup = NNG_ENOTSUP,
85 addrinuse = NNG_EADDRINUSE,
86 state = NNG_ESTATE,
87 noent = NNG_ENOENT,
88 proto = NNG_EPROTO,
89 unreachable = NNG_EUNREACHABLE,
90 addrinval = NNG_EADDRINVAL,
91 perm = NNG_EPERM,
92 msgsize = NNG_EMSGSIZE,
93 connaborted = NNG_ECONNABORTED,
94 connreset = NNG_ECONNRESET,
95 canceled = NNG_ECANCELED,
96 nofiles = NNG_ENOFILES,
97 nospc = NNG_ENOSPC,
98 exist = NNG_EEXIST,
99 readonly = NNG_EREADONLY,
100 writeonly = NNG_EWRITEONLY,
101 crypto = NNG_ECRYPTO,
102 peerauth = NNG_EPEERAUTH,
103 noarg = NNG_ENOARG,
104 ambiguous = NNG_EAMBIGUOUS,
105 badtype = NNG_EBADTYPE,
106 connshut = NNG_ECONNSHUT,
107 internal = NNG_EINTERNAL,
108 syserr = NNG_ESYSERR,
109 tranerr = NNG_ETRANERR
110};
@ exist
Definition err.h:98
@ nospc
Definition err.h:97
@ notsup
Definition err.h:84
@ inval
Definition err.h:78
@ ambiguous
Definition err.h:104
@ success
Definition err.h:75
@ noent
Definition err.h:87
@ readonly
Definition err.h:99
@ proto
Definition err.h:88
@ closed
Definition err.h:82
@ badtype
Definition err.h:105
@ connreset
Definition err.h:94
@ nomem
Definition err.h:77
@ connshut
Definition err.h:106
@ crypto
Definition err.h:101
@ again
Definition err.h:83
@ timedout
Definition err.h:80
@ intr
Definition err.h:76
@ busy
Definition err.h:79
@ addrinval
Definition err.h:90
@ state
Definition err.h:86
@ unreachable
Definition err.h:89
@ connaborted
Definition err.h:93
@ tranerr
Definition err.h:109
@ syserr
Definition err.h:108
@ addrinuse
Definition err.h:85
@ perm
Definition err.h:91
@ nofiles
Definition err.h:96
@ internal
Definition err.h:107
@ canceled
Definition err.h:95
@ connrefused
Definition err.h:81
@ noarg
Definition err.h:103
@ writeonly
Definition err.h:100
@ peerauth
Definition err.h:102
@ msgsize
Definition err.h:92

◆ opt

enum class nngxx::opt
strong
Enumerator
sockname 
raw 
recvbuf 
sendbuf 
recvfd 
sendfd 
recvtimeo 
sendtimeo 
locaddr 
remaddr 
url 
maxttl 
recvmaxsz 
reconnmint 
reconnmaxt 
peergid 
peerpid 
peeruid 
peerzoneid 
req_resend_time 
req_resend_tick 

Definition at line 38 of file opt.h.

39{
41 raw,
42 // proto, // deprecated
43 // protoname, // deprecated
44 // peer, // deprecated
45 // peername, // deprecated
46 recvbuf,
47 sendbuf,
48 recvfd,
49 sendfd,
52 locaddr,
53 remaddr,
54 url,
55 maxttl,
59 peergid,
60 peerpid,
61 peeruid,
65};
@ maxttl
Definition opt.h:55
@ remaddr
Definition opt.h:53
@ sockname
Definition opt.h:40
@ req_resend_time
Definition opt.h:63
@ peerzoneid
Definition opt.h:62
@ sendtimeo
Definition opt.h:51
@ peerpid
Definition opt.h:60
@ peeruid
Definition opt.h:61
@ locaddr
Definition opt.h:52
@ reconnmint
Definition opt.h:57
@ url
Definition opt.h:54
@ recvbuf
Definition opt.h:46
@ recvtimeo
Definition opt.h:50
@ recvmaxsz
Definition opt.h:56
@ peergid
Definition opt.h:59
@ recvfd
Definition opt.h:48
@ raw
Definition opt.h:41
@ reconnmaxt
Definition opt.h:58
@ sendbuf
Definition opt.h:47
@ sendfd
Definition opt.h:49
@ req_resend_tick
Definition opt.h:64

◆ opt_overload

enum class nngxx::opt_overload
strong
Enumerator
integer 
boolean 
string 
size 
sockaddr 
duration 
uint64 

Definition at line 67 of file opt.h.

◆ pipe_ev

enum class nngxx::pipe_ev
strong
Enumerator
add_pre 
add_post 
rem_post 
num 

Definition at line 39 of file pipe.h.

40{
41 add_pre = NNG_PIPE_EV_ADD_PRE,
42 add_post = NNG_PIPE_EV_ADD_POST,
43 rem_post = NNG_PIPE_EV_REM_POST,
44 num = NNG_PIPE_EV_NUM
45};

Function Documentation

◆ cast_pipe_ev() [1/2]

pipe_ev nngxx::cast_pipe_ev ( nng_pipe_ev ev)
inlinenoexcept

Definition at line 52 of file pipe.h.

53{
54 return static_cast<pipe_ev>(ev);
55}
pipe_ev
Definition pipe.h:40

◆ cast_pipe_ev() [2/2]

nng_pipe_ev nngxx::cast_pipe_ev ( pipe_ev ev)
inlinenoexcept

Definition at line 47 of file pipe.h.

48{
49 return static_cast<nng_pipe_ev>(ev);
50}

◆ invoke() [1/2]

template<typename ret_t, typename... args_t>
requires (!std::is_void_v<ret_t>)
clev::expected< void > nngxx::invoke ( ret_t(* )(args_t...),
args_t... args )
inlinenodiscardnoexcept

Definition at line 123 of file err.h.

125{
126 return clev::make_expected<err>(f(args...));
127}
clev::expected< void > make_expected(const int e) noexcept
Definition err.h:240

References clev::make_expected().

Referenced by nngxx::msg_body::append(), nngxx::msg_body::chop(), nngxx::msg_body::chop(), nngxx::opt_getter< opt_v, nng_t >::operator()(), nngxx::opt_setter< opt_v, nng_t >::operator()(), nngxx::msg_body::trim(), and nngxx::msg_body::trim().

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

◆ invoke() [2/2]

template<typename... args_t>
clev::expected< void > nngxx::invoke ( void(* )(args_t...),
args_t... args )
inlinenodiscardnoexcept

Definition at line 130 of file err.h.

132{
133 f(args...);
134
135 return {};
136}

◆ make()

template<typename ret_t, typename arg_t, typename... args_t>
clev::expected< std::remove_pointer_t< arg_t > > nngxx::make ( ret_t(* )(arg_t, args_t...),
args_t... args )
inlinenodiscardnoexcept

Definition at line 114 of file err.h.

115{
116 std::remove_pointer_t<arg_t> x;
117
118 return clev::make_expected<err>(f(&x, args...)).transform_to(std::move(x));
119}
auto transform_to(to_value_t &&v) &&noexcept
Definition err.h:119

References clev::make_expected(), and clev::expected< void >::transform_to().

Here is the call graph for this function:

◆ make_error_code()

std::error_code nngxx::make_error_code ( err e)
inlinenodiscardnoexcept

Definition at line 58 of file err.h.

59{
60 return std::error_code(static_cast<int>(e), error_category());
61}