X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Faudiographer%2Faudiographer%2Fprocess_context.h;h=15128ab4ea54ea3298c260671d8da0978057c84b;hb=bb8cb93789b2eec65e4d82e5ceb64054673cbc4f;hp=b73f5d69d5cdf0ec51e8d53bc26311f9d3a95676;hpb=0938a42440cc82ce8d0cb064840c258c863714ab;p=ardour.git diff --git a/libs/audiographer/audiographer/process_context.h b/libs/audiographer/audiographer/process_context.h index b73f5d69d5..15128ab4ea 100644 --- a/libs/audiographer/audiographer/process_context.h +++ b/libs/audiographer/audiographer/process_context.h @@ -15,6 +15,7 @@ namespace AudioGrapher { + /** * Processing context. Constness only applies to data, not flags */ @@ -23,6 +24,9 @@ template class ProcessContext : public Throwing<> { + // Support older compilers that don't support template base class initialization without template parameters + // This will need to be modified if if it's modified above + static const ThrowLevel throwLevel = DEFAULT_THROW_LEVEL; BOOST_STATIC_ASSERT (boost::has_trivial_destructor::value); @@ -43,25 +47,25 @@ public: /// Normal copy constructor ProcessContext (ProcessContext const & other) - : _data (other._data), _frames (other._frames), _channels (other._channels), _flags (other._flags) + : Throwing(), _data (other._data), _frames (other._frames), _channels (other._channels), _flags (other._flags) { /* No need to validate data */ } /// "Copy constructor" with unique data, frame and channel count, but copies flags template ProcessContext (ProcessContext const & other, T * data, framecnt_t frames, ChannelCount channels) - : _data (data), _frames (frames), _channels (channels), _flags (other.flags()) + : Throwing(), _data (data), _frames (frames), _channels (channels), _flags (other.flags()) { validate_data(); } /// "Copy constructor" with unique data and frame count, but copies channel count and flags template ProcessContext (ProcessContext const & other, T * data, framecnt_t frames) - : _data (data), _frames (frames), _channels (other.channels()), _flags (other.flags()) + : Throwing(), _data (data), _frames (frames), _channels (other.channels()), _flags (other.flags()) { validate_data(); } /// "Copy constructor" with unique data, but copies frame and channel count + flags template ProcessContext (ProcessContext const & other, T * data) - : _data (data), _frames (other.frames()), _channels (other.channels()), _flags (other.flags()) + : Throwing(), _data (data), _frames (other.frames()), _channels (other.channels()), _flags (other.flags()) { /* No need to validate data */ } /// Make new Context out of the beginning of this context @@ -121,8 +125,9 @@ protected: /// A process context that allocates and owns it's data buffer template -struct AllocatingProcessContext : public ProcessContext +class AllocatingProcessContext : public ProcessContext { +public: /// Allocates uninitialized memory AllocatingProcessContext (framecnt_t frames, ChannelCount channels) : ProcessContext (new T[frames], frames, channels) {}