arduino-audio-tools
Loading...
Searching...
No Matches
Slice< T > Class Template Reference

Helps to split up a big memory array into smaller slices. There are no additinal heap allocations! Example: if we have an array with 9 entries (1,2,3,4,5,6,7,8,9): slices(5) gives 2. slice(5,0) returns size 5 with 1,2,3,4,5 and slice(5,1) returns size 4 with 6,7,8,9! More...

#include <CodecOpusOgg.h>

Public Member Functions

 Slice (T *start, size_t len)
 Slice (T *start, size_t len)
T * data ()
 Returns the data.
T * data ()
 Returns the data.
 operator bool ()
 Returns true if we contain any valid data.
 operator bool ()
 Returns true if we contain any valid data.
size_t size ()
 Returns the (result) data size is number of entries.
size_t size ()
 Returns the (result) data size is number of entries.
Slice slice (int sliceSize, int idx)
 Returns the slice at the indicated index for the indicated slize size;.
Slice slice (int sliceSize, int idx)
 Returns the slice at the indicated index for the indicated slize size;.
size_t slices (int sliceSize)
 Returns the number of slices of the indicated size.
size_t slices (int sliceSize)
 Returns the number of slices of the indicated size.

Protected Attributes

size_t len = 0
T * start = nullptr

Detailed Description

template<class T>
class audio_tools::audio_tools::Slice< T >

Helps to split up a big memory array into smaller slices. There are no additinal heap allocations! Example: if we have an array with 9 entries (1,2,3,4,5,6,7,8,9): slices(5) gives 2. slice(5,0) returns size 5 with 1,2,3,4,5 and slice(5,1) returns size 4 with 6,7,8,9!

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ Slice() [1/2]

template<class T>
Slice ( T * start,
size_t len )
inline

◆ Slice() [2/2]

template<class T>
Slice ( T * start,
size_t len )
inline

Member Function Documentation

◆ data() [1/2]

template<class T>
T * data ( )
inline

Returns the data.

◆ data() [2/2]

template<class T>
T * data ( )
inline

Returns the data.

◆ operator bool() [1/2]

template<class T>
operator bool ( )
inline

Returns true if we contain any valid data.

◆ operator bool() [2/2]

template<class T>
operator bool ( )
inline

Returns true if we contain any valid data.

◆ size() [1/2]

template<class T>
size_t size ( )
inline

Returns the (result) data size is number of entries.

◆ size() [2/2]

template<class T>
size_t size ( )
inline

Returns the (result) data size is number of entries.

◆ slice() [1/2]

template<class T>
Slice slice ( int sliceSize,
int idx )
inline

Returns the slice at the indicated index for the indicated slize size;.

◆ slice() [2/2]

template<class T>
Slice slice ( int sliceSize,
int idx )
inline

Returns the slice at the indicated index for the indicated slize size;.

◆ slices() [1/2]

template<class T>
size_t slices ( int sliceSize)
inline

Returns the number of slices of the indicated size.

◆ slices() [2/2]

template<class T>
size_t slices ( int sliceSize)
inline

Returns the number of slices of the indicated size.

Member Data Documentation

◆ len

template<class T>
size_t len = 0
protected

◆ start

template<class T>
T * start = nullptr
protected

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