- /** Sets the maximal communication rate (in byte/sec). Must be done before start */
- void setRate(double rate);
-
-private:
- void *p_srcBuff = NULL;
- size_t p_srcBuffSize = sizeof(void*);
-public:
- /** Specify the data to send */
- void setSrcData(void * buff);
- /** Specify the size of the data to send */
- void setSrcDataSize(size_t size);
- /** Specify the data to send and its size */
- void setSrcData(void * buff, size_t size);
-
-private: /* FIXME: expose these elements in the API */
- int p_detached = 0;
- int (*p_matchFunction)(void *, void *, smx_synchro_t) = NULL;
- void (*p_cleanFunction)(void *) = NULL;
- void (*p_copyDataFunction)(smx_synchro_t, void*, size_t) = NULL;
-
-
+ /** Creates (but don't start) an async send to the mailbox @p dest */
+ static Comm &send_init(Mailbox &dest);
+ /** Creates and start an async send to the mailbox @p dest */
+ static Comm &send_async(Mailbox &dest, void *data, int simulatedByteAmount);
+ /** Creates (but don't start) an async recv onto the mailbox @p from */
+ static Comm &recv_init(Mailbox &from);
+ /** Creates and start an async recv to the mailbox @p from */
+ static Comm &recv_async(Mailbox &from, void **data);
+
+ void start() override;
+ void wait() override;
+ void wait(double timeout) override;
+
+ /** Sets the maximal communication rate (in byte/sec). Must be done before start */
+ void setRate(double rate);
+
+ /** Specify the data to send */
+ void setSrcData(void * buff);
+ /** Specify the size of the data to send */
+ void setSrcDataSize(size_t size);
+ /** Specify the data to send and its size */
+ void setSrcData(void * buff, size_t size);
+
+ /** Specify where to receive the data */
+ void setDstData(void ** buff);
+ /** Specify the buffer in which the data should be received */
+ void setDstData(void ** buff, size_t size);
+ /** Retrieve the size of the received data */
+ size_t getDstDataSize();