aboutsummaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/include/common.h b/include/common.h
index 7386a34..50ac563 100644
--- a/include/common.h
+++ b/include/common.h
@@ -2,17 +2,34 @@
* @file common.h
* @author Paul Oliver
*
-* This module controls the 'common pipe', which is the FIFO file through which
+* This module controls the common sender and receiver functors, through which
* communication between different simulations can occur. By calling SEND,
-* processes may output local instructions through the pipe. These instructions
-* may then be read by processes running on a different simulation instance.
+* processes may output local instructions through a network. These instructions
+* may then be read by processes running on a different simulation somewhere
+* else.
*/
#ifndef SALIS_COMMON_H
#define SALIS_COMMON_H
-void _sal_comm_init(string pipe);
-void _sal_comm_quit(void);
+/* Typedef sender functor type for easy python parsing.
+*/
+typedef void (*Sender)(uint8 inst);
+
+/* Typedef receiver functor type for easy python parsing.
+*/
+typedef uint8 (*Receiver)(void);
+
+/* Set sender functor. When unset, SEND instruction does nothing.
+* @param sender Sender functor
+*/
+SALIS_API void sal_comm_set_sender(Sender sender);
+
+/* Set receiver functor. When unset, RCVE instruction does nothing.
+* @param receiver Receiver functor
+*/
+SALIS_API void sal_comm_set_receiver(Receiver receiver);
+
void _sal_comm_send(uint8 inst);
uint8 _sal_comm_receive(void);