diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-01 23:05:02 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-01 23:20:41 +0100 |
commit | 8c5aad737561837f0b8d616cc03130b7546e45a9 (patch) | |
tree | ff19e700f3fc5e4f27f028caa57e026ea833e846 /apps/apps.h | |
parent | e64d925b45ff4802fe924ea2e8108bb1932b4d01 (diff) | |
download | ble-toys-8c5aad737561837f0b8d616cc03130b7546e45a9.tar.gz ble-toys-8c5aad737561837f0b8d616cc03130b7546e45a9.tar.bz2 ble-toys-8c5aad737561837f0b8d616cc03130b7546e45a9.tar.xz ble-toys-8c5aad737561837f0b8d616cc03130b7546e45a9.zip |
o Trying to structure how apps are made.
Diffstat (limited to 'apps/apps.h')
-rw-r--r-- | apps/apps.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/apps/apps.h b/apps/apps.h index f1cdb8a..3b15bdd 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -6,9 +6,29 @@ namespace trygvis { namespace apps { -const boost::program_options::options_description logging_options(); +namespace po = boost::program_options; -void setup_logging(boost::program_options::variables_map vm); +class app_execution { +public: + app_execution(po::options_description desc, po::variables_map vm) : desc(desc), vm(vm) { + } + + po::options_description desc; + po::variables_map vm; + + void usage(); +}; + +class app { +public: + + virtual void add_options(po::options_description_easy_init& options) { + }; + + virtual int main(app_execution &execution) = 0; +}; + +int launch_app(int argc, char *argv[], app &app); } } |