summaryrefslogtreecommitdiffstats
path: root/src/engine/Buffer.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-20 16:26:40 +0000
committerDavid Robillard <d@drobilla.net>2011-04-20 16:26:40 +0000
commit138a87e915ad3aff184730415105f94c874174bf (patch)
tree0d942bdddfdbcc3d969b4fce5592e770ab851b86 /src/engine/Buffer.hpp
parent1f1758f4dda0ddaf01c0b1d3a756f9db8ddc979d (diff)
downloadingen-138a87e915ad3aff184730415105f94c874174bf.tar.gz
ingen-138a87e915ad3aff184730415105f94c874174bf.tar.bz2
ingen-138a87e915ad3aff184730415105f94c874174bf.zip
Rename Ingen::Engine to Ingen::Server (hopefully avoid odd name clases and fix #675).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3184 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/Buffer.hpp')
-rw-r--r--src/engine/Buffer.hpp97
1 files changed, 0 insertions, 97 deletions
diff --git a/src/engine/Buffer.hpp b/src/engine/Buffer.hpp
deleted file mode 100644
index 56682228..00000000
--- a/src/engine/Buffer.hpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/* This file is part of Ingen.
- * Copyright 2007-2011 David Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef INGEN_ENGINE_BUFFER_HPP
-#define INGEN_ENGINE_BUFFER_HPP
-
-#include <cstddef>
-#include <cassert>
-#include <boost/utility.hpp>
-#include <boost/intrusive_ptr.hpp>
-#include "raul/Deletable.hpp"
-#include "raul/SharedPtr.hpp"
-#include "ingen/PortType.hpp"
-#include "types.hpp"
-#include "BufferFactory.hpp"
-
-namespace Ingen {
-namespace Engine {
-
-class Context;
-class Engine;
-class BufferFactory;
-
-class Buffer : public boost::noncopyable, public Raul::Deletable
-{
-public:
- Buffer(BufferFactory& bufs, PortType type, size_t size)
- : _factory(bufs)
- , _type(type)
- , _size(size)
- , _next(NULL)
- , _refs(0)
- {}
-
- /** Clear contents and reset state */
- virtual void clear() = 0;
-
- virtual void resize(size_t size) { _size = size; }
-
- virtual void* port_data(PortType port_type, SampleCount offset=0) = 0;
- virtual const void* port_data(PortType port_type, SampleCount offset=0) const = 0;
-
- /** Rewind (ie reset read pointer), but leave contents unchanged */
- virtual void rewind() const {}
-
- virtual void copy(Context& context, const Buffer* src) = 0;
-
- virtual void prepare_read(Context& context) {}
- virtual void prepare_write(Context& context) {}
-
- PortType type() const { return _type; }
- size_t size() const { return _size; }
-
- inline void ref() { ++_refs; }
-
- inline void deref() {
- assert(_refs > 0);
- if ((--_refs) == 0)
- _factory.recycle(this);
- }
-
-protected:
- BufferFactory& _factory;
- PortType _type;
- size_t _size;
-
- friend class BufferFactory;
- virtual ~Buffer() {}
-
-private:
- Buffer* _next; ///< Intrusive linked list for BufferFactory
- size_t _refs; ///< Intrusive reference count for intrusive_ptr
-};
-
-} // namespace Engine
-} // namespace Ingen
-
-namespace boost {
-inline void intrusive_ptr_add_ref(Ingen::Engine::Buffer* b) { b->ref(); }
-inline void intrusive_ptr_release(Ingen::Engine::Buffer* b) { b->deref(); }
-}
-
-#endif // INGEN_ENGINE_BUFFER_HPP