annotate vamp-client/SynchronousTransport.h @ 93:fbce91785d35
Having a class called PipedXX is too confusing with all the Piper classes; give up and rename it
author |
Chris Cannam <c.cannam@qmul.ac.uk> |
date |
Thu, 13 Oct 2016 12:07:41 +0100 |
parents |
21f8af53eaf0 |
children |
a660dca988f8 |
rev |
line source |
c@90
|
1
|
c@90
|
2 #ifndef PIPER_SYNCHRONOUS_TRANSPORT_H
|
c@90
|
3 #define PIPER_SYNCHRONOUS_TRANSPORT_H
|
c@90
|
4
|
c@90
|
5 #include <vector>
|
c@92
|
6 #include <cstdlib>
|
c@90
|
7
|
c@90
|
8 namespace piper {
|
c@90
|
9
|
c@92
|
10 class MessageCompletenessChecker // interface
|
c@92
|
11 {
|
c@92
|
12 public:
|
c@92
|
13 virtual ~MessageCompletenessChecker() = default;
|
c@92
|
14
|
c@92
|
15 virtual bool isComplete(const std::vector<char> &message) const = 0;
|
c@92
|
16 };
|
c@92
|
17
|
c@90
|
18 class SynchronousTransport // interface
|
c@90
|
19 {
|
c@90
|
20 public:
|
c@92
|
21 virtual ~SynchronousTransport() = default;
|
c@92
|
22
|
c@92
|
23 //!!! I do not take ownership
|
c@92
|
24 virtual void setCompletenessChecker(MessageCompletenessChecker *) = 0;
|
c@92
|
25
|
c@90
|
26 //!!! how to handle errors -- exception or return value? often an
|
c@90
|
27 //!!! error (e.g. server has exited) may mean the transport can no
|
c@90
|
28 //!!! longer be used at all
|
c@90
|
29 virtual std::vector<char> call(const char *data, size_t bytes) = 0;
|
c@90
|
30
|
c@90
|
31 virtual bool isOK() const = 0;
|
c@90
|
32 };
|
c@90
|
33
|
c@90
|
34 }
|
c@90
|
35
|
c@90
|
36 #endif
|