diff options
author | David Robillard <d@drobilla.net> | 2012-03-12 02:28:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-12 02:28:21 +0000 |
commit | e9d9569271ee962c09ab66c6babed1ca5655a6c6 (patch) | |
tree | f77142b08c2bf2488eb382e993da1477c0b94307 /src/server/Event.hpp | |
parent | 7835b3d8c9b5b4a6f4959f56083d62826e6f7b8e (diff) | |
download | ingen-e9d9569271ee962c09ab66c6babed1ca5655a6c6.tar.gz ingen-e9d9569271ee962c09ab66c6babed1ca5655a6c6.tar.bz2 ingen-e9d9569271ee962c09ab66c6babed1ca5655a6c6.zip |
Unify event response mechanism and make it more appropriate for wire transmission.
The downside being more cryptic error messages until the client side error reporting stuff gets more fancy, but the important part is that belongs client side.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4053 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/Event.hpp')
-rw-r--r-- | src/server/Event.hpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/server/Event.hpp b/src/server/Event.hpp index 5f9234bd..9572610c 100644 --- a/src/server/Event.hpp +++ b/src/server/Event.hpp @@ -24,6 +24,8 @@ #include "raul/Path.hpp" #include "raul/SharedPtr.hpp" +#include "ingen/Status.hpp" + #include "types.hpp" namespace Ingen { @@ -73,14 +75,11 @@ public: /** Set the next event to be processed after this one. */ void next(Event* ev) { _next = ev; } - /** Return the error status of this event. */ - int error() const { return _error; } - - /** Respond to the originating client successfully. */ - void respond_ok(); + /** Return the status (success or error code) of this event. */ + Status status() const { return _status; } - /** Respond to the originating client with an error. */ - void respond_error(const std::string& msg); + /** Respond to the originating client. */ + void respond(Status status); protected: Event(Engine& engine, ClientInterface* client, int32_t id, FrameTime time) @@ -88,7 +87,7 @@ protected: , _request_client(client) , _request_id(id) , _time(time) - , _error(0) // success + , _status(SUCCESS) , _pre_processed(false) , _executed(false) {} @@ -99,7 +98,7 @@ protected: , _request_client(NULL) , _request_id(-1) , _time(0) - , _error(0) // success + , _status(SUCCESS) , _pre_processed(false) , _executed(false) {} @@ -109,7 +108,7 @@ protected: ClientInterface* _request_client; int32_t _request_id; FrameTime _time; - int _error; + Status _status; bool _pre_processed; bool _executed; }; |