summaryrefslogtreecommitdiffstats
path: root/src/testremotecontrol
diff options
context:
space:
mode:
authorMatthias P. Braendli (think) <matthias@mpb.li>2012-08-16 17:45:04 +0200
committerMatthias P. Braendli (think) <matthias@mpb.li>2012-08-16 17:45:04 +0200
commit521ee81560be5d065bd090002a2c6b92a322a034 (patch)
treed4e575707616c423e602ede9118aef88a5b31f83 /src/testremotecontrol
parentf419f8cb2e3768789cb23593cfa7c850acc0fe72 (diff)
downloaddabmod-521ee81560be5d065bd090002a2c6b92a322a034.tar.gz
dabmod-521ee81560be5d065bd090002a2c6b92a322a034.tar.bz2
dabmod-521ee81560be5d065bd090002a2c6b92a322a034.zip
crc-dabmod: RemoteControl simplifications
Diffstat (limited to 'src/testremotecontrol')
-rw-r--r--src/testremotecontrol/Makefile3
-rw-r--r--src/testremotecontrol/test.cpp28
2 files changed, 7 insertions, 24 deletions
diff --git a/src/testremotecontrol/Makefile b/src/testremotecontrol/Makefile
index d5b5d7d..94565c5 100644
--- a/src/testremotecontrol/Makefile
+++ b/src/testremotecontrol/Makefile
@@ -3,3 +3,6 @@ CXXFLAGS=-Wall -g -lboost_system -lboost_thread -I..
all: test
test: test.cpp ../RemoteControl.cpp
+
+clean:
+ rm test
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<string> 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<string> get_supported_parameters() {
- list<string> parameterlist;
- for (list< vector<string> >::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<std::string> > parameters_;
};