Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/container/CTR_Map.h')
-rw-r--r--intern/container/CTR_Map.h31
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) {