![]() |
Max OS 0.3
|
A endpoint that allows processes to queue messages on. More...
#include <ipc.h>
Public Member Functions | |
| SharedMessageEndpoint (const string &name, size_t size, resources::resource_type_t type) | |
| Creates a new shared message endpoint. | |
| ~SharedMessageEndpoint () final | |
| Destroys the shared message endpoint and frees all messages. | |
| void | send (const ipc_iovec_t *vec, size_t count) |
| Combines a multipart message and sends it to the endpoint. | |
| int | read (void *buffer, size_t size, size_t flags) final |
| Reads the first message from the endpoint or will yield until a message has been written. | |
| int | write (const void *buffer, size_t size, size_t flags) final |
| Handles writing to the message endpoint resource by writing the buffer as a message. | |
| SharedMessageEndpoint::SharedMessageEndpoint | ( | const string & | name, |
| size_t | size, | ||
| resources::resource_type_t | type | ||
| ) |
Creates a new shared message endpoint.
| name | The name of the endpoint |
| size | The size of messages that can be sent |
| type | The type of resource |
Definition at line 112 of file ipc.cpp.
|
final |
|
final |
Reads the first message from the endpoint or will yield until a message has been written.
| buffer | Where to write the message to |
| size | Max size of the message to be read |
| flags | 0 to block, 1 for async |
Definition at line 165 of file ipc.cpp.
References MaxOS::processes::GlobalScheduler::current_thread(), and MaxOS::processes::Thread::yield().
| void SharedMessageEndpoint::send | ( | const ipc_iovec_t * | vec, |
| size_t | count | ||
| ) |
Combines a multipart message and sends it to the endpoint.
| vec | The io vector containing the parts |
| count | How many entries the vector has |
Definition at line 135 of file ipc.cpp.
References MaxOS::processes::BlockingLock::lock(), and MaxOS::processes::BlockingLock::unlock().
Referenced by write().
|
final |
Handles writing to the message endpoint resource by writing the buffer as a message.
| buffer | The message to write to the endpoint |
| size | The size of the message |
| flags | Unused |
Definition at line 194 of file ipc.cpp.
References send().