23 #ifndef MINIMALAPPLICATIONBASE20110413H 24 #define MINIMALAPPLICATIONBASE20110413H 28 #include <boost/shared_ptr.hpp> 30 #include "goby/common/configuration_reader.h" 31 #include "goby/common/exception.h" 33 #include "goby/common/protobuf/app_base_config.pb.h" 35 #include "goby/common/logger.h" 45 template <
typename App,
typename Config>
int run(
int argc,
char* argv[], Config* cfg);
56 void quit() { alive_ =
false; }
58 virtual void iterate() = 0;
65 template <
typename App,
typename Config>
66 friend int ::goby::run(
int argc,
char* argv[], Config* cfg);
74 void __set_application_name(
const std::string& s) { base_cfg_->set_app_name(s); }
75 void __set_platform_name(
const std::string& s) { base_cfg_->set_platform_name(s); }
91 std::vector<boost::shared_ptr<std::ofstream> > fout_;
96 template <
typename App,
typename Config>
int goby::run(
int argc,
char* argv[], Config* cfg)
112 catch (std::exception& e)
115 std::cerr <<
"uncaught exception: " << e.what() << std::endl;
indicates a problem with the runtime command line or .cfg file configuration (or –help was given) ...
std::string platform_name()
name of this platform (from AppBaseConfig::platform_name). E.g. "AUV-23" or "unicorn" ...
int run(int argc, char *argv[], Config *cfg)
Run a Goby application derived from MinimalApplicationBase. blocks caller until MinimalApplicationBas...
std::string application_name()
name of this application (from AppBaseConfig::app_name). E.g. "garmin_gps_g"
void quit()
Requests a clean (return 0) exit.
The global namespace for the Goby project.