pars 0.2.1.99
Loading...
Searching...
No Matches
pars::app::single< component_t > Class Template Referenceabstract

#include <single.h>

Inheritance diagram for pars::app::single< component_t >:
Collaboration diagram for pars::app::single< component_t >:

Public Types

using component_type = component_t
 
using self_type = single<component_type>
 

Public Member Functions

 single ()
 
int exec (int argc, char **argv)
 
- Public Member Functions inherited from pars::app::with_default_setup
void enable_source_loc_logging ()
 
void setup ()
 

Protected Member Functions

component_typecomp ()
 
ev::enqueuerrouter ()
 
ev::hf_registryhfs ()
 
virtual void startup (int argc, char **argv)=0
 
void graceful_terminate ()
 
void terminate_now ()
 
void stop_job_thread (const int j_id)
 
int run ()
 
- Protected Member Functions inherited from pars::app::with_default_setup
 with_default_setup ()=default
 

Detailed Description

template<typename component_t>
class pars::app::single< component_t >

Definition at line 43 of file single.h.

Member Typedef Documentation

◆ component_type

template<typename component_t>
using pars::app::single< component_t >::component_type = component_t

Definition at line 46 of file single.h.

◆ self_type

template<typename component_t>
using pars::app::single< component_t >::self_type = single<component_type>

Definition at line 47 of file single.h.

Constructor & Destructor Documentation

◆ single()

template<typename component_t>
pars::app::single< component_t >::single ( )
inline

Definition at line 49 of file single.h.

50 : runner_m{hf_registry_m}
51 , hf_registry_m{runner_m}
52 , dispatcher_m{runner_m}
53 , router_m{dispatcher_m, runner_m}
54 , component_m{hf_registry_m, router_m}
55 {
56 }

Member Function Documentation

◆ comp()

template<typename component_t>
component_type & pars::app::single< component_t >::comp ( )
inlineprotected

Definition at line 70 of file single.h.

70{ return component_m; }

◆ exec()

template<typename component_t>
int pars::app::single< component_t >::exec ( int argc,
char ** argv )
inline

Definition at line 58 of file single.h.

59 {
61
62 setup();
63
65
66 return run();
67 }
virtual void startup(int argc, char **argv)=0

◆ graceful_terminate()

template<typename component_t>
void pars::app::single< component_t >::graceful_terminate ( )
inlineprotected

Definition at line 78 of file single.h.

79 {
80 dispatcher_m.stop_running();
81
82 component_m.graceful_terminate();
83
84 dispatcher_m.terminate_now();
85 }

◆ hfs()

template<typename component_t>
ev::hf_registry & pars::app::single< component_t >::hfs ( )
inlineprotected

Definition at line 74 of file single.h.

74{ return hf_registry_m; }

◆ router()

template<typename component_t>
ev::enqueuer & pars::app::single< component_t >::router ( )
inlineprotected

Definition at line 72 of file single.h.

72{ return router_m; }

◆ run()

template<typename component_t>
int pars::app::single< component_t >::run ( )
inlineprotected

Definition at line 91 of file single.h.

92 {
93 try
94 {
95 dispatcher_m.run();
96
97 return EXIT_SUCCESS;
98 }
99 catch (std::exception& e)
100 {
101 pars::err(SL, lf::app, "Error while running single application: {}",
102 e.what());
103
104 return EXIT_FAILURE;
105 }
106 }
void err(spdlog::source_loc loc, pars::lf lf, spdlog::format_string_t< args_t... > fmt, args_t &&... args)
Definition log.h:211

Referenced by pars::app::single< component_type >::exec().

Here is the caller graph for this function:

◆ startup()

template<typename component_t>
virtual void pars::app::single< component_t >::startup ( int argc,
char ** argv )
protectedpure virtual

Referenced by pars::app::single< component_type >::exec().

Here is the caller graph for this function:

◆ stop_job_thread()

template<typename component_t>
void pars::app::single< component_t >::stop_job_thread ( const int j_id)
inlineprotected

Definition at line 89 of file single.h.

89{ runner_m.stop_thread(j_id); }

◆ terminate_now()

template<typename component_t>
void pars::app::single< component_t >::terminate_now ( )
inlineprotected

Definition at line 87 of file single.h.

87{ dispatcher_m.terminate_now(); }

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