Dripline-Cpp  v2.10.11
Dripline Implementation in C++
service_config.cc
Go to the documentation of this file.
1 /*
2  * service_config.cc
3  *
4  * Created on: Aug 24, 2024
5  * Author: N.S. Oblath
6  */
7 
8 #define DRIPLINE_API_EXPORTS
9 
10 #include "service_config.hh"
11 
12 #include "application.hh"
13 #include "param_helpers_impl.hh"
14 
15 //#include "logger.hh"
16 
17 //LOGGER( dlog, "service_config" );
18 
19 namespace dripline
20 {
21 
22  service_config::service_config( const std::string& a_name )
23  {
24  // default service configuration
25 
26  add( "dripline_mesh", dripline_config() );
27 
28  add( "name", a_name );
29  add( "loop_timeout_ms", 1000 );
30  add( "message_wait_ms", 1000 );
31  add( "heartbeat_interval_s", 60 );
32  }
33 
34  void add_service_options( scarab::main_app& an_app )
35  {
36  an_app.add_config_option< unsigned >( "--loop-timeout-ms" "loop_timeout_ms", "Set the timeout for thread loops in ms" );
37  an_app.add_config_option< unsigned >( "--message-wait-ms" "message_wait_ms", "Set the time to wait for a full multi-part message in ms" );
38  an_app.add_config_option< unsigned >( "--heartbeat-interval-s", "heartbeat_interval_s", "Set the interval between heartbeats in s" );
39  return;
40  }
41 
42 } /* namespace dripline */
Sets the default configuration used by core. These parameters pertain to the dripline mesh that will ...
service_config(const std::string &a_name="a_service")
Constructor: name is available as a parameter since it needs to be unique for each service.
void add_service_options(scarab::main_app &an_app)
Add service options to an app object.