BLPAPI C++  3.24.8
Bytes Class Reference

#include <blpapi_types.h>

Public Types

typedef const char element_type
 
typedef char value_type
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef const char * pointer
 
typedef const char * const_pointer
 
typedef const char & reference
 
typedef const char & const_reference
 
typedef const char * iterator
 
typedef const char * const_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 Bytes () noexcept
 
 Bytes (pointer ptr, size_type length) noexcept
 
void assign (pointer ptr, size_type length) noexcept
 
iterator begin () const noexcept
 
iterator end () const noexcept
 
reverse_iterator rbegin () const noexcept
 
reverse_iterator rend () const noexcept
 
reference front () const
 
reference back () const
 
reference operator[] (size_type index) const
 
pointer data () const noexcept
 
size_type size () const noexcept
 
bool empty () const noexcept
 
Bytes first (size_type count) const
 
Bytes last (size_type count) const
 
Bytes subspan (size_type offset, size_type count=static_cast< std::size_t >(-1)) const
 
template<typename BYTE_CONTAINER , typename std::enable_if< IsByteContainer< BYTE_CONTAINER, iterator >::value, bool >::type = true>
 operator BYTE_CONTAINER () const
 

Detailed Description

Bytes is used as a byte array representation.

It contains the pointer and size of a contiguous block of memory - byte array. Data is not copied into Bytes, i.e. it needs to live longer than the corresponding Bytes object.

See Component blpapi_types

Member Typedef Documentation

◆ const_iterator

typedef const char* const_iterator

◆ const_pointer

typedef const char* const_pointer

◆ const_reference

typedef const char& const_reference

◆ const_reverse_iterator

typedef std::reverse_iterator<const_iterator> const_reverse_iterator

◆ difference_type

typedef std::ptrdiff_t difference_type

◆ element_type

typedef const char element_type

◆ iterator

typedef const char* iterator

◆ pointer

typedef const char* pointer

◆ reference

typedef const char& reference

◆ reverse_iterator

typedef std::reverse_iterator<iterator> reverse_iterator

◆ size_type

typedef std::size_t size_type

◆ value_type

typedef char value_type

Constructor & Destructor Documentation

◆ Bytes() [1/2]

Bytes ( )
noexcept

Create an empty Bytes object.

◆ Bytes() [2/2]

Bytes ( pointer  ptr,
size_type  length 
)
noexcept

Create a Bytes object pointing to a contiguous block of memory starting from the specified ptr and having the specified length.

Member Function Documentation

◆ assign()

void assign ( pointer  ptr,
size_type  length 
)
noexcept

Replace the content of the Bytes object to make it pointing to a contiguous block of memory starting from the specified ptr and having the specified length.

◆ back()

Bytes::reference back ( ) const

Return a reference to the last element in the byte array. Calling back on an empty byte array results in undefined behavior.

◆ begin()

Bytes::iterator begin ( ) const
noexcept

Return an iterator to the first element of the byte array. If the byte array is empty, the returned iterator will be equal to end().

◆ data()

Bytes::pointer data ( ) const
noexcept

Return a pointer to the beginning of the byte array.

◆ empty()

bool empty ( ) const
noexcept

Check if the byte array is empty.

◆ end()

Bytes::iterator end ( ) const
noexcept

Return an iterator to the element following the last element of the byte array. This element acts as a placeholder; attempting to access it results in undefined behavior.

◆ first()

Bytes first ( size_type  count) const

Obtain a byte array that is a view over the first specified count elements of this byte array. The behavior is undefined if count > size().

◆ front()

Bytes::reference front ( ) const

Return a reference to the first element in the byte array. Calling front on an empty byte array results in undefined behavior.

◆ last()

Bytes last ( size_type  count) const

Obtain a byte array that is a view over the last specified count elements of this byte array. The behavior is undefined if count > size().

◆ operator BYTE_CONTAINER()

operator BYTE_CONTAINER ( ) const

Convert the byte array to a BYTE_CONTAINER. BYTE_CONTAINER is any type that can be constructed with two iterators to the beginning and the end of the byte array, i.e. BYTE_CONTAINER(begin(), end()). Also, BYTE_CONTAINER must provide a type value_type such that sizeof(BYTE_CONTAINER::value_type) == 1.

◆ operator[]()

Bytes::reference operator[] ( size_type  index) const

Return a reference to the specified index-th element of the byte array. The behavior is undefined if index is out of range (i.e., if it is greater than or equal to size()).

◆ rbegin()

Bytes::reverse_iterator rbegin ( ) const
noexcept

Return a reverse iterator to the first element of the reversed byte array. It corresponds to the last element of the non-reversed byte array. If the byte array is empty, the returned iterator is equal to rend().

◆ rend()

Bytes::reverse_iterator rend ( ) const
noexcept

Return a reverse iterator to the element following the last element of the reversed byte array. It corresponds to the element preceding the first element of the non-reversed byte array. This element acts as a placeholder, attempting to access it results in undefined behavior.

◆ size()

Bytes::size_type size ( ) const
noexcept

Return the number of elements in the byte array.

◆ subspan()

Bytes subspan ( size_type  offset,
size_type  count = static_cast<std::size_t>(-1) 
) const

Obtain a byte array that is a view over the specified count elements of this byte array starting at the specified offset. If count == -1, the number of elements in the subspan is size() - offset (i.e., it ends at the end of *this). The behavior is undefined if either offset or count is out of range. This happens if offset > size(), or count != -1 and count > size() - offset.


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