Dripline-Cpp  v2.4.2
Dripline Implementation in C++
run_simple_service.cc
Go to the documentation of this file.
1 /*
2  * run_simple_service.cc
3  *
4  * Created on: Aug 23, 2018
5  * Author: N.S. Oblath
6  */
7 
8 #include "agent_config.hh"
9 #include "dripline_constants.hh"
10 #include "application.hh"
11 #include "logger.hh"
12 #include "version_store.hh"
13 #include "simple_service.hh"
14 
15 using namespace dripline;
16 
17 LOGGER( dlog, "simple_service" );
18 
19 int main( int argc, char** argv )
20 {
21  scarab::main_app the_main;
22 
23  the_main.set_version( version_store::get_instance()->versions().at( "dripline-cpp" ) );
24 
25  the_main.default_config().add( "dripline", dripline_config() );
26 
27  add_dripline_options( the_main );
28 
29  int the_return = -1;
30 
31  auto t_service_callback = [&](){
32  auto the_service = std::make_shared< simple_service >( the_main.master_config()["dripline"].as_node() );
33 
34  the_service->execute();
35 
36  the_return = the_service->get_return();
37  };
38 
39  the_main.callback( t_service_callback );
40 
41  CLI11_PARSE( the_main, argc, argv );
42 
43  return the_return;
44 }
int main(int argc, char **argv)
Sets the default configuration used by core.
static scarab::logger dlog("agent")
void add_dripline_options(scarab::main_app &an_app)
Add basic AMQP options to an app object.