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 36 #else // HAVE_STL_HASH 38 #define phash_multimap multimap 39 #endif // HAVE_STL_HASH 41 #else // USE_STL_ALLOCATOR 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) { }
148 #else // HAVE_STL_HASH 149 #define phash_map pmap 150 #define phash_multimap pmultimap 151 #endif // HAVE_STL_HASH 153 #endif // USE_STL_ALLOCATOR This is our own Panda specialization on the default STL map.
This is our own Panda specialization on the default STL allocator.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL multimap.