aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_bankmap.h
diff options
context:
space:
mode:
authorJP Cimalando <jpcima@users.noreply.github.com>2018-05-16 03:27:07 +0200
committerJP Cimalando <jpcima@users.noreply.github.com>2018-05-16 19:34:07 +0200
commit8cce88f8706ca6fb52592458aa12641c43469a6e (patch)
tree7c35d9e37ac7885377d05a6cebb6d89ccc19119a /src/adlmidi_bankmap.h
parentaf1926e8fe3627880290baad4e45335a5c627620 (diff)
downloadlibADLMIDI-8cce88f8706ca6fb52592458aa12641c43469a6e.tar.gz
libADLMIDI-8cce88f8706ca6fb52592458aa12641c43469a6e.tar.bz2
libADLMIDI-8cce88f8706ca6fb52592458aa12641c43469a6e.zip
c++98 support for bank map
Diffstat (limited to 'src/adlmidi_bankmap.h')
-rw-r--r--src/adlmidi_bankmap.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/adlmidi_bankmap.h b/src/adlmidi_bankmap.h
index 123c8e1..c249b55 100644
--- a/src/adlmidi_bankmap.h
+++ b/src/adlmidi_bankmap.h
@@ -25,9 +25,8 @@
#define ADLMIDI_BANKMAP_H
#include <list>
-#include <memory>
#include <utility>
-#include <cstdint>
+#include <stdint.h>
#include "adlmidi_ptr.hpp"
@@ -79,15 +78,15 @@ public:
class iterator
{
public:
- iterator() {}
+ iterator();
value_type &operator*() const { return slot->value; }
value_type *operator->() const { return &slot->value; }
iterator &operator++();
bool operator==(const iterator &o) const;
bool operator!=(const iterator &o) const;
private:
- Slot **buckets = nullptr, *slot = nullptr;
- size_t index = 0;
+ Slot **buckets, *slot;
+ size_t index;
iterator(Slot **buckets, Slot *slot, size_t index);
#ifdef _MSC_VER
template<class _T>
@@ -99,14 +98,15 @@ public:
private:
struct Slot {
- Slot *next = nullptr, *prev = nullptr;
+ Slot *next, *prev;
value_type value;
+ Slot() : next(NULL), prev(NULL) {}
};
- std::unique_ptr<Slot *[]> m_buckets;
- std::list<std::unique_ptr<Slot[]>> m_allocations;
- Slot *m_freeslots = nullptr;
- size_t m_size = 0;
- size_t m_capacity = 0;
+ AdlMIDI_SPtrArray<Slot *> m_buckets;
+ std::list< AdlMIDI_SPtrArray<Slot> > m_allocations;
+ Slot *m_freeslots;
+ size_t m_size;
+ size_t m_capacity;
static size_t hash(key_type key);
Slot *allocate_slot();
Slot *ensure_allocate_slot();