diff options
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h')
-rw-r--r-- | runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h new file mode 100644 index 000000000..ffc6d233f --- /dev/null +++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h @@ -0,0 +1,39 @@ +/*
+ * SubSystemRunnerBase.h
+ *
+ * The base class for running components.
+ *
+ * Created on: 29.08.2012
+ * Author: karlitsc
+ */
+
+#ifndef SUBSYSTEMRUNNERBASE_H_
+#define SUBSYSTEMRUNNERBASE_H_
+
+#include <iostream>
+
+namespace etRuntime {
+
+class SubSystemRunnerBase {
+public:
+ SubSystemRunnerBase();
+ ~SubSystemRunnerBase();
+
+ /**
+ * blocks until the String "quit" is entered on the console
+ */
+protected:
+ static void waitForQuit() {
+ // waiting for command line input
+ std::string token = "";
+ std::cout << "type 'quit' to exit" << std::endl;
+ while (token != "quit") {
+ std::getline(std::cin, token);
+ std::cout << "echo: " << token << std::endl;
+ }
+ }
+
+};
+
+} /* namespace etRuntime */
+#endif /* SUBSYSTEMRUNNERBASE_H_ */
|