cpp-msgpack-light 0.3.0
A light library to serialize MessagePack.
Loading...
Searching...
No Matches
msgpack_light::details::mutable_static_binary_view< N > Class Template Reference

Class of views of mutable buffers with static sizes. More...

#include <msgpack_light/details/mutable_static_binary_view.h>

Collaboration diagram for msgpack_light::details::mutable_static_binary_view< N >:

Public Member Functions

 mutable_static_binary_view (unsigned char *buffer) noexcept
 Constructor.
unsigned char * data () noexcept
 Access the buffer.
unsigned char operator[] (std::size_t index) const noexcept
 Get a byte.
unsigned char & operator[] (std::size_t index) noexcept
 Access to a byte.
std::size_t size () const noexcept
 Get the size of the buffer.
template<std::size_t Start, std::size_t Size = N - Start>
mutable_static_binary_view< Size > sub_buffer () const noexcept
 Get a subset of this buffer.

Private Attributes

unsigned char * buffer_
 Buffer.

Detailed Description

template<std::size_t N>
class msgpack_light::details::mutable_static_binary_view< N >

Class of views of mutable buffers with static sizes.

Template Parameters
NNumber of elements.

Definition at line 32 of file mutable_static_binary_view.h.

Constructor & Destructor Documentation

◆ mutable_static_binary_view()

template<std::size_t N>
msgpack_light::details::mutable_static_binary_view< N >::mutable_static_binary_view ( unsigned char * buffer)
inlineexplicitnoexcept

Constructor.

Parameters
[in]bufferBuffer.

Definition at line 39 of file mutable_static_binary_view.h.

Member Function Documentation

◆ data()

template<std::size_t N>
unsigned char * msgpack_light::details::mutable_static_binary_view< N >::data ( )
inlinenoexcept

Access the buffer.

Returns
Buffer.

Definition at line 67 of file mutable_static_binary_view.h.

◆ operator[]() [1/2]

template<std::size_t N>
unsigned char msgpack_light::details::mutable_static_binary_view< N >::operator[] ( std::size_t index) const
inlinenoexcept

Get a byte.

Parameters
[in]indexIndex of the byte.
Returns
Value of the byte.

Definition at line 58 of file mutable_static_binary_view.h.

◆ operator[]() [2/2]

template<std::size_t N>
unsigned char & msgpack_light::details::mutable_static_binary_view< N >::operator[] ( std::size_t index)
inlinenoexcept

Access to a byte.

Parameters
[in]indexIndex of the byte.
Returns
Reference to the byte.

Definition at line 48 of file mutable_static_binary_view.h.

◆ size()

template<std::size_t N>
std::size_t msgpack_light::details::mutable_static_binary_view< N >::size ( ) const
inlinenodiscardnoexcept

Get the size of the buffer.

Returns
Size.

Definition at line 74 of file mutable_static_binary_view.h.

◆ sub_buffer()

template<std::size_t N>
template<std::size_t Start, std::size_t Size = N - Start>
mutable_static_binary_view< Size > msgpack_light::details::mutable_static_binary_view< N >::sub_buffer ( ) const
inlinenodiscardnoexcept

Get a subset of this buffer.

Template Parameters
StartIndex of the first byte in the current buffer.
Returns
Subset.

Definition at line 83 of file mutable_static_binary_view.h.

Member Data Documentation

◆ buffer_

template<std::size_t N>
unsigned char* msgpack_light::details::mutable_static_binary_view< N >::buffer_
private

Buffer.

Definition at line 91 of file mutable_static_binary_view.h.


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