C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::message_builder Class Reference

Provides a convenient interface for creating message objects from a series of values using the member function append. More...

#include <message_builder.hpp>

Public Member Functions

 message_builder (const message_builder &)=delete
 
message_builderoperator= (const message_builder &)=delete
 
template<class Iter >
 message_builder (Iter first, Iter last)
 Creates a new instance and immediately calls append(first, last).
 
template<class Iter >
message_builderappend (Iter first, Iter last)
 Appends all values in range [first, last).
 
template<class T >
message_builderappend (T &&x)
 Adds x to the elements of the buffer.
 
message_builderappend_from (const caf::message &msg, size_t first, size_t n=1)
 Adds elements n elements from msg to the buffer, starting at index first.
 
template<class... Ts>
message_builderappend_all (Ts &&... xs)
 
template<class Tuple , size_t... Is>
message_builderappend_tuple (Tuple &xs, std::index_sequence< Is... >)
 
template<class... Ts>
message_builderappend_tuple (std::tuple< Ts... > xs)
 
message to_message () const
 Converts the buffer to an actual message object without invalidating this message builder (nor clearing it).
 
message move_to_message ()
 Converts the buffer to an actual message object and transfers ownership of the data to it, leaving this object in an invalid state.
 
void clear () noexcept
 Removes all elements from the buffer.
 
bool empty () const noexcept
 Returns whether the buffer is empty.
 
size_t size () const noexcept
 Returns the number of elements in the buffer.
 

Friends

class message
 

Detailed Description

Provides a convenient interface for creating message objects from a series of values using the member function append.

Member Function Documentation

◆ append_from()

message_builder & caf::message_builder::append_from ( const caf::message & msg,
size_t first,
size_t n = 1 )

Adds elements n elements from msg to the buffer, starting at index first.

Note
Always appends copies of the elements.

◆ move_to_message()

message caf::message_builder::move_to_message ( )

Converts the buffer to an actual message object and transfers ownership of the data to it, leaving this object in an invalid state.

Warning
Calling any member function on this object afterwards is undefined behavior.

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