1 #ifndef AUDIOGRAPHER_PROCESS_CONTEXT_H
2 #define AUDIOGRAPHER_PROCESS_CONTEXT_H
22 template <
typename T = DefaultSampleType>
30 static_assert (std::is_trivially_destructible<T>::value);
122 template <
typename T = DefaultSampleType>
159 template <
typename T = DefaultSampleType>
165 :
context (const_cast<T *>(data), samples, channels) {}
172 template<
typename ProcessContext>
174 :
context (other, const_cast<T *>(data), samples, channels) {}
177 template<
typename ProcessContext>
179 :
context (other, const_cast<T *>(data), samples) {}
182 template<
typename ProcessContext>
184 :
context (other, const_cast<T *>(data)) {}
A process context that allocates and owns it's data buffer.
AllocatingProcessContext(ProcessContext< Y > const &other, samplecnt_t samples)
"Copy constructor" with uninitialized data, unique sample count, but copies channel count and flags
AllocatingProcessContext(ProcessContext< Y > const &other)
"Copy constructor" uninitialized data, that copies sample and channel count + flags
AllocatingProcessContext(ProcessContext< Y > const &other, samplecnt_t samples, ChannelCount channels)
"Copy constructor" with uninitialized data, unique sample and channel count, but copies flags
AllocatingProcessContext(ProcessContext< T > const &other)
Copy constructor, copies data from other ProcessContext.
~AllocatingProcessContext()
AllocatingProcessContext(samplecnt_t samples, ChannelCount channels)
Allocates uninitialized memory.
AllocatingProcessContext(T const *data, samplecnt_t samples, ChannelCount channels)
Allocates and copies data from raw buffer.
A wrapper for a const ProcesContext which can be created from const data.
ConstProcessContext(ProcessContext const &other, T const *data, samplecnt_t samples)
"Copy constructor", with unique data and sample count, but copies channel count and flags
ConstProcessContext(ProcessContext const &other, T const *data)
"Copy constructor", with unique data, but copies sample and channel count + flags
ConstProcessContext(ProcessContext const &other, T const *data, samplecnt_t samples, ChannelCount channels)
"Copy constructor", with unique data, sample and channel count, but copies flags
ProcessContext< T > const context
ProcessContext< T > const & operator()()
ConstProcessContext(T const *data, samplecnt_t samples, ChannelCount channels)
Basic constructor with data, sample and channel count.
ConstProcessContext(ProcessContext< T > const &other)
Copy constructor from const ProcessContext.
ProcessContext< T > const * operator&()
bool has(Flag flag) const
ChannelCount const & channels() const
bool has_flag(Flag flag) const
T const * data() const
data points to the array of data to process
ProcessContext beginning(samplecnt_t samples)
Make new Context out of the beginning of this context.
ProcessContext(T *data, samplecnt_t samples, ChannelCount channels)
Basic constructor with data, sample and channel count.
virtual ~ProcessContext()
ProcessContext(ProcessContext< Y > const &other, T *data)
"Copy constructor" with unique data, but copies sample and channel count + flags
static const ThrowLevel throwLevel
samplecnt_t samples_per_channel() const
Returns the amount of samples per channel.
ProcessContext(ProcessContext< T > const &other)
Normal copy constructor.
FlagField const & flags() const
samplecnt_t const & samples() const
samples tells how many samples the array pointed by data contains
void set_flag(Flag flag) const
ProcessContext(ProcessContext< Y > const &other, T *data, samplecnt_t samples)
"Copy constructor" with unique data and sample count, but copies channel count and flags
void remove_flag(Flag flag) const
ProcessContext(ProcessContext< Y > const &other, T *data, samplecnt_t samples, ChannelCount channels)
"Copy constructor" with unique data, sample and channel count, but copies flags
bool throw_level(ThrowLevel level)
static void copy(T const *source, T *destination, samplecnt_t samples)
std::string string_compose(const std::string &fmt, const T1 &o1)
@ ThrowProcess
Process cycle level stuff.
static std::string demangled_name(T const &obj)
Returns the demangled name of the object passed as the parameter.
#define DEFAULT_THROW_LEVEL