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

« back to all changes in this revision

Viewing changes to src/libecap/host/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__HOST_XACTION_H
 
4
#define ECAP__HOST_XACTION_H
 
5
 
 
6
#include <libecap/common/forward.h>
 
7
#include <libecap/common/call.h>
 
8
#include <libecap/common/area.h>
 
9
#include <libecap/common/options.h>
 
10
 
 
11
namespace libecap {
 
12
namespace host {
 
13
 
 
14
// The host side of the eCAP transaction.
 
15
// Adapter::Xaction uses this interface to get a virgin message from the host.
 
16
class Xaction: public Callable, public Options {
 
17
        public:
 
18
                virtual ~Xaction() {}
 
19
 
 
20
                // access to messages; these methods throw if the message is missing
 
21
                virtual Message &virgin() = 0; // request or response, always present
 
22
                virtual const Message &cause() = 0; // request for the above response
 
23
                virtual Message &adapted() = 0; // returns useAdapted() message
 
24
 
 
25
                // adaptation decision making
 
26
                virtual void useVirgin() = 0;  // use virgin; no adaptation
 
27
                virtual void useAdapted(const shared_ptr<Message> &msg) = 0; // use msg
 
28
                virtual void blockVirgin() = 0;  // block or deny user access
 
29
 
 
30
                // adapter transaction state notifications
 
31
                virtual void adaptationDelayed(const Delay &) = 0; // needs time
 
32
                virtual void adaptationAborted() = 0; // abnormal termination
 
33
 
 
34
                // virgin body transmission control
 
35
                virtual void vbDiscard() = 0; // adapter will not look at vb at all
 
36
                virtual void vbMake() = 0; // adapter may look at vb
 
37
                virtual void vbStopMaking() = 0; // adapter no longer needs vb
 
38
                virtual void vbMakeMore() = 0; // adapter must have more vb
 
39
                virtual void vbPause() {}; // ignored by default
 
40
                virtual void vbResume() {}; // ignored iff vbPause is
 
41
 
 
42
                // virgin body content extraction and consumption
 
43
                virtual Area vbContent(size_type offset, size_type size) = 0;
 
44
                virtual void vbContentShift(size_type size) = 0; // first size bytes
 
45
        // TODO: add something like virtual void vbSearch(Searcher &s) = 0;
 
46
 
 
47
                // adapted body state notification
 
48
                virtual void noteAbContentDone(bool atEnd) = 0; // successful or not
 
49
                virtual void noteAbContentAvailable() = 0;
 
50
};
 
51
 
 
52
} // namespace host
 
53
} // namespace libecap
 
54
 
 
55
#endif