dol: initial dol commit
[jump.git] / dol / src / dol / visitor / hdsd / scd / scd_rem_chan_if.h
1 #ifndef SCD_REM_CHAN_IF_H
2 #define SCD_REM_CHAN_IF_H
3
4 #include <sys/types.h>
5
6
7 /**
8  * Interface for SystemC channels with remote input.
9  */
10 class scd_rem_chan_in_if
11 {
12 public:
13
14     /**
15      * Indicates how many bytes can be received by this channel.
16      */
17     virtual size_t free() const = 0;
18
19     /**
20      * Receive bytes, convert to internal data structures and generate
21      * notifications if necessary.
22      * 
23      * \param buf pointer to buffer to read data from
24      * \param len number of bytes to receive (not larger than free())
25      */
26     virtual void receive(const void* buf, size_t len) = 0;
27
28     /**
29      * Virtual deconstructor
30      */
31     virtual ~scd_rem_chan_in_if() {}
32 };
33
34
35 /**
36  * Interface for SystemC channels with remote output.
37  */
38 class scd_rem_chan_out_if
39 {
40 public:
41
42     /**
43      * Inidcates how many bytes are available to be sent from this channel.
44      */
45     virtual size_t available() const = 0;
46     
47     /**
48      * Get the available data to be sent. Does not guarantee that it is
49      * actually sent. At most available() bytes are sent.
50      */
51     virtual const void* send() const = 0;
52
53     /**
54      * Remove bytes from channel that have been successully sent.
55      *
56      * \param len number of bytes that have been sent (not larger than
57      * available())
58      */
59     virtual void remove(size_t len) = 0;
60
61     /**
62      * Virtual deconstructor
63      */
64     virtual ~scd_rem_chan_out_if() {}
65 };
66
67 #endif