Dripline-Cpp  v2.10.11
Dripline Implementation in C++
run_oscillator_service_endpoints.cc
Go to the documentation of this file.
1 /*
2  * run_oscillator_service_endpoints.cc
3  *
4  * Created on: May 21, 2019
5  * Author: N.S. Oblath
6  */
7 
8 #include "agent_config.hh"
9 #include "dripline_constants.hh"
10 #include "service_config.hh"
11 #include "version_store.hh"
13 
14 #include "application.hh"
15 #include "logger.hh"
16 #include "signal_handler.hh"
17 
18 using namespace dripline;
19 
20 LOGGER( dlog, "run_oscillation_service_endpoints" );
21 
22 int main( int argc, char** argv )
23 {
24  // Start handling signals
25  scarab::signal_handler t_sig_hand( true );
26 
27  scarab::main_app the_main;
28 
29  the_main.set_version( version_store::get_instance()->versions().at("dripline-cpp") );
30 
31  the_main.default_config() = service_config( "osc_svc_ep" );
32 
33  add_dripline_options( the_main );
34  add_service_options( the_main );
35 
36  int the_return = -1;
37 
38  auto t_service_callback = [&](){
39  auto the_service = std::make_shared< oscillator_service_endpoints >( the_main.primary_config(), the_main.auth() );
40 
41  the_service->execute();
42 
43  the_return = the_service->get_return();
44  };
45 
46  the_main.callback( t_service_callback );
47 
48  CLI11_PARSE( the_main, argc, argv );
49 
50  return the_return;
51 }
52 
53 
54 
Sets the default service configuration.
void add_service_options(scarab::main_app &an_app)
Add service options to an app object.
static ::scarab::logger_type< ::scarab::spd_initializer_async_stdout_color_mt > dlog("agent", __FILE_NAME__, __LINE__)
void add_dripline_options(scarab::main_app &an_app)
Add dripline mesh CL options to an app object.
int main(int argc, char **argv)