![]() |
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, resource_type_t type) | |
| Creates a new shared message endpoint. | |
| ~SharedMessageEndpoint () final | |
| Destroys the shared message endpoint and frees all messages. | |
| 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. | |
Public Member Functions inherited from MaxOS::processes::Resource | |
| Resource (const string &name, size_t flags, resource_type_t type) | |
| Constructs a new Resource object. | |
| string | name () |
| Gets the name of this resource. | |
| resource_type_t | type () |
| Gets the type of this resource. | |
| virtual void | open (size_t flags) |
| Opens the resource. | |
| virtual void | close (size_t flags) |
| Closes the resource. | |
| SharedMessageEndpoint::SharedMessageEndpoint | ( | const string & | name, |
| size_t | size, | ||
| 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 |
Destroys the shared message endpoint and frees all messages.
Definition at line 121 of file ipc.cpp.
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 | Unused |
Reimplemented from MaxOS::processes::Resource.
Definition at line 136 of file ipc.cpp.
References memcpy().
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 |
Reimplemented from MaxOS::processes::Resource.
Definition at line 158 of file ipc.cpp.
References MaxOS::common::Spinlock::lock(), and MaxOS::common::Spinlock::unlock().