PeriDyno 1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MultiMap.h
Go to the documentation of this file.
1#ifndef MultiMap_H
2#define MultiMap_H
3
4#include "Platform.h"
5#include "Pair.h"
6
7namespace dyno
8{
19 template <typename MKey, typename T>
21 {
22 public:
24
25 DYN_FUNC MultiMap();
26
27 DYN_FUNC void reserve(Pair<MKey, T>* buf, int maxSize) {
28 m_startLoc = buf;
29 m_maxSize = maxSize;
30 }
31
32 DYN_FUNC iterator find(MKey key);
33
34 DYN_FUNC inline iterator begin() {
35 return m_startLoc;
36 };
37
38 DYN_FUNC inline iterator end(){
39 return m_startLoc + m_size;
40 }
41
42 DYN_FUNC void clear();
43
44 DYN_FUNC uint size();
45 DYN_FUNC uint count(MKey key);
46
47 DYN_FUNC inline T& operator[] (MKey key);
48 DYN_FUNC inline const T& operator[] (MKey key) const;
49
50 DYN_FUNC iterator insert(Pair<MKey, T> pair);
51 DYN_FUNC bool empty();
52
53 private:
55
58 };
59
60}
61
62#include "MultiMap.inl"
63
64#endif // MultiSet_H
DYN_FUNC void clear()
Definition MultiMap.inl:70
DYN_FUNC uint count(MKey key)
Definition MultiMap.inl:82
Pair< MKey, T > * m_startLoc
Definition MultiMap.h:56
DYN_FUNC iterator end()
Definition MultiMap.h:38
DYN_FUNC MultiMap()
Definition MultiMap.inl:9
DYN_FUNC void reserve(Pair< MKey, T > *buf, int maxSize)
Definition MultiMap.h:27
DYN_FUNC T & operator[](MKey key)
Definition MultiMap.inl:46
DYN_FUNC iterator find(MKey key)
Definition MultiMap.inl:14
DYN_FUNC uint size()
Definition MultiMap.inl:76
Pair< MKey, T > * iterator
Definition MultiMap.h:23
DYN_FUNC bool empty()
Definition MultiMap.inl:98
DYN_FUNC iterator begin()
Definition MultiMap.h:34
DYN_FUNC iterator insert(Pair< MKey, T > pair)
Definition MultiMap.inl:22
#define T(t)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
unsigned int uint
Definition VkProgram.h:14