diff options
| author | Michael Bebenita <[email protected]> | 2010-07-28 16:46:13 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-28 20:30:29 -0700 |
| commit | 4246d567b7a999155524669e3b0419e8f71080b1 (patch) | |
| tree | 38ab4d3aa04b25e37db9e663890235edf2f3a8a6 /src/rt/rust_message.h | |
| parent | Move notification-messages out into their own file and unify into notify_mess... (diff) | |
| download | rust-4246d567b7a999155524669e3b0419e8f71080b1.tar.xz rust-4246d567b7a999155524669e3b0419e8f71080b1.zip | |
Move ports out into their own file, add data_message and make communication system use it (and proxies) instead of existing token scheme.
Diffstat (limited to 'src/rt/rust_message.h')
| -rw-r--r-- | src/rt/rust_message.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/rt/rust_message.h b/src/rt/rust_message.h index f0c6bc0a..b7b8568a 100644 --- a/src/rt/rust_message.h +++ b/src/rt/rust_message.h @@ -58,6 +58,30 @@ public: rust_proxy<rust_task> *target); }; +/** + * Data messages carry a buffer. + */ +class data_message : public rust_message { +private: + uint8_t *_buffer; + size_t _buffer_sz; + rust_port *_port; +public: + + data_message(uint8_t *buffer, size_t buffer_sz, const char* label, + rust_task *source, rust_task *target, rust_port *port); + ~data_message(); + void process(); + + /** + * This code executes in the sending domain's thread. + */ + static void + send(uint8_t *buffer, size_t buffer_sz, const char* label, + rust_task *source, rust_proxy<rust_task> *target, + rust_proxy<rust_port> *port); +}; + // // Local Variables: // mode: C++ |