CARLA
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers > Class Template Reference

Serialization of a set of buffers to be sent over a TCP socket as a single message. More...

#include <Message.h>

+ Inheritance diagram for carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >:
+ Collaboration diagram for carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >:

Public Member Functions

bool empty () const noexcept
 
auto GetBufferSequence () const
 
template<typename... Buffers>
 MessageTmpl (SharedBufferView buf, Buffers... buffers)
 
auto size () const noexcept
 Size in bytes of the message excluding the header. More...
 

Static Public Member Functions

static constexpr size_t max_size ()
 

Private Member Functions

 MessageTmpl (size_t)
 
template<typename... Buffers>
 MessageTmpl (size_t size, SharedBufferView buffer, Buffers... buffers)
 
- Private Member Functions inherited from carla::NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
NonCopyableoperator= (NonCopyable &&)=delete
 

Private Attributes

std::array< boost::asio::const_buffer, MaxNumberOfBuffers+1u > _buffer_views
 
std::array< SharedBufferView, MaxNumberOfBuffers > _buffers
 
message_size_type _number_of_buffers = 0u
 
message_size_type _total_size = 0u
 

Detailed Description

template<size_t MaxNumberOfBuffers>
class carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >

Serialization of a set of buffers to be sent over a TCP socket as a single message.

Template paramenter MaxNumberOfBuffers imposes a compile-time limit on the maximum number of buffers that can be included in a single message.

Definition at line 34 of file Message.h.

Constructor & Destructor Documentation

◆ MessageTmpl() [1/3]

template<size_t MaxNumberOfBuffers>
carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::MessageTmpl ( size_t  )
inlineprivate

Definition at line 45 of file Message.h.

◆ MessageTmpl() [2/3]

template<size_t MaxNumberOfBuffers>
template<typename... Buffers>
carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::MessageTmpl ( size_t  size,
SharedBufferView  buffer,
Buffers...  buffers 
)
inlineprivate

◆ MessageTmpl() [3/3]

template<size_t MaxNumberOfBuffers>
template<typename... Buffers>
carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::MessageTmpl ( SharedBufferView  buf,
Buffers...  buffers 
)
inline

Definition at line 59 of file Message.h.

References carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::_buffer_views, carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::_total_size, and carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::max_size().

+ Here is the call graph for this function:

Member Function Documentation

◆ empty()

template<size_t MaxNumberOfBuffers>
bool carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::empty ( ) const
inlinenoexcept

Definition at line 70 of file Message.h.

References carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::size().

+ Here is the call graph for this function:

◆ GetBufferSequence()

template<size_t MaxNumberOfBuffers>
auto carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::GetBufferSequence ( ) const
inline

Definition at line 74 of file Message.h.

References carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::_buffer_views, carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::_number_of_buffers, and carla::MakeListView().

+ Here is the call graph for this function:

◆ max_size()

template<size_t MaxNumberOfBuffers>
static constexpr size_t carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::max_size ( )
inlinestatic

Definition at line 39 of file Message.h.

Referenced by carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::MessageTmpl().

+ Here is the caller graph for this function:

◆ size()

template<size_t MaxNumberOfBuffers>
auto carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::size ( ) const
inlinenoexcept

Size in bytes of the message excluding the header.

Definition at line 66 of file Message.h.

References carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::_total_size.

Referenced by carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::empty().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _buffer_views

template<size_t MaxNumberOfBuffers>
std::array<boost::asio::const_buffer, MaxNumberOfBuffers + 1u> carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::_buffer_views
private

◆ _buffers

template<size_t MaxNumberOfBuffers>
std::array<SharedBufferView, MaxNumberOfBuffers> carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::_buffers
private

◆ _number_of_buffers

template<size_t MaxNumberOfBuffers>
message_size_type carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::_number_of_buffers = 0u
private

◆ _total_size

template<size_t MaxNumberOfBuffers>
message_size_type carla::streaming::detail::tcp::MessageTmpl< MaxNumberOfBuffers >::_total_size = 0u
private

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