15 #ifndef _FASTCDR_CDRBUFFER_H_ 16 #define _FASTCDR_CDRBUFFER_H_ 28 #if defined(_WIN32) || !defined(FASTCDR_ARM32) 30 return static_cast<uint32_t
>(val);
34 #endif // if defined(_WIN32) || !defined(FASTCDR_ARM32) 52 , m_currentPosition(NULL)
66 , m_currentPosition(&m_buffer[index])
80 ptrdiff_t diff = m_currentPosition - m_buffer;
82 m_currentPosition = m_buffer + diff;
95 m_currentPosition = m_buffer + diff;
103 template<
typename _T>
108 memcpy(m_currentPosition, &data,
sizeof(_T));
116 template<
typename _T>
121 memcpy(&data, m_currentPosition,
sizeof(_T));
136 memcpy(m_currentPosition, src, size);
152 memcpy(dst, m_currentPosition, size);
164 m_currentPosition += numBytes;
210 return m_currentPosition;
250 const size_t bufferSize);
257 , m_internalBuffer(true)
260 std::swap(m_bufferSize, fbuffer.m_bufferSize);
261 std::swap(m_internalBuffer, fbuffer.m_internalBuffer);
269 std::swap(m_bufferSize, fbuffer.m_bufferSize);
270 std::swap(m_internalBuffer, fbuffer.m_internalBuffer);
304 return (iterator(m_buffer, 0));
314 return (iterator(m_buffer, m_bufferSize));
353 #endif // _FASTCDR_FASTCDRBUFFER_H_ constexpr automagic_flags operator &(automagic_flags left, automagic_flags right) noexcept
_FastBuffer_iterator iterator
size_t getBufferSize() const
This function returns the size of the allocated memory of the stream that the eprosima::fastcdr::Fast...
void reserve(T &, std::size_t)
bool m_internalBuffer
This variable indicates if the managed buffer is internal or is from the user.
This class implements the iterator used to go through a FastBuffer.
iterator begin()
This function returns a iterator that points to the begining of the stream.
_FastBuffer_iterator(char *buffer, size_t index)
Constructor. The iterator points to the indicated position.
uint32_t size_to_uint32(size_t val)
void rmemcopy(void *dst, const size_t size)
This function copies from the raw buffer to a external buffer.
std::ostream & operator<<(std::ostream &out, const Interval< Scalar, Value > &i)
NLOHMANN_BASIC_JSON_TPL_DECLARATION void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL &j1, nlohmann::NLOHMANN_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name) is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression) is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
char * m_buffer
Pointer to the raw buffer.
size_t m_bufferSize
The total size of the user's buffer.
FastBuffer(FastBuffer &&fbuffer)
Move constructor.
_FastBuffer_iterator()
Default constructor. The iterator points any position.
char * m_currentPosition
Current position in the raw buffer.
ring_iterator< RS, C > operator-(ring_iterator< RS, C > it, int i) nsrs_noexcept
char * m_buffer
Pointer to the stream of bytes that contains the serialized data.
This class represents a stream of bytes that contains (or will contain) serialized data...
void memcopy(const void *src, const size_t size)
This function copies a buffer into the raw buffer.
span_constexpr std::size_t size(span< T, Extent > const &spn)
char * getBuffer() const
This function returns the stream that the eprosima::fastcdr::FastBuffers uses to serialize data...
iterator end()
This function returns a iterator that points to the end of the stream.