CAF  0.17.3
Public Member Functions | Friends | List of all members
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_all ()
 
template<class T , class... Ts>
message_builderappend_all (T &&x, Ts &&... xs)
 
template<size_t N, class... Ts>
message_builderappend_tuple (std::integral_constant< size_t, N >, std::integral_constant< size_t, N >, std::tuple< Ts... > &)
 
template<size_t I, size_t N, class... Ts>
message_builderappend_tuple (std::integral_constant< size_t, I >, std::integral_constant< size_t, N > e, std::tuple< Ts... > &xs)
 
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. More...
 
optional< messageapply (message_handler handler)
 Returns handler(*this). More...
 
void clear ()
 Removes all elements from the buffer.
 
bool empty () const
 Returns whether the buffer is empty.
 
size_t size () const
 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

◆ apply()

optional<message> caf::message_builder::apply ( message_handler  handler)

Returns handler(*this).

◆ 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 (dereferencing a nullptr)

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