L4Re – L4 Runtime Environment
|
Input stream for IPC unmarshalling. More...
Public Member Functions | |
Istream (l4_utcb_t *utcb) | |
Create an input stream for the given message buffer. More... | |
void | reset () |
Reset the stream to empty, and ready for receive()/wait(). More... | |
template<typename T > | |
bool | has_more (unsigned long count=1) |
Check whether a value of type T can be obtained from the stream. | |
Get/Put Functions. | |
template<typename T > | |
unsigned long | get (T *buf, unsigned long elems) |
Copy out an array of type T with size elements. More... | |
template<typename T > | |
void | skip (unsigned long elems) |
Skip size elements of type T in the stream. More... | |
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. More... | |
template<typename T > | |
bool | get (T &v) |
Extract a single element of type T from the stream. More... | |
bool | get (Ipc::Varg *va) |
l4_msgtag_t | tag () const |
Get the message tag of a received IPC. More... | |
l4_msgtag_t & | tag () |
Get the message tag of a received IPC. More... | |
bool | put (Buf_item const &) |
bool | put (Small_buf const &) |
IPC operations. | |
l4_msgtag_t | _tag |
l4_utcb_t * | _utcb |
char * | _current_msg |
unsigned | _pos |
unsigned char | _current_buf |
l4_msgtag_t | wait (l4_umword_t *src) |
Wait for an incoming message from any sender. More... | |
l4_msgtag_t | wait (l4_umword_t *src, l4_timeout_t timeout) |
Wait for an incoming message from any sender. More... | |
l4_msgtag_t | receive (l4_cap_idx_t src) |
Wait for a message from the specified sender. More... | |
l4_msgtag_t | receive (l4_cap_idx_t src, l4_timeout_t timeout) |
l4_utcb_t * | utcb () const |
Return utcb pointer. | |
Input stream for IPC unmarshalling.
Ipc::Istream is part of the dynamic IPC marshalling infrastructure, as well as Ipc::Ostream and Ipc::Iostream.
Ipc::Istream is an input stream supporting extraction of values from an IPC message buffer. A received IPC message can be unmarshalled using the usual extraction operator (>>).
There exist some special wrapper classes to extract arrays (see Ipc_buf_cp_in and Ipc_buf_in) and indirect strings (see Msg_in_buffer and Msg_io_buffer).
Definition at line 347 of file ipc_stream.
|
inline |
Create an input stream for the given message buffer.
The given message buffer is used for IPC operations wait()/receive() and received data can be extracted using the >> operator afterwards. In the case of indirect message parts a buffer of type Msg_in_buffer must be inserted into the stream before the IPC operation and contains received data afterwards.
utcb | The message buffer to receive IPC messages. |
Definition at line 361 of file ipc_stream.
|
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.
Definition at line 452 of file ipc_stream.
References L4_UNLIKELY.
|
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. |
Definition at line 477 of file ipc_stream.
References L4_UNLIKELY.
|
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. |
Definition at line 407 of file ipc_stream.
References L4_UNLIKELY.
Referenced by operator>>().
|
inline |
Wait for a message from the specified sender.
src | The sender id to receive from. |
This is commonly known as 'closed wait'.
Definition at line 585 of file ipc_stream.
|
inline |
Reset the stream to empty, and ready for receive()/wait().
The stream is reset to the same state as on its creation.
Definition at line 371 of file ipc_stream.
Referenced by L4::Ipc::Iostream::reset().
|
inline |
Skip size elements of type T in the stream.
elems | Number of elements to skip. |
Definition at line 427 of file ipc_stream.
References L4_UNLIKELY.
|
inline |
Get the message tag of a received IPC.
This is in particular useful for handling page faults or exceptions.
Definition at line 530 of file ipc_stream.
|
inline |
Get the message tag of a received IPC.
This is in particular useful for handling page faults or exceptions.
Definition at line 518 of file ipc_stream.
Referenced by L4::Ipc::Iostream::call(), operator>>(), L4::Ipc::Iostream::reply_and_wait(), and wait().
|
inline |
Wait for an incoming message from any sender.
[out] | src | Contains the sender after a successful IPC operation. |
This wait is actually known as 'open wait'.
Definition at line 561 of file ipc_stream.
|
inline |
Wait for an incoming message from any sender.
[out] | src | Contains the sender after a successful IPC operation. |
timeout | Timeout used for IPC. |
This wait is actually known as 'open wait'.
Definition at line 1020 of file ipc_stream.
References l4_ipc_wait(), and tag().