use pbd's gstdio compatibility wrapper
[ardour.git] / libs / audiographer / audiographer / process_context.h
index b73f5d69d5cdf0ec51e8d53bc26311f9d3a95676..36abd4fba0ddd477728912efeeb9f31f872cd288 100644 (file)
@@ -5,6 +5,7 @@
 #include <boost/type_traits.hpp>
 #include <boost/format.hpp>
 
+#include "audiographer/visibility.h"
 #include "exception.h"
 #include "debug_utils.h"
 #include "types.h"
 namespace AudioGrapher
 {
 
+
 /**
  * Processing context. Constness only applies to data, not flags
  */
 
 template <typename T = DefaultSampleType>
-class ProcessContext
+class /*LIBAUDIOGRAPHER_API*/ 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<T>::value);
 
@@ -43,25 +48,25 @@ public:
        
        /// Normal copy constructor
        ProcessContext (ProcessContext<T> const & other)
-       : _data (other._data), _frames (other._frames), _channels (other._channels), _flags (other._flags)
+               : Throwing<throwLevel>(), _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<typename Y>
        ProcessContext (ProcessContext<Y> const & other, T * data, framecnt_t frames, ChannelCount channels)
-               : _data (data), _frames (frames), _channels (channels), _flags (other.flags())
+               : Throwing<throwLevel>(), _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<typename Y>
        ProcessContext (ProcessContext<Y> const & other, T * data, framecnt_t frames)
-               : _data (data), _frames (frames), _channels (other.channels()), _flags (other.flags())
+               : Throwing<throwLevel>(), _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<typename Y>
        ProcessContext (ProcessContext<Y> const & other, T * data)
-               : _data (data), _frames (other.frames()), _channels (other.channels()), _flags (other.flags())
+               : Throwing<throwLevel>(), _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 +126,9 @@ protected:
 
 /// A process context that allocates and owns it's data buffer
 template <typename T = DefaultSampleType>
-struct AllocatingProcessContext : public ProcessContext<T>
+class /*LIBAUDIOGRAPHER_API*/ AllocatingProcessContext : public ProcessContext<T>
 {
+public:
        /// Allocates uninitialized memory
        AllocatingProcessContext (framecnt_t frames, ChannelCount channels)
                : ProcessContext<T> (new T[frames], frames, channels) {}
@@ -157,7 +163,7 @@ struct AllocatingProcessContext : public ProcessContext<T>
 
 /// A wrapper for a const ProcesContext which can be created from const data
 template <typename T = DefaultSampleType>
-class ConstProcessContext
+class /*LIBAUDIOGRAPHER_API*/ ConstProcessContext
 {
   public:
        /// Basic constructor with data, frame and channel count