Commit 641eb0c2 authored by legoc's avatar legoc
Browse files

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

Removed Option enum and defined OUTPUSTREAM as const int, added Instance::waitFor() and Instance::waitFor(int) for python binding
parent 17cc003f
......@@ -2,7 +2,7 @@ if(NOT DEFINED PROJECT_NAME)
cmake_minimum_required(VERSION 3.7.2)
# 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)
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
-----
......
......@@ -39,10 +39,10 @@
namespace cameo {
enum Option {
NONE = 0,
OUTPUTSTREAM = 1
};
/**
* Option output stream.
*/
const int OUTPUTSTREAM = 1;
class Server;
class EventStreamSocket;
......@@ -255,8 +255,10 @@ public:
bool stop();
bool kill();
State waitFor(StateHandlerType handler = nullptr);
State waitFor(int states, StateHandlerType handler = nullptr);
State waitFor(int states, StateHandlerType handler);
State waitFor(int states);
State waitFor(StateHandlerType handler);
State waitFor();
State waitFor(const std::string& eventName);
State waitFor(KeyValue& keyValue);
......
......@@ -64,11 +64,11 @@ public:
*/
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, Option options = NONE);
application::InstanceArray connectAll(const std::string& name, Option options = NONE);
std::unique_ptr<application::Instance> connect(const std::string& name, Option options = NONE);
std::unique_ptr<application::Instance> connect(int id, 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, int options = 0);
application::InstanceArray connectAll(const std::string& name, int options = 0);
std::unique_ptr<application::Instance> connect(const std::string& name, int options = 0);
std::unique_ptr<application::Instance> connect(int id, int options = 0);
/**
* throws ConnectionTimeout
......
......@@ -697,11 +697,21 @@ State Instance::waitFor(int states, StateHandlerType handler) {
return waitFor(states, "", keyValue, handler, true);
}
State Instance::waitFor(int states) {
KeyValue keyValue("");
return waitFor(states, "", keyValue, nullptr, true);
}
State Instance::waitFor(StateHandlerType handler) {
KeyValue keyValue("");
return waitFor(0, "", keyValue, handler, true);
}
State Instance::waitFor() {
KeyValue keyValue("");
return waitFor(0, "", keyValue, nullptr, true);
}
State Instance::waitFor(const std::string& eventName) {
KeyValue keyValue("");
return waitFor(0, eventName, keyValue, nullptr, true);
......
......@@ -125,11 +125,11 @@ std::unique_ptr<application::Instance> Server::makeInstance() {
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);
}
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);
......@@ -195,7 +195,7 @@ Response Server::stopApplicationAsynchronously(int id, bool immediately) const {
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);
......@@ -261,7 +261,7 @@ application::InstanceArray Server::connectAll(const std::string& name, Option op
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);
......@@ -273,7 +273,7 @@ std::unique_ptr<application::Instance> Server::connect(const std::string& name,
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);
......
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