~ubuntu-branches/ubuntu/trusty/libecap/trusty-proposed

« back to all changes in this revision

Viewing changes to src/libecap/adapter/xaction.h

  • Committer: Package Import Robot
  • Author(s): Luigi Gangitano
  • Date: 2012-12-05 20:11:04 UTC
  • Revision ID: package-import@ubuntu.com-20121205201104-i0lk2ymbdre6k4dl
Tags: upstream-0.2.0
ImportĀ upstreamĀ versionĀ 0.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* (C) 2008  The Measurement Factory */
 
2
 
 
3
#ifndef ECAP__ADAPTER_XACTION_H
 
4
#define ECAP__ADAPTER_XACTION_H
 
5
 
 
6
#include <libecap/common/call.h>
 
7
#include <libecap/common/area.h>
 
8
#include <libecap/common/options.h>
 
9
 
 
10
namespace libecap {
 
11
namespace adapter {
 
12
 
 
13
// adapter transaction is responsible for adapting a single message
 
14
// it is created by adapter::Service::makeXaction and destroyed by
 
15
// the host either before calling start() or after calling stop()
 
16
class Xaction: public Callable, public Options {
 
17
        public:
 
18
                virtual ~Xaction() {}
 
19
 
 
20
                // lifecycle
 
21
                virtual void start() = 0;
 
22
                virtual void stop() = 0;
 
23
 
 
24
                // adapted body transmission control
 
25
                virtual void abDiscard() = 0; // host will not look at ab at all
 
26
                virtual void abMake() = 0; // host may look at ab
 
27
                virtual void abMakeMore() = 0; // host must have more ab
 
28
                virtual void abStopMaking() = 0; // host no longer needs ab
 
29
                virtual void abPause() {} // ignored by default
 
30
                virtual void abResume() {} // ignored iff abPause is
 
31
 
 
32
                // adapted body content extraction and consumption
 
33
                virtual Area abContent(size_type offset, size_type size) = 0;
 
34
                virtual void abContentShift(size_type size) = 0; // first size bytes
 
35
 
 
36
                // virgin body state notification
 
37
                virtual void noteVbContentDone(bool atEnd) = 0; // successful or not
 
38
                virtual void noteVbContentAvailable() = 0;
 
39
};
 
40
 
 
41
} // namespace adapter
 
42
} // namespace libecap
 
43
 
 
44
#endif