pars 0.2.1
Loading...
Searching...
No Matches
pars::ev::job Class Reference

#include <job.h>

Public Member Functions

 job (std::size_t j_id, int s_id, std::size_t h, std::any ke)
 
 job (const job &)=delete
 
 job (job &&)=default
 
joboperator= (const job &)=delete
 
joboperator= (job &&j)=default
 
template<template< typename > typename kind_of, event_c event_t>
requires (!is_same_kind_v<kind_of, received> || std::is_same_v<event_t, nngxx::msg>)
kind_of< event_t > event ()
 
template<template< typename > typename kind_of, event_c event_t>
requires (is_same_kind_v<kind_of, received> && !std::is_same_v<event_t, nngxx::msg>)
received< event_t > event ()
 
std::size_t id () const
 
int socket_id () const
 
std::size_t spec_hash () const
 
auto format_to (std::format_context &ctx) const -> decltype(ctx.out())
 
void set_id (std::size_t id)
 

Detailed Description

Definition at line 46 of file job.h.

Constructor & Destructor Documentation

◆ job() [1/3]

pars::ev::job::job ( std::size_t j_id,
int s_id,
std::size_t h,
std::any ke )
inline

Definition at line 49 of file job.h.

50 : id_m{j_id}
51 , socket_id_m{s_id}
52 , spec_hash_m{h}
53 , event_kind_m{std::move(ke)}
54 {
55 }

Referenced by job(), job(), operator=(), and operator=().

Here is the caller graph for this function:

◆ job() [2/3]

pars::ev::job::job ( const job & )
delete

References job().

Here is the call graph for this function:

◆ job() [3/3]

pars::ev::job::job ( job && )
default

References job().

Here is the call graph for this function:

Member Function Documentation

◆ event() [1/2]

template<template< typename > typename kind_of, event_c event_t>
requires (!is_same_kind_v<kind_of, received> || std::is_same_v<event_t, nngxx::msg>)
kind_of< event_t > pars::ev::job::event ( )
inline

Definition at line 68 of file job.h.

69 {
70 return std::any_cast<kind_of<event_t>>(std::move(event_kind_m));
71 }

Referenced by event().

Here is the caller graph for this function:

◆ event() [2/2]

template<template< typename > typename kind_of, event_c event_t>
requires (is_same_kind_v<kind_of, received> && !std::is_same_v<event_t, nngxx::msg>)
received< event_t > pars::ev::job::event ( )
inline

Definition at line 76 of file job.h.

77 {
78 // get the received<nngxx::msg>
80
81 auto& md = r.md();
82
83 // return a received<event_t>
84 return received{
86 metadata<received, event_t>{md.socket_id(), md.tool(), md.pipe()}};
87 }
kind_of< event_t > event()
Definition job.h:68
received(event_t, metadata< received, event_t >) -> received< event_t >
static event_t to_event(const nngxx::msg &m)
Definition serializer.h:83

References event(), and pars::ev::serialize::to_event().

Here is the call graph for this function:

◆ format_to()

auto pars::ev::job::format_to ( std::format_context & ctx) const -> decltype(ctx.out())
inline

Definition at line 95 of file job.h.

96 {
97 return std::format_to(ctx.out(), "spec:0x{:X}", spec_hash());
98 }
std::size_t spec_hash() const
Definition job.h:93
clev::own< nng_ctx > ctx
Definition ctx.h:39

References spec_hash().

Here is the call graph for this function:

◆ id()

std::size_t pars::ev::job::id ( ) const
inline

Definition at line 89 of file job.h.

89{ return id_m; }

Referenced by pars::ev::runner::exec(), set_id(), and pars::ev::runner::start_thread().

Here is the caller graph for this function:

◆ operator=() [1/2]

job & pars::ev::job::operator= ( const job & )
delete

References job().

Here is the call graph for this function:

◆ operator=() [2/2]

job & pars::ev::job::operator= ( job && j)
default

References pars::ev::is_same_kind_v, and job().

Here is the call graph for this function:

◆ set_id()

void pars::ev::job::set_id ( std::size_t id)
inline

Definition at line 100 of file job.h.

100{ id_m = id; }
std::size_t id() const
Definition job.h:89

References id().

Here is the call graph for this function:

◆ socket_id()

int pars::ev::job::socket_id ( ) const
inline

Definition at line 91 of file job.h.

91{ return socket_id_m; }

Referenced by pars::ev::runner::exec(), and pars::ev::runner::start_thread().

Here is the caller graph for this function:

◆ spec_hash()

std::size_t pars::ev::job::spec_hash ( ) const
inline

Definition at line 93 of file job.h.

93{ return spec_hash_m; }

Referenced by pars::ev::runner::exec(), and format_to().

Here is the caller graph for this function:

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