summaryrefslogtreecommitdiffstats
path: root/src/testremotecontrol
diff options
context:
space:
mode:
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_;
};