L4Re – L4 Runtime Environment
L4::Ipc::Ostream Class Reference

Output stream for IPC marshalling. More...

+ Inheritance diagram for L4::Ipc::Ostream:
+ Collaboration diagram for L4::Ipc::Ostream:

Public Member Functions

 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.
 
Get/Put functions.

These functions are basically used to implement the insertion operators (<<) and should not be called directly.

template<typename T >
bool put (T *buf, unsigned long size)
 Put an array with size elements of type T into the stream. More...
 
template<typename T >
bool put (T const &v)
 Insert an element of type T into the stream. More...
 
int put (Varg const &va)
 
template<typename T >
int put (Varg_t< T > const &va)
 
l4_msgtag_t tag () const
 Extract the L4 message tag from the stream. More...
 
l4_msgtag_ttag ()
 Extract a reference to the L4 message tag from the stream. More...
 
bool put_snd_item (Snd_item const &)
 

IPC operations.

l4_msgtag_t _tag
 
l4_utcb_t_utcb
 
char * _current_msg
 
unsigned _pos
 
unsigned char _current_item
 
l4_msgtag_t send (l4_cap_idx_t dst, long proto=0, unsigned flags=0)
 Send the message via IPC to the given receiver. More...
 
l4_utcb_tutcb () const
 Return utcb pointer.
 
l4_msgtag_t prepare_ipc (long proto=0, unsigned flags=0)
 
void set_ipc_params (l4_msgtag_t tag)
 

Detailed Description

Output stream for IPC marshalling.

Ipc::Ostream is part of the dynamic IPC marshalling infrastructure, as well as Ipc::Istream and Ipc::Iostream.

Ipc::Ostream is an output stream supporting insertion of values into an IPC message buffer. A IPC message can be marshalled using the usual insertion operator <<, see IPC stream operators .

There exist some special wrapper classes to insert arrays (see Ipc::Buf_cp_out) and indirect strings (see Msg_out_buffer and Msg_io_buffer).

Definition at line 634 of file ipc_stream.

Member Function Documentation

◆ put() [1/2]

template<typename T >
bool L4::Ipc::Ostream::put ( T *  buf,
unsigned long  size 
)
inline

Put an array with size elements of type T into the stream.

Parameters
bufA pointer to the array to insert into the buffer.
sizeThe number of elements in the array.

Definition at line 671 of file ipc_stream.

Referenced by operator<<().

+ Here is the caller graph for this function:

◆ put() [2/2]

template<typename T >
bool L4::Ipc::Ostream::put ( T const &  v)
inline

Insert an element of type T into the stream.

Parameters
vThe element to insert.

Definition at line 689 of file ipc_stream.

◆ send()

l4_msgtag_t L4::Ipc::Ostream::send ( l4_cap_idx_t  dst,
long  proto = 0,
unsigned  flags = 0 
)
inline

Send the message via IPC to the given receiver.

Parameters
dstThe destination for the message.
protoProtocol to use.
flagsFlags to use.
Returns
The syscall return tag.

Definition at line 966 of file ipc_stream.

References l4_ipc_send(), L4_MSGTAG_FLAGS, and tag().

+ Here is the call graph for this function:

◆ tag() [1/2]

l4_msgtag_t& L4::Ipc::Ostream::tag ( )
inline

Extract a reference to the L4 message tag from the stream.

Returns
A reference to the L4 message tag.

Definition at line 724 of file ipc_stream.

◆ tag() [2/2]

l4_msgtag_t L4::Ipc::Ostream::tag ( ) const
inline

Extract the L4 message tag from the stream.

Returns
The extracted L4 message tag.

Definition at line 717 of file ipc_stream.

Referenced by operator<<(), and send().

+ Here is the caller graph for this function:

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