dol: initial dol commit
[jump.git] / dol / src / dol / visitor / hdsd / scd / scd_rem_chan_if.h
diff --git a/dol/src/dol/visitor/hdsd/scd/scd_rem_chan_if.h b/dol/src/dol/visitor/hdsd/scd/scd_rem_chan_if.h
new file mode 100644 (file)
index 0000000..e478cc6
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef SCD_REM_CHAN_IF_H
+#define SCD_REM_CHAN_IF_H
+
+#include <sys/types.h>
+
+
+/**
+ * Interface for SystemC channels with remote input.
+ */
+class scd_rem_chan_in_if
+{
+public:
+
+    /**
+     * Indicates how many bytes can be received by this channel.
+     */
+    virtual size_t free() const = 0;
+
+    /**
+     * Receive bytes, convert to internal data structures and generate
+     * notifications if necessary.
+     * 
+     * \param buf pointer to buffer to read data from
+     * \param len number of bytes to receive (not larger than free())
+     */
+    virtual void receive(const void* buf, size_t len) = 0;
+
+    /**
+     * Virtual deconstructor
+     */
+    virtual ~scd_rem_chan_in_if() {}
+};
+
+
+/**
+ * Interface for SystemC channels with remote output.
+ */
+class scd_rem_chan_out_if
+{
+public:
+
+    /**
+     * Inidcates how many bytes are available to be sent from this channel.
+     */
+    virtual size_t available() const = 0;
+    
+    /**
+     * Get the available data to be sent. Does not guarantee that it is
+     * actually sent. At most available() bytes are sent.
+     */
+    virtual const void* send() const = 0;
+
+    /**
+     * Remove bytes from channel that have been successully sent.
+     *
+     * \param len number of bytes that have been sent (not larger than
+     * available())
+     */
+    virtual void remove(size_t len) = 0;
+
+    /**
+     * Virtual deconstructor
+     */
+    virtual ~scd_rem_chan_out_if() {}
+};
+
+#endif