Public Types | Public Member Functions

blpapi::Bytes Class Reference

#include <blpapi_types.h>

List of all members.

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
< iterator
reverse_iterator
typedef std::reverse_iterator
< const_iterator
const_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

typedef const char blpapi::Bytes::element_type
typedef std::size_t blpapi::Bytes::size_type
typedef std::ptrdiff_t blpapi::Bytes::difference_type
typedef const char* blpapi::Bytes::pointer
typedef const char* blpapi::Bytes::const_pointer
typedef const char& blpapi::Bytes::reference
typedef const char& blpapi::Bytes::const_reference
typedef const char* blpapi::Bytes::iterator
typedef const char* blpapi::Bytes::const_iterator
typedef std::reverse_iterator<iterator> blpapi::Bytes::reverse_iterator
typedef std::reverse_iterator<const_iterator> blpapi::Bytes::const_reverse_iterator

Constructor & Destructor Documentation

blpapi::Bytes::Bytes (  ) 

Create an empty Bytes object.

blpapi::Bytes::Bytes ( pointer  ptr,
size_type  length 
)

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


Member Function Documentation

void blpapi::Bytes::assign ( pointer  ptr,
size_type  length 
)

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.

iterator blpapi::Bytes::begin (  )  const

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().

iterator blpapi::Bytes::end (  )  const

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.

reverse_iterator blpapi::Bytes::rbegin (  )  const

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().

reverse_iterator blpapi::Bytes::rend (  )  const

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.

reference blpapi::Bytes::front (  )  const

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

reference blpapi::Bytes::back (  )  const

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

reference blpapi::Bytes::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()).

pointer blpapi::Bytes::data (  )  const

Return a pointer to the beginning of the byte array.

size_type blpapi::Bytes::size (  )  const

Return the number of elements in the byte array.

bool blpapi::Bytes::empty (  )  const

Check if the byte array is empty.

Bytes blpapi::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().

Bytes blpapi::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().

Bytes blpapi::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.

template<typename BYTE_CONTAINER , typename std::enable_if< IsByteContainer< BYTE_CONTAINER, iterator >::value, bool >::type = true>
blpapi::Bytes::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.


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