From 521ee81560be5d065bd090002a2c6b92a322a034 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli (think)" Date: Thu, 16 Aug 2012 17:45:04 +0200 Subject: crc-dabmod: RemoteControl simplifications --- src/testremotecontrol/test.cpp | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'src/testremotecontrol/test.cpp') diff --git a/src/testremotecontrol/test.cpp b/src/testremotecontrol/test.cpp index 84032fc..07b761f 100644 --- a/src/testremotecontrol/test.cpp +++ b/src/testremotecontrol/test.cpp @@ -5,36 +5,18 @@ using namespace std; -#define BUILD_FOO(p) { \ - vector p; \ - p.push_back(#p); \ - p.push_back("That's the" #p); \ - parameters_.push_back(p); \ -} - class TestControllable : public RemoteControllable { public: - TestControllable(string name) + TestControllable(string name) : RemoteControllable(name) { - name_ = name; - - BUILD_FOO(foo); - BUILD_FOO(bar); - BUILD_FOO(baz); - + ADD_PARAMETER(foo, "That's the foo"); + ADD_PARAMETER(bar, "That's the bar"); + ADD_PARAMETER(baz, "That's the baz"); } string get_rc_name() { return name_; }; - list get_supported_parameters() { - list parameterlist; - for (list< vector >::iterator it = parameters_.begin(); it != parameters_.end(); it++) { - parameterlist.push_back((*it)[0]); - } - return parameterlist; - } - void set_parameter(string parameter, string value) { if (parameter == "foo") { stringstream ss(value); @@ -102,9 +84,7 @@ class TestControllable : public RemoteControllable private: long foo_; std::string bar_; - std::string name_; double baz_; - std::list< std::vector > parameters_; }; -- cgit v1.2.3