summaryrefslogtreecommitdiffstats
path: root/src/server/Buffer.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-23 00:28:01 +0000
committerDavid Robillard <d@drobilla.net>2012-04-23 00:28:01 +0000
commit170025af736c1bfea56799f64384c4915047b8e5 (patch)
tree6b5ea57bac0e72e115420f0e2c55dd086e4b2358 /src/server/Buffer.hpp
parent034c8948e8fe47b487e17a8dd438f3a9857d571a (diff)
downloadingen-170025af736c1bfea56799f64384c4915047b8e5.tar.gz
ingen-170025af736c1bfea56799f64384c4915047b8e5.tar.bz2
ingen-170025af736c1bfea56799f64384c4915047b8e5.zip
Maybe fix boost compilation errors.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4245 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/Buffer.hpp')
-rw-r--r--src/server/Buffer.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp
index 44db0959..11436d9c 100644
--- a/src/server/Buffer.hpp
+++ b/src/server/Buffer.hpp
@@ -24,11 +24,11 @@
#include <boost/utility.hpp>
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
+#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "raul/AtomicInt.hpp"
#include "raul/Deletable.hpp"
#include "raul/SharedPtr.hpp"
-#include "BufferFactory.hpp"
#include "PortType.hpp"
#include "types.hpp"
@@ -44,6 +44,8 @@ class Buffer : public boost::noncopyable, public Raul::Deletable
public:
Buffer(BufferFactory& bufs, LV2_URID type, uint32_t capacity);
+ typedef boost::intrusive_ptr<Buffer> Ref;
+
virtual void clear();
virtual void resize(uint32_t size);
virtual void copy(Context& context, const Buffer* src);
@@ -68,8 +70,9 @@ public:
inline void ref() { ++_refs; }
inline void deref() {
- if ((--_refs) == 0)
- _factory.recycle(this);
+ if ((--_refs) == 0) {
+ recycle();
+ }
}
protected:
@@ -82,6 +85,8 @@ protected:
virtual ~Buffer();
private:
+ void recycle();
+
Buffer* _next; ///< Intrusive linked list for BufferFactory
Raul::AtomicInt _refs; ///< Intrusive reference count for intrusive_ptr
};