Mercurial > hg > piper-cpp
comparison vamp-client/SynchronousTransport.h @ 92:21f8af53eaf0
Reorganise some classes
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 13 Oct 2016 12:02:44 +0100 |
parents | 6429a99abcad |
children | a660dca988f8 |
comparison
equal
deleted
inserted
replaced
91:c897c9a8daf1 | 92:21f8af53eaf0 |
---|---|
1 | 1 |
2 #ifndef PIPER_SYNCHRONOUS_TRANSPORT_H | 2 #ifndef PIPER_SYNCHRONOUS_TRANSPORT_H |
3 #define PIPER_SYNCHRONOUS_TRANSPORT_H | 3 #define PIPER_SYNCHRONOUS_TRANSPORT_H |
4 | 4 |
5 #include <vector> | 5 #include <vector> |
6 #include <cstdlib> | |
6 | 7 |
7 namespace piper { | 8 namespace piper { |
9 | |
10 class MessageCompletenessChecker // interface | |
11 { | |
12 public: | |
13 virtual ~MessageCompletenessChecker() = default; | |
14 | |
15 virtual bool isComplete(const std::vector<char> &message) const = 0; | |
16 }; | |
8 | 17 |
9 class SynchronousTransport // interface | 18 class SynchronousTransport // interface |
10 { | 19 { |
11 public: | 20 public: |
21 virtual ~SynchronousTransport() = default; | |
22 | |
23 //!!! I do not take ownership | |
24 virtual void setCompletenessChecker(MessageCompletenessChecker *) = 0; | |
25 | |
12 //!!! how to handle errors -- exception or return value? often an | 26 //!!! how to handle errors -- exception or return value? often an |
13 //!!! error (e.g. server has exited) may mean the transport can no | 27 //!!! error (e.g. server has exited) may mean the transport can no |
14 //!!! longer be used at all | 28 //!!! longer be used at all |
15 virtual std::vector<char> call(const char *data, size_t bytes) = 0; | 29 virtual std::vector<char> call(const char *data, size_t bytes) = 0; |
16 | 30 |
17 virtual bool isOK() const = 0; | 31 virtual bool isOK() const = 0; |
18 }; | 32 }; |
19 | 33 |
20 class MessageCompletenessChecker // interface | |
21 { | |
22 public: | |
23 virtual bool isComplete(const std::vector<char> &message) const = 0; | |
24 }; | |
25 | |
26 } | 34 } |
27 | 35 |
28 #endif | 36 #endif |