class OutgoingMessage

Defined at line 42 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

|OutgoingMessage| represents a FIDL message on the write path.

This class does not allocate its own memory storage. Instead, users need to

pass in encoding buffers of sufficient size, which an |OutgoingMessage| will

borrow until its destruction.

This class takes ownership of handles in the message.

For efficiency, errors are stored inside this object. |Write| operations are

no-op and return the contained error if the message is in an error state.

Public Methods

void ~OutgoingMessage ()

Defined at line 27 of file ../../sdk/lib/fidl/cpp/wire/outgoing_message.cc

void OutgoingMessage (const ::fidl::Status & failure)

Creates an empty outgoing message representing an error.

|failure| must contain an error result.

Defined at line 19 of file ../../sdk/lib/fidl/cpp/wire/outgoing_message.cc

uint32_t CountBytes ()

Returns the number of bytes in the message.

Defined at line 34 of file ../../sdk/lib/fidl/cpp/wire/outgoing_message.cc

bool BytesMatch (const OutgoingMessage & other)

Returns true iff the bytes in this message are identical to the bytes in the argument.

Defined at line 42 of file ../../sdk/lib/fidl/cpp/wire/outgoing_message.cc

void OutgoingMessage (const OutgoingMessage & )

Copy and move is disabled for the sake of avoiding double handle close.

It is possible to implement the move operations with correct semantics if they are

ever needed.

Defined at line 47 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

void OutgoingMessage (OutgoingMessage && )

Defined at line 48 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

OutgoingMessage & operator= (const OutgoingMessage & )

Defined at line 49 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

OutgoingMessage & operator= (OutgoingMessage && )

Defined at line 50 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

void OutgoingMessage ()

Defined at line 51 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

OutgoingMessage Create_InternalMayBreak (InternalIovecConstructorArgs args)

Creates an object which can manage a FIDL message.

|args.iovecs|, |args.handles|, and |args.handle_metadata| should contain encoded data up to

|args.num_iovecs| and |args.num_handles|.

Internal-only function that should not be called outside of the FIDL library.

Defined at line 74 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

void set_txid (zx_txid_t txid)

Set the txid in the message header.

Requires that the message is encoded, and is a transactional message.

Requires that there are sufficient bytes to store the header in the buffer.

Defined at line 87 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

void Write (internal::AnyUnownedTransport transport, WriteOptions options)

Writes the message to the |transport|.

Defined at line 94 of file ../../sdk/lib/fidl/cpp/wire/outgoing_message.cc

zx_channel_iovec_t * iovecs ()

Defined at line 98 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

uint32_t iovec_actual ()

Defined at line 99 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

fidl_handle_t * handles ()

Defined at line 100 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

internal::fidl_transport_type transport_type ()

Defined at line 101 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

uint32_t handle_actual ()

Defined at line 102 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

template <typename Transport>
typename Transport::HandleMetadata * handle_metadata ()

Defined at line 105 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

CopiedBytes CopyBytes ()

Create a heap-allocated contiguous copy of the bytes in this message.

Defined at line 150 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

void ReleaseHandles ()

Release the handles to prevent them to be closed by CloseHandles. This method is only useful

when interfacing with low-level channel operations which consume the handles.

Defined at line 154 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

template <typename TransportObject>
void Write (TransportObject && transport, WriteOptions options)

Writes the message to the |transport|. This overload takes a concrete

transport endpoint, such as a |zx::unowned_channel|.

Defined at line 162 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

template <typename TransportObject>
auto Call (TransportObject && transport, typename internal::AssociatedTransport<TransportObject>::MessageStorageView storage, CallOptions options)

Makes a call and returns the response read from the transport, without

decoding.

Defined at line 170 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

bool is_transactional ()

Defined at line 177 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/outgoing_message.h

Records

Friends

template <typename>
class UnownedEncodedMessageBase