MPD: ConstBuffer< T > Struct Template Reference

MPD 0.20.18

Public Types | Public Member Functions | Static Public Member Functions | Data Fields
ConstBuffer< T > Struct Template Reference

A reference to a memory area that is read-only. More...

`#include <FlacPcm.hxx>`

Collaboration diagram for ConstBuffer< T >:
[legend]

## Public Types
typedef size_t | size_type
typedef const T & | reference_type
typedef reference_type | const_reference_type
typedef const T * | pointer_type
typedef pointer_type | const_pointer_type
typedef pointer_type | iterator
typedef pointer_type | const_iterator

## Public Member Functions
| ConstBuffer ()=default
constexpr | ConstBuffer (std::nullptr_t)
constexpr | ConstBuffer (pointer_type _data, size_type _size)
constexpr ConstBuffer< void > | ToVoid () const
constexpr bool | IsNull () const
constexpr bool | IsEmpty () const
template<typename U >
gcc_pure bool | Contains (U &&u) const noexcept
constexpr iterator | begin () const
constexpr iterator | end () const
constexpr const_iterator | cbegin () const
constexpr const_iterator | cend () const
reference_type | operator[] (size_type i) const
reference_type | front () const
| Returns a reference to the first element. More...
reference_type | back () const
| Returns a reference to the last element. More...
void | pop_front ()
| Remove the first element (by moving the head pointer, does not actually modify the buffer). More...
void | pop_back ()
| Remove the last element (by moving the tail pointer, does not actually modify the buffer). More...
reference_type | shift ()
| Remove the first element and return a reference to it. More...
void | skip_front (size_type n)
void | MoveFront (pointer_type new_data)
| Move the front pointer to the given address, and adjust the size attribute to retain the old end address. More...

## Static Public Member Functions
static constexpr ConstBuffer | Null ()
static ConstBuffer< T > | FromVoid (ConstBuffer< void > other)
| Cast a ConstBuffer<void> to a ConstBuffer<T>. More...

## Data Fields
pointer_type | data
size_type | size

## Detailed Description

### template<typename T>
struct ConstBuffer< T >

A reference to a memory area that is read-only.

Definition at line 29 of file FlacPcm.hxx.

## Member Typedef Documentation

## ◆ const_iterator

template<typename T>

typedef pointer_type ConstBuffer< T >::const_iterator

Definition at line 94 of file ConstBuffer.hxx.

## ◆ const_pointer_type

template<typename T>

typedef pointer_type ConstBuffer< T >::const_pointer_type

Definition at line 92 of file ConstBuffer.hxx.

## ◆ const_reference_type

template<typename T>

typedef reference_type ConstBuffer< T >::const_reference_type

Definition at line 90 of file ConstBuffer.hxx.

## ◆ iterator

template<typename T>

typedef pointer_type ConstBuffer< T >::iterator

Definition at line 93 of file ConstBuffer.hxx.

## ◆ pointer_type

template<typename T>

typedef const T* ConstBuffer< T >::pointer_type

Definition at line 91 of file ConstBuffer.hxx.

## ◆ reference_type

template<typename T>

typedef const T& ConstBuffer< T >::reference_type

Definition at line 89 of file ConstBuffer.hxx.

## ◆ size_type

template<typename T>

typedef size_t ConstBuffer< T >::size_type

Definition at line 88 of file ConstBuffer.hxx.

## Constructor & Destructor Documentation

## ◆ ConstBuffer() [1/3]

template<typename T>

ConstBuffer< T >::ConstBuffer | ( |  | ) |
| default

## ◆ ConstBuffer() [2/3]

template<typename T>

constexpr ConstBuffer< T >::ConstBuffer | ( | std::nullptr_t |  | ) |
| inline

Definition at line 101 of file ConstBuffer.hxx.

## ◆ ConstBuffer() [3/3]

template<typename T>

constexpr ConstBuffer< T >::ConstBuffer | ( | pointer_type | _data,
|  | size_type | _size
| ) |  |
| inline

Definition at line 103 of file ConstBuffer.hxx.

## Member Function Documentation

## ◆ back()

template<typename T>

reference_type ConstBuffer< T >::back | ( |  | ) | const
| inline

Returns a reference to the last element.

Buffer must not be empty.

Definition at line 199 of file ConstBuffer.hxx.

## ◆ begin()

template<typename T>

constexpr iterator ConstBuffer< T >::begin | ( |  | ) | const
| inline

Definition at line 151 of file ConstBuffer.hxx.

## ◆ cbegin()

template<typename T>

constexpr const_iterator ConstBuffer< T >::cbegin | ( |  | ) | const
| inline

Definition at line 159 of file ConstBuffer.hxx.

## ◆ cend()

template<typename T>

constexpr const_iterator ConstBuffer< T >::cend | ( |  | ) | const
| inline

Definition at line 163 of file ConstBuffer.hxx.

## ◆ Contains()

template<typename T>
template<typename U >

gcc_pure bool ConstBuffer< T >::Contains | ( | U && | u | ) | const
| inlinenoexcept

Definition at line 143 of file ConstBuffer.hxx.

## ◆ end()

template<typename T>

constexpr iterator ConstBuffer< T >::end | ( |  | ) | const
| inline

Definition at line 155 of file ConstBuffer.hxx.

## ◆ FromVoid()

template<typename T>

static ConstBuffer<T> ConstBuffer< T >::FromVoid | ( | ConstBuffer< void > | other | ) |
| inlinestatic

Cast a ConstBuffer<void> to a ConstBuffer<T>.

A "void" buffer records its size in bytes, and when casting to "T", the assertion below ensures that the size is a multiple of sizeof(T).

Definition at line 119 of file ConstBuffer.hxx.

## ◆ front()

template<typename T>

reference_type ConstBuffer< T >::front | ( |  | ) | const
| inline

Returns a reference to the first element.

Buffer must not be empty.

Definition at line 185 of file ConstBuffer.hxx.

## ◆ IsEmpty()

template<typename T>

constexpr bool ConstBuffer< T >::IsEmpty | ( |  | ) | const
| inline

Definition at line 137 of file ConstBuffer.hxx.

## ◆ IsNull()

template<typename T>

constexpr bool ConstBuffer< T >::IsNull | ( |  | ) | const
| inline

Definition at line 133 of file ConstBuffer.hxx.

## ◆ MoveFront()

template<typename T>

void ConstBuffer< T >::MoveFront | ( | pointer_type | new_data | ) |
| inline

Move the front pointer to the given address, and adjust the size attribute to retain the old end address.

Definition at line 254 of file ConstBuffer.hxx.

## ◆ Null()

template<typename T>

static constexpr ConstBuffer ConstBuffer< T >::Null | ( |  | ) |
| inlinestatic

Definition at line 106 of file ConstBuffer.hxx.

## ◆ operator[]()

template<typename T>

reference_type ConstBuffer< T >::operator[] | ( | size_type | i | ) | const
| inline

Definition at line 170 of file ConstBuffer.hxx.

## ◆ pop_back()

template<typename T>

void ConstBuffer< T >::pop_back | ( |  | ) |
| inline

Remove the last element (by moving the tail pointer, does not actually modify the buffer).

Buffer must not be empty.

Definition at line 223 of file ConstBuffer.hxx.

## ◆ pop_front()

template<typename T>

void ConstBuffer< T >::pop_front | ( |  | ) |
| inline

Remove the first element (by moving the head pointer, does not actually modify the buffer).

Buffer must not be empty.

Definition at line 210 of file ConstBuffer.hxx.

## ◆ shift()

template<typename T>

reference_type ConstBuffer< T >::shift | ( |  | ) |
| inline

Remove the first element and return a reference to it.

Buffer must not be empty.

Definition at line 235 of file ConstBuffer.hxx.

## ◆ skip_front()

template<typename T>

void ConstBuffer< T >::skip_front | ( | size_type | n | ) |
| inline

Definition at line 241 of file ConstBuffer.hxx.

## ◆ ToVoid()

template<typename T>

constexpr ConstBuffer<void> ConstBuffer< T >::ToVoid | ( |  | ) | const
| inline

Definition at line 128 of file ConstBuffer.hxx.

## Field Documentation

## ◆ data

template<typename T>

pointer_type ConstBuffer< T >::data

Definition at line 96 of file ConstBuffer.hxx.

## ◆ size

template<typename T>

size_type ConstBuffer< T >::size

Definition at line 97 of file ConstBuffer.hxx.

The documentation for this struct was generated from the following files:

- decoder/plugins/FlacPcm.hxx
- util/ConstBuffer.hxx