Loading...
Searching...
No Matches
L4::Ipc::Istream Class Reference

Input stream for IPC unmarshalling. More...

`#include <ipc_stream>`

Inheritance diagram for L4::Ipc::Istream:
Collaboration diagram for L4::Ipc::Istream:

## Public Member Functions

| 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.
Get/Put Functions.
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.
IPC operations.
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.

## Detailed Description

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 334 of file ipc_stream.

## Constructor & Destructor Documentation

## Istream()

L4::Ipc::Istream::Istream | ( | l4_utcb_t * | utcb | ) |

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.

Parameters

  utcb | The message buffer to receive IPC messages.

Definition at line 348 of file ipc_stream.

References utcb().

Referenced by L4::Ipc::Iostream::Iostream().

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Function Documentation

## get() [1/3]

template<typename T>

unsigned long L4::Ipc::Istream::get | ( | Msg_ptr< T > const & | buf,
|  | unsigned long | elems = 1 )

inline

Read one size elements of type T from the stream and return a pointer.

Parameters

  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).

Returns
  The number of elements extracted.

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.

References has_more(), and L4_UNLIKELY.

Here is the call graph for this function:

## get() [2/3]

template<typename T>

bool L4::Ipc::Istream::get | ( | T & | v | ) |

inline

Extract a single element of type T from the stream.

Parameters

  [out] | v | The element.

Return values

  true | An element was successfully extracted.
  false | An element could not be extracted.

See operator>>()

Definition at line 464 of file ipc_stream.

References has_more(), and L4_UNLIKELY.

Here is the call graph for this function:

## get() [3/3]

template<typename T>

unsigned long L4::Ipc::Istream::get | ( | T * | buf,
|  | unsigned long | elems )

inline

Copy out an array of type T with size elements.

Parameters

  buf | Pointer to a buffer for size elements of type T.
  elems | Number of elements of type T to copy out.

Returns
  The number of elements copied out.

See operator>>()

Definition at line 394 of file ipc_stream.

References has_more(), and L4_UNLIKELY.

Referenced by operator>>(), operator>>(), operator>>(), operator>>(), and operator>>().

Here is the call graph for this function:
Here is the caller graph for this function:

## receive()

l4_msgtag_t L4::Ipc::Istream::receive | ( | l4_cap_idx_t | src | ) |

inline

Wait for a message from the specified sender.

Parameters

  src | The sender id to receive from.

Returns
  The IPC result tag (l4_msgtag_t).

This is commonly known as 'closed wait'.

Definition at line 572 of file ipc_stream.

References L4_IPC_NEVER, and receive().

Referenced by receive().

Here is the call graph for this function:
Here is the caller graph for this function:

## reset()

void L4::Ipc::Istream::reset | ( |  | ) |

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 358 of file ipc_stream.

Referenced by L4::Ipc::Iostream::reset().

Here is the caller graph for this function:

## skip()

template<typename T>

void L4::Ipc::Istream::skip | ( | unsigned long | elems | ) |

inline

Skip size elements of type T in the stream.

Parameters

  elems | Number of elements to skip.

Definition at line 414 of file ipc_stream.

References has_more(), and L4_UNLIKELY.

Here is the call graph for this function:

## tag() [1/2]

l4_msgtag_t & L4::Ipc::Istream::tag | ( |  | ) |

inline

Get the message tag of a received IPC.

Returns
  A reference to the L4 message tag for the received IPC.

This is in particular useful for handling page faults or exceptions.

See operator>>()

Definition at line 517 of file ipc_stream.

## tag() [2/2]

l4_msgtag_t L4::Ipc::Istream::tag | ( |  | ) | const

inline

Get the message tag of a received IPC.

Returns
  The L4 message tag for the received IPC.

This is in particular useful for handling page faults or exceptions.

See operator>>()

Definition at line 505 of file ipc_stream.

Referenced by L4::Ipc::Iostream::call(), operator>>(), L4::Ipc::Iostream::reply_and_wait(), and wait().

Here is the caller graph for this function:

## wait() [1/2]

l4_msgtag_t L4::Ipc::Istream::wait | ( | l4_umword_t * | src | ) |

inline

Wait for an incoming message from any sender.

Parameters

  [out] | src | Contains the sender after a successful IPC operation.

Returns
  Syscall return tag.

This wait is actually known as 'open wait'.

Definition at line 548 of file ipc_stream.

References L4_IPC_NEVER, and wait().

Referenced by wait().

Here is the call graph for this function:
Here is the caller graph for this function:

## wait() [2/2]

l4_msgtag_t L4::Ipc::Istream::wait | ( | l4_umword_t * | src,
|  | l4_timeout_t | timeout )

inline

Wait for an incoming message from any sender.

Parameters

  [out] | src | Contains the sender after a successful IPC operation.
  | timeout | Timeout used for IPC.

Returns
  The IPC result tag (l4_msgtag_t).

This wait is actually known as 'open wait'.

Definition at line 1013 of file ipc_stream.

References l4_ipc_wait(), and tag().

Here is the call graph for this function:

The documentation for this class was generated from the following file:

- l4/cxx/ipc_stream