diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-07 00:18:42 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-07 00:18:42 +0400 |
commit | cb12337363032e59967b4935e10e8d996f297ca1 (patch) | |
tree | 6d73642eaf1c0f8d793e752988dfdbdd4e41d150 /intern/container/CTR_Map.h | |
parent | 4eb1b5256e0159f747c055e10bd091a40fc834b7 (diff) |
Code cleanup: remove source/kernel module, this wasn't really the kernel of
anything, only contained a hash map and functions to pass command line args
to the game engine. Moved those to container and BlenderRoutines modules.
Diffstat (limited to 'intern/container/CTR_Map.h')
-rw-r--r-- | intern/container/CTR_Map.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/intern/container/CTR_Map.h b/intern/container/CTR_Map.h index cbd67fdeaca..1991ec19e3a 100644 --- a/intern/container/CTR_Map.h +++ b/intern/container/CTR_Map.h @@ -55,6 +55,19 @@ public: m_buckets[i] = 0; } } + + CTR_Map(const CTR_Map& map) + { + m_num_buckets = map.m_num_buckets; + m_buckets = new Entry *[m_num_buckets]; + + for (int i = 0; i < m_num_buckets; ++i) { + m_buckets[i] = 0; + + for(Entry *entry = map.m_buckets[i]; entry; entry=entry->m_next) + insert(entry->m_key, entry->m_value); + } + } int size() { int count=0; @@ -87,6 +100,24 @@ public: } return 0; } + + Key* getKey(int index) { + int count=0; + for (int i=0;i<m_num_buckets;i++) + { + Entry* bucket = m_buckets[i]; + while(bucket) + { + if (count==index) + { + return &bucket->m_key; + } + bucket = bucket->m_next; + count++; + } + } + return 0; + } void clear() { for (int i = 0; i < m_num_buckets; ++i) { |