8 #ifndef _QI_APPLICATION_HPP_
9 # define _QI_APPLICATION_HPP_
11 # include <functional>
12 # include <boost/program_options.hpp>
43 Application(
int& argc,
char** &argv,
const std::string&
name =
"",
const std::string& path =
"");
88 static const std::vector<std::string>& arguments();
99 static const char** argv();
104 static void setName(
const std::string &name);
110 static std::string
name();
117 static void setArguments(
int argc,
char** argv);
122 static void setArguments(
const std::vector<std::string>& arguments);
135 static void* loadModule(
const std::string& name,
int flags=-1);
140 static void unloadModule(
void* handle);
145 static bool terminated();
150 static bool initialized();
158 static const char* program();
183 static const char* realProgram();
190 static const char* _suggestedSdkPath();
197 static bool atEnter(std::function<
void()> func);
204 static bool atExit(std::function<
void()> func);
212 static bool atRun(std::function<
void()> func);
220 static bool atStop(std::function<
void()> func);
232 static bool atSignal(std::function<
void(
int)> func,
int signal);
238 static boost::program_options::options_description& options();
243 static std::string helpText();
251 #define QI_AT_ENTER(func) \
252 static bool QI_UNIQ_DEF(_qi_atenter) QI_ATTR_UNUSED = ::qi::Application::atEnter(func);
259 #define QI_AT_EXIT(func) \
260 static bool QI_UNIQ_DEF(_qi_atexit) QI_ATTR_UNUSED = ::qi::Application::atExit(func);
273 #define _QI_COMMAND_LINE_OPTIONS(desc, opts) \
274 static void QI_UNIQ_DEF(_qi_opt_func)() { \
275 namespace po = boost::program_options; \
276 po::options_description options(desc); \
278 using namespace boost::program_options; \
279 options.add_options() opts; \
281 ::qi::Application::options().add(options); \
283 QI_AT_ENTER(boost::bind(&(QI_UNIQ_DEF(_qi_opt_func))))
285 #endif // _QI_APPLICATION_HPP_
dll import/export and compiler message
Class handling startup and teardown of an application.
#define QI_API_DEPRECATED_MSG(msg__)
Compiler flags to mark a function as deprecated. It will generate a compiler warning.