Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::core::Slice< T > Class Template Reference

Slice. More...

#include <slice.h>

Public Member Functions

 Slice ()
 Construct empty slice. More...
 
 Slice (Buffer< T > *buffer)
 Construct slice pointing to a buffer. More...
 
 Slice (Buffer< T > &buffer, size_t from, size_t to)
 Construct slice pointing to a part of a buffer. More...
 
T * data () const
 Get slice data. More...
 
size_t size () const
 Get number of elements in slice. More...
 
size_t capacity () const
 Get maximum possible number of elements in slice. More...
 
void resize (size_t new_size)
 Change slice size, up to the available capacity. More...
 
Slice range (size_t from, size_t to) const
 Construct a slice pointing to a part of this slice. More...
 
void print () const
 Print slice to stderr. More...
 
 operator const struct unspecified_bool * () const
 Convert to bool. More...
 

Detailed Description

template<class T>
class roc::core::Slice< T >

Slice.

Definition at line 23 of file slice.h.

Constructor & Destructor Documentation

template<class T>
roc::core::Slice< T >::Slice ( )
inline

Construct empty slice.

Definition at line 26 of file slice.h.

template<class T>
roc::core::Slice< T >::Slice ( Buffer< T > *  buffer)
inline

Construct slice pointing to a buffer.

Definition at line 33 of file slice.h.

template<class T>
roc::core::Slice< T >::Slice ( Buffer< T > &  buffer,
size_t  from,
size_t  to 
)
inline

Construct slice pointing to a part of a buffer.

Definition at line 45 of file slice.h.

Member Function Documentation

template<class T>
size_t roc::core::Slice< T >::capacity ( ) const
inline

Get maximum possible number of elements in slice.

Definition at line 74 of file slice.h.

template<class T>
T* roc::core::Slice< T >::data ( ) const
inline

Get slice data.

Definition at line 61 of file slice.h.

template<class T>
roc::core::Slice< T >::operator const struct unspecified_bool * ( ) const
inline

Convert to bool.

Returns
true if the slice is attached to buffer, even if it has zero length.

Definition at line 122 of file slice.h.

template<class T>
void roc::core::Slice< T >::print ( ) const
inline

Print slice to stderr.

Definition at line 111 of file slice.h.

template<class T>
Slice roc::core::Slice< T >::range ( size_t  from,
size_t  to 
) const
inline

Construct a slice pointing to a part of this slice.

Definition at line 93 of file slice.h.

template<class T>
void roc::core::Slice< T >::resize ( size_t  new_size)
inline

Change slice size, up to the available capacity.

Definition at line 83 of file slice.h.

template<class T>
size_t roc::core::Slice< T >::size ( ) const
inline

Get number of elements in slice.

Definition at line 69 of file slice.h.


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