Commit 7c0d1ce5 authored by legoc's avatar legoc
Browse files

(split) Removed Option enum and defined OUTPUSTREAM as const int, added...

(split) Removed Option enum and defined OUTPUSTREAM as const int, added Instance::waitFor() and Instance::waitFor(int) for python binding
parent 2f86220a
...@@ -2,7 +2,7 @@ if(NOT DEFINED PROJECT_NAME) ...@@ -2,7 +2,7 @@ if(NOT DEFINED PROJECT_NAME)
cmake_minimum_required(VERSION 3.7.2) cmake_minimum_required(VERSION 3.7.2)
# Project name and version # Project name and version
project(cameo VERSION 1.0.2 LANGUAGES CXX) project(cameo VERSION 1.1.0 LANGUAGES CXX)
#cmake_policy(SET CMP0048 NEW) #cmake_policy(SET CMP0048 NEW)
endif() endif()
......
1.1.0
-----
* Removed Option enum and defined OUTPUSTREAM as const int.
* Added Instance::waitFor() and Instance::waitFor(int) for python binding.
1.0.2 1.0.2
----- -----
......
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
namespace cameo { namespace cameo {
enum Option { /**
NONE = 0, * Option output stream.
OUTPUTSTREAM = 1 */
}; const int OUTPUTSTREAM = 1;
class Server; class Server;
class EventStreamSocket; class EventStreamSocket;
...@@ -255,8 +255,10 @@ public: ...@@ -255,8 +255,10 @@ public:
bool stop(); bool stop();
bool kill(); bool kill();
State waitFor(StateHandlerType handler = nullptr); State waitFor(int states, StateHandlerType handler);
State waitFor(int states, StateHandlerType handler = nullptr); State waitFor(int states);
State waitFor(StateHandlerType handler);
State waitFor();
State waitFor(const std::string& eventName); State waitFor(const std::string& eventName);
State waitFor(KeyValue& keyValue); State waitFor(KeyValue& keyValue);
......
...@@ -64,11 +64,11 @@ public: ...@@ -64,11 +64,11 @@ public:
*/ */
bool isAvailable() const; bool isAvailable() const;
std::unique_ptr<application::Instance> start(const std::string& name, const std::vector<std::string> &args, Option options = NONE); std::unique_ptr<application::Instance> start(const std::string& name, const std::vector<std::string> &args, int options = 0);
std::unique_ptr<application::Instance> start(const std::string& name, Option options = NONE); std::unique_ptr<application::Instance> start(const std::string& name, int options = 0);
application::InstanceArray connectAll(const std::string& name, Option options = NONE); application::InstanceArray connectAll(const std::string& name, int options = 0);
std::unique_ptr<application::Instance> connect(const std::string& name, Option options = NONE); std::unique_ptr<application::Instance> connect(const std::string& name, int options = 0);
std::unique_ptr<application::Instance> connect(int id, Option options = NONE); std::unique_ptr<application::Instance> connect(int id, int options = 0);
/** /**
* throws ConnectionTimeout * throws ConnectionTimeout
......
...@@ -697,11 +697,21 @@ State Instance::waitFor(int states, StateHandlerType handler) { ...@@ -697,11 +697,21 @@ State Instance::waitFor(int states, StateHandlerType handler) {
return waitFor(states, "", keyValue, handler, true); return waitFor(states, "", keyValue, handler, true);
} }
State Instance::waitFor(int states) {
KeyValue keyValue("");
return waitFor(states, "", keyValue, nullptr, true);
}
State Instance::waitFor(StateHandlerType handler) { State Instance::waitFor(StateHandlerType handler) {
KeyValue keyValue(""); KeyValue keyValue("");
return waitFor(0, "", keyValue, handler, true); return waitFor(0, "", keyValue, handler, true);
} }
State Instance::waitFor() {
KeyValue keyValue("");
return waitFor(0, "", keyValue, nullptr, true);
}
State Instance::waitFor(const std::string& eventName) { State Instance::waitFor(const std::string& eventName) {
KeyValue keyValue(""); KeyValue keyValue("");
return waitFor(0, eventName, keyValue, nullptr, true); return waitFor(0, eventName, keyValue, nullptr, true);
......
...@@ -125,11 +125,11 @@ std::unique_ptr<application::Instance> Server::makeInstance() { ...@@ -125,11 +125,11 @@ std::unique_ptr<application::Instance> Server::makeInstance() {
return unique_ptr<application::Instance>(new application::Instance(this)); return unique_ptr<application::Instance>(new application::Instance(this));
} }
std::unique_ptr<application::Instance> Server::start(const std::string& name, Option options) { std::unique_ptr<application::Instance> Server::start(const std::string& name, int options) {
return start(name, vector<string>(), options); return start(name, vector<string>(), options);
} }
std::unique_ptr<application::Instance> Server::start(const std::string& name, const std::vector<std::string> & args, Option options) { std::unique_ptr<application::Instance> Server::start(const std::string& name, const std::vector<std::string> & args, int options) {
bool outputStream = ((options & OUTPUTSTREAM) != 0); bool outputStream = ((options & OUTPUTSTREAM) != 0);
...@@ -195,7 +195,7 @@ Response Server::stopApplicationAsynchronously(int id, bool immediately) const { ...@@ -195,7 +195,7 @@ Response Server::stopApplicationAsynchronously(int id, bool immediately) const {
return Response(value, message); return Response(value, message);
} }
application::InstanceArray Server::connectAll(const std::string& name, Option options) { application::InstanceArray Server::connectAll(const std::string& name, int options) {
bool outputStream = ((options & OUTPUTSTREAM) != 0); bool outputStream = ((options & OUTPUTSTREAM) != 0);
...@@ -261,7 +261,7 @@ application::InstanceArray Server::connectAll(const std::string& name, Option op ...@@ -261,7 +261,7 @@ application::InstanceArray Server::connectAll(const std::string& name, Option op
return aliveInstances; return aliveInstances;
} }
std::unique_ptr<application::Instance> Server::connect(const std::string& name, Option options) { std::unique_ptr<application::Instance> Server::connect(const std::string& name, int options) {
application::InstanceArray instances = connectAll(name, options); application::InstanceArray instances = connectAll(name, options);
...@@ -273,7 +273,7 @@ std::unique_ptr<application::Instance> Server::connect(const std::string& name, ...@@ -273,7 +273,7 @@ std::unique_ptr<application::Instance> Server::connect(const std::string& name,
return std::move(instances[0]); return std::move(instances[0]);
} }
std::unique_ptr<application::Instance> Server::connect(int id, Option options) { std::unique_ptr<application::Instance> Server::connect(int id, int options) {
bool outputStream = ((options & OUTPUTSTREAM) != 0); bool outputStream = ((options & OUTPUTSTREAM) != 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment