]> git.tdb.fi Git - r2c2.git/commitdiff
Derive application classes from RegisteredApplication
authorMikko Rasa <tdb@tdb.fi>
Thu, 17 Jan 2013 12:21:27 +0000 (14:21 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 17 Jan 2013 12:22:31 +0000 (14:22 +0200)
source/designer/designer.cpp
source/designer/designer.h
source/engineer/engineer.cpp
source/engineer/engineer.h
source/remote/remote.cpp
source/remote/remote.h
source/serial/serial.cpp
source/serial/serial.h
source/shoppinglist/main.cpp

index 0effc933f8d110de8e1d52b4199fa290422ba562..07c2f785f5a68299d0023439e13c2904412f6edb 100644 (file)
@@ -38,8 +38,6 @@ using namespace std;
 using namespace R2C2;
 using namespace Msp;
 
-Application::RegApp<Designer> Designer::reg;
-
 Designer::Designer(int argc, char **argv):
        window(1280, 960),
        ui_res("r2c2.res"),
index 471bfc709d7b7ea3568e78c8fcee305ed4b24250..b19eb66c2e87b39b4e0c2cec2787181fc21f06ce 100644 (file)
@@ -28,7 +28,7 @@
 
 class Toolbar;
 
-class Designer: public Msp::Application
+class Designer: public Msp::RegisteredApplication<Designer>
 {
 private:
        enum Mode
@@ -70,8 +70,6 @@ private:
 
        Msp::Time::TimeStamp last_tick;
 
-       static Msp::Application::RegApp<Designer> reg;
-
 public:
        Designer(int, char **);
        ~Designer();
index b9e252301b5adbd1b3d77bc0ec6f068ba85239d9..7d1e227e7e4a63112759d9c49518ed6a7bd372d4 100644 (file)
@@ -33,8 +33,6 @@ using namespace std;
 using namespace R2C2;
 using namespace Msp;
 
-Application::RegApp<Engineer> Engineer::reg;
-
 Engineer::Engineer(int argc, char **argv):
        options(argc, argv),
        window(options.screen_w, options.screen_h, options.fullscreen),
index 907fae01ba268161966ef6425a7ff1788e679355..85dc347937b1f7d55d1e7654186f3911a01bff48 100644 (file)
@@ -21,7 +21,7 @@ class MainPanel;
 class TrainPanel;
 class TrainView;
 
-class Engineer: public Msp::Application
+class Engineer: public Msp::RegisteredApplication<Engineer>
 {
 public:
        sigc::signal<void, R2C2::Track *, int> signal_pick_done;
@@ -88,8 +88,6 @@ private:
        R2C2::Track *pick_track(int, int);
        void train_added(R2C2::Train &);
        virtual void sighandler(int);
-
-       static Msp::Application::RegApp<Engineer> reg;
 };
 
 #endif
index b60d11ffe1920ae654f96f5cece9e62c61e7d0ea..dbcb7e4a166de4f252658dc0aad7931b3360d7c0 100644 (file)
@@ -10,8 +10,6 @@
 using namespace std;
 using namespace Msp;
 
-Application::RegApp<Remote> Remote::reg;
-
 Remote::Remote(int argc, char **argv):
        client(catalogue),
        gtk(argc, argv)
index b4c5c129b904b5e5390c4cb8150d9296f0e53dc2..875f25bbbdbf803d962bdece37ee1e568f148727 100644 (file)
@@ -10,7 +10,7 @@
 class MainPanel;
 class TrainPanel;
 
-class Remote: public Msp::Application
+class Remote: public Msp::RegisteredApplication<Remote>
 {
 private:
        Msp::IO::EventDispatcher event_disp;
@@ -22,8 +22,6 @@ private:
        MainPanel *main_panel;
        std::vector<TrainPanel *> train_panels;
 
-       static Msp::Application::RegApp<Remote> reg;
-
 public:
        Remote(int argc, char **argv);
 
index 13ffd9b473bec5b41305e7bb6b7206cdf0a404fc..50f53bd7aff9b77ef4c40c01685d1a946893ebc3 100644 (file)
@@ -7,8 +7,6 @@ using namespace std;
 using namespace Msp;
 using namespace R2C2;
        
-Application::RegApp<Serial> Serial::reg;
-
 Serial::Serial(int, char **argv):
        client(catalogue),
        serial_port(argv[2]),
index b1f1908059cf6102b2d27815d2e03bd7d0390d80..d2ae4dd06952f50e38c8f2feb7130cf6281c6173 100644 (file)
@@ -5,7 +5,7 @@
 #include <msp/io/serial.h>
 #include "network/client.h"
 
-class Serial: public Msp::Application
+class Serial: public Msp::RegisteredApplication<Serial>
 {
 private:
        Msp::IO::EventDispatcher event_disp;
@@ -17,8 +17,6 @@ private:
        char rx_buf[3];
        unsigned rx_fill;
 
-       static Msp::Application::RegApp<Serial> reg;
-
 public:
        Serial(int, char **);
 
index ff281e6e4a7be4f93574b4923cb56cd7b728a807..8b0a6f6c9aca07b2a9c376902a341360d0897c95 100644 (file)
@@ -10,7 +10,7 @@ using namespace std;
 using namespace Msp;
 using namespace R2C2;
 
-class ShoppingList: public Application
+class ShoppingList: public RegisteredApplication<ShoppingList>
 {
 private:
        class InventoryLoader: public DataFile::Loader
@@ -36,8 +36,6 @@ private:
        map<ArticleNumber, unsigned> inventory;
        map<ArticleNumber, unsigned> layout;
 
-       static Application::RegApp<ShoppingList> reg;
-
 public:
        ShoppingList(int, char **);
        int main();
@@ -47,8 +45,6 @@ private:
 };
 
 
-Application::RegApp<ShoppingList> ShoppingList::reg;
-
 ShoppingList::ShoppingList(int argc, char **argv)
 {
        string inv_fn = "inventory";