![]() |
L4Re Operating System Framework
Interface and Usage Documentation
|
Input/Output stream for IPC [un]marshalling. More...
#include <ipc_stream>
Public Member Functions | |
| Iostream (l4_utcb_t *utcb) | |
| Create an IPC IO stream with a single message buffer. | |
| void | reset () |
| Reset the stream to its initial state. | |
IPC operations. | |
| l4_msgtag_t | call (l4_cap_idx_t dst, l4_timeout_t timeout, long proto=0) |
| Do an IPC call using the message in the output stream and receive the reply in the input stream. | |
| l4_msgtag_t | reply_and_wait (l4_umword_t *src_dst, long proto=0) |
| Do an IPC reply and wait. | |
| l4_msgtag_t | reply_and_wait (l4_umword_t *src_dst, l4_timeout_t timeout, long proto=0) |
| Do an IPC reply and wait. | |
Get/Put functions. | |
These functions are basically used to implement the insertion operators (<<) and should not be called directly. | |
| template<typename T> | |
| unsigned long | get (T *buf, unsigned long elems) |
| Copy out an array of type T with size elements. | |
| template<typename T> | |
| unsigned long | get (Msg_ptr< T > const &buf, unsigned long elems=1) |
| Read one size elements of type T from the stream and return a pointer. | |
| template<typename T> | |
| bool | get (T &v) |
| Extract a single element of type T from the stream. | |
| template<typename T> | |
| bool | put (T *buf, unsigned long size) |
| Put an array with size elements of type T into the stream. | |
| template<typename T> | |
| bool | put (T const &v) |
| Insert an element of type T into the stream. | |
| Public Member Functions inherited from L4::Ipc::Istream | |
| Istream (l4_utcb_t *utcb) | |
| Create an input stream for the given message buffer. | |
| void | reset () |
| Reset the stream to empty, and ready for receive()/wait(). | |
| template<typename T> | |
| bool | has_more (unsigned long count=1) |
| Check whether a value of type T can be obtained from the stream. | |
| l4_utcb_t * | utcb () const |
| Return utcb pointer. | |
| template<typename T> | |
| unsigned long | get (T *buf, unsigned long elems) |
| Copy out an array of type T with size elements. | |
| template<typename T> | |
| void | skip (unsigned long elems) |
| Skip size elements of type T in the stream. | |
| template<typename T> | |
| unsigned long | get (Msg_ptr< T > const &buf, unsigned long elems=1) |
| Read one size elements of type T from the stream and return a pointer. | |
| template<typename T> | |
| bool | get (T &v) |
| Extract a single element of type T from the stream. | |
| l4_msgtag_t | tag () const |
| Get the message tag of a received IPC. | |
| l4_msgtag_t & | tag () |
| Get the message tag of a received IPC. | |
| l4_msgtag_t | wait (l4_umword_t *src) |
| Wait for an incoming message from any sender. | |
| l4_msgtag_t | wait (l4_umword_t *src, l4_timeout_t timeout) |
| Wait for an incoming message from any sender. | |
| l4_msgtag_t | receive (l4_cap_idx_t src) |
| Wait for a message from the specified sender. | |
| Public Member Functions inherited from L4::Ipc::Ostream | |
| Ostream (l4_utcb_t *utcb) | |
| Create an IPC output stream using the given message buffer utcb. | |
| void | reset () |
| Reset the stream to empty, same state as a newly created stream. | |
| l4_utcb_t * | utcb () const |
| Return utcb pointer. | |
| template<typename T> | |
| bool | put (T *buf, unsigned long size) |
| Put an array with size elements of type T into the stream. | |
| template<typename T> | |
| bool | put (T const &v) |
| Insert an element of type T into the stream. | |
| l4_msgtag_t | tag () const |
| Extract the L4 message tag from the stream. | |
| l4_msgtag_t & | tag () |
| Extract a reference to the L4 message tag from the stream. | |
| l4_msgtag_t | send (l4_cap_idx_t dst, long proto=0, unsigned flags=0) |
| Send the message via IPC to the given receiver. | |
Input/Output stream for IPC [un]marshalling.
The Ipc::Iostream is part of the AW Env IPC framework as well as Ipc::Istream and Ipc::Ostream. In particular an Ipc::Iostream is a combination of an Ipc::Istream and an Ipc::Ostream. It can use either a single message buffer for receiving and sending messages or a pair of a receive and a send buffer. The stream also supports combined IPC operations such as call() and reply_and_wait(), which can be used to implement RPC functionality.
Definition at line 789 of file ipc_stream.
|
inlineexplicit |
Create an IPC IO stream with a single message buffer.
| utcb | The message buffer used as backing store. |
The created IO stream uses the same message buffer for sending and receiving IPC messages.
Definition at line 801 of file ipc_stream.
References L4::Ipc::Istream::Istream(), and L4::Ipc::Ostream::Ostream().
|
inline |
Do an IPC call using the message in the output stream and receive the reply in the input stream.
| dst | The destination to call. |
| timeout | The IPC timeout for the call. |
| proto | The protocol value to use in the message tag. |
This is a combined IPC operation consisting of a send and a receive to/from the given destination dst.
A call is usually used by clients for RPCs to a server.
Definition at line 966 of file ipc_stream.
References l4_ipc_call(), and L4::Ipc::Istream::tag().
|
inline |
Read one size elements of type T from the stream and return a pointer.
| buf | A Msg_ptr that is actually set to point to the element in the stream. |
| elems | Number of elements to extract (default is 1). |
In contrast to a normal get, this version does actually not copy the data but returns a pointer to the data.
See operator>>()
Definition at line 439 of file ipc_stream.
|
inline |
Extract a single element of type T from the stream.
| [out] | v | The element. |
| true | An element was successfully extracted. |
| false | An element could not be extracted. |
See operator>>()
Definition at line 464 of file ipc_stream.
|
inline |
Copy out an array of type T with size elements.
| buf | Pointer to a buffer for size elements of type T. |
| elems | Number of elements of type T to copy out. |
See operator>>()
Definition at line 394 of file ipc_stream.
|
inline |
Put an array with size elements of type T into the stream.
| buf | A pointer to the array to insert into the buffer. |
| size | The number of elements in the array. |
Definition at line 660 of file ipc_stream.
|
inline |
Insert an element of type T into the stream.
| v | The element to insert. |
Definition at line 678 of file ipc_stream.
|
inline |
Do an IPC reply and wait.
| [in,out] | src_dst | Input: the destination for the send operation. Output: the source of the received message. |
| timeout | Timeout used for IPC. | |
| proto | Protocol to use. |
This is a combined IPC operation consisting of a send operation and an open wait for any message.
A reply and wait is usually used by servers that reply to a client and wait for the next request by any other client.
Definition at line 981 of file ipc_stream.
References l4_ipc_reply_and_wait(), and L4::Ipc::Istream::tag().
|
inline |
Do an IPC reply and wait.
| [in,out] | src_dst | Input: the destination for the send operation. Output: the source of the received message. |
| proto | Protocol to use. |
This is a combined IPC operation consisting of a send operation and an open wait for any message.
A reply and wait is usually used by servers that reply to a client and wait for the next request by any other client.
Definition at line 874 of file ipc_stream.
References L4_IPC_SEND_TIMEOUT_0, and reply_and_wait().
Referenced by reply_and_wait().
|
inline |
Reset the stream to its initial state.
Input as well as the output stream are reset.
Definition at line 815 of file ipc_stream.
References L4::Ipc::Istream::reset(), and L4::Ipc::Ostream::reset().