C++ Actor Framework 1.0.0
|
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_builder & | operator= (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_builder & | append (Iter first, Iter last) |
Appends all values in range [first, last). | |
template<class T > | |
message_builder & | append (T &&x) |
Adds x to the elements of the buffer. | |
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 . | |
template<class... Ts> | |
message_builder & | append_all (Ts &&... xs) |
template<class Tuple , size_t... Is> | |
message_builder & | append_tuple (Tuple &xs, std::index_sequence< Is... >) |
template<class... Ts> | |
message_builder & | append_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 |
Provides a convenient interface for creating message
objects from a series of values using the member function append
.
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
.
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.