27 #if !defined(USE_STL_ALLOCATOR) || defined(CPPPARSER)
31 #define pmultimap std::multimap
34 #define phash_map stdext::hash_map
35 #define phash_multimap stdext::hash_multimap
38 #define phash_multimap multimap
48 template<
class Key,
class Value,
class Compare = std::less<Key> >
49 class pmap :
public std::map<Key, Value, Compare, pallocator_single<std::pair<const Key, Value> > > {
52 typedef std::map<Key, Value, Compare, allocator> base_class;
55 pmap(
const Compare &comp,
TypeHandle type_handle = pmap_type_handle) : base_class(comp,
allocator(type_handle)) { }
58 typename base_class::mapped_type &
59 operator [] (
const typename base_class::key_type &k) {
60 TAU_PROFILE(
"pmap::operator [] (const key_type &)",
" ", TAU_USER);
61 return base_class::operator [] (k);
64 std::pair<typename base_class::iterator, bool>
65 insert(
const typename base_class::value_type &x) {
66 TAU_PROFILE(
"pmap::insert(const value_type &)",
" ", TAU_USER);
67 return base_class::insert(x);
70 typename base_class::iterator
71 insert(
typename base_class::iterator position,
72 const typename base_class::value_type &x) {
73 TAU_PROFILE(
"pmap::insert(iterator, const value_type &)",
" ", TAU_USER);
74 return base_class::insert(position, x);
78 erase(
typename base_class::iterator position) {
79 TAU_PROFILE(
"pmap::erase(iterator)",
" ", TAU_USER);
80 base_class::erase(position);
83 typename base_class::size_type
84 erase(
const typename base_class::key_type &x) {
85 TAU_PROFILE(
"pmap::erase(const key_type &)",
" ", TAU_USER);
86 return base_class::erase(x);
91 TAU_PROFILE(
"pmap::clear()",
" ", TAU_USER);
95 typename base_class::iterator
96 find(
const typename base_class::key_type &x) {
97 TAU_PROFILE(
"pmap::find(const key_type &)",
" ", TAU_USER);
98 return base_class::find(x);
101 typename base_class::const_iterator
102 find(
const typename base_class::key_type &x)
const {
103 TAU_PROFILE(
"pmap::find(const key_type &)",
" ", TAU_USER);
104 return base_class::find(x);
115 template<
class Key,
class Value,
class Compare = std::less<Key> >
116 class pmultimap :
public std::multimap<Key, Value, Compare, pallocator_single<std::pair<const Key, Value> > > {
119 pmultimap(
TypeHandle type_handle = pmap_type_handle) : std::multimap<Key, Value, Compare, allocator>(Compare(),
allocator(type_handle)) { }
120 pmultimap(
const Compare &comp,
TypeHandle type_handle = pmap_type_handle) : std::multimap<Key, Value, Compare, allocator>(comp,
allocator(type_handle)) { }
129 template<
class Key,
class Value,
class Compare = method_hash<Key, std::less<Key> > >
130 class phash_map :
public stdext::hash_map<Key, Value, Compare, pallocator_array<std::pair<const Key, Value> > > {
132 phash_map() : stdext::hash_map<Key, Value, Compare,
pallocator_array<std::pair<const Key, Value> > >() { }
133 phash_map(
const Compare &comp) : stdext::hash_map<Key, Value, Compare,
pallocator_array<std::pair<const Key, Value> > >(comp) { }
141 template<
class Key,
class Value,
class Compare = method_hash<Key, std::less<Key> > >
142 class phash_multimap :
public stdext::hash_multimap<Key, Value, Compare, pallocator_array<std::pair<const Key, Value> > > {
144 phash_multimap() : stdext::hash_multimap<Key, Value, Compare,
pallocator_array<std::pair<const Key, Value> > >() { }
145 phash_multimap(
const Compare &comp) : stdext::hash_multimap<Key, Value, Compare,
pallocator_array<std::pair<const Key, Value> > >(comp) { }
149 #define phash_map pmap
150 #define phash_multimap pmultimap
TypeHandle is the identifier used to differentiate C++ class types.
This is our own Panda specialization on the default STL allocator.
This is our own Panda specialization on the default STL map.
This is our own Panda specialization on the default STL multimap.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.