summaryrefslogtreecommitdiff
path: root/src/buffer_manager.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-03-26 14:21:49 +0000
committerMaxime Coste <frrrwww@gmail.com>2012-03-26 14:21:49 +0000
commit792f0f7f2e107fe6edee175ddf0b08135a355e7c (patch)
tree8eaef14cbe0f7c0d8ce3a08e8aa9a0d897e924ba /src/buffer_manager.hh
parent3c798a4ee84238caa7df847f3d8cf31bf6b16fb0 (diff)
BufferManager no longer owns buffers, only register them
Diffstat (limited to 'src/buffer_manager.hh')
-rw-r--r--src/buffer_manager.hh10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/buffer_manager.hh b/src/buffer_manager.hh
index ee3473cd..7109dc11 100644
--- a/src/buffer_manager.hh
+++ b/src/buffer_manager.hh
@@ -1,20 +1,20 @@
#ifndef buffer_manager_hh_INCLUDED
#define buffer_manager_hh_INCLUDED
-#include "buffer.hh"
#include "completion.hh"
#include "utils.hh"
#include <unordered_map>
-#include <memory>
namespace Kakoune
{
+class Buffer;
+
class BufferManager : public Singleton<BufferManager>
{
public:
- typedef std::unordered_map<std::string, std::unique_ptr<Buffer>> BufferMap;
+ typedef std::unordered_map<std::string, Buffer*> BufferMap;
struct iterator : public BufferMap::const_iterator
{
@@ -23,11 +23,11 @@ public:
iterator() {}
iterator(const parent_type& other) : parent_type(other) {}
Buffer& operator*() const { return *(parent_type::operator*().second); }
- Buffer* operator->() const { return parent_type::operator*().second.get(); }
+ Buffer* operator->() const { return parent_type::operator*().second; }
};
void register_buffer(Buffer* buffer);
- void delete_buffer(Buffer* buffer);
+ void unregister_buffer(Buffer* buffer);
iterator begin() const { return iterator(m_buffers.begin()); }
iterator end() const { return iterator(m_buffers.end()); }