#include <CCMap.h>
Public Types | |
typedef std::unordered_map< K, V > | RefMap |
typedef RefMap::iterator | iterator |
typedef RefMap::const_iterator | const_iterator |
Public Member Functions | |
iterator | begin () |
local | begin () |
const_iterator | begin () const |
local | begin () |
iterator | end () |
var | end () |
local | end () |
const_iterator | end () const |
local | end () |
const_iterator | cbegin () const |
local | cbegin () |
const_iterator | cend () const |
local | cend () |
Map () | |
Default constructor. More... | |
Map () | |
Default constructor. More... | |
Map () | |
Default constructor. More... | |
Map (ssize_t capacity) | |
Contructor with capacity. More... | |
Map ( var capacity) | |
Contructor with capacity. More... | |
Map ( local capacity) | |
Contructor with capacity. More... | |
Map (const Map< K, V > &other) | |
Copy constructor. More... | |
Map ( var K, var other) | |
Copy constructor. More... | |
Map ( local K, local other) | |
Copy constructor. More... | |
Map (Map< K, V > &&other) | |
Move constructor. More... | |
Map ( var K, var other) | |
Move constructor. More... | |
Map ( local K, local other) | |
Move constructor. More... | |
~Map () | |
Destructor It will release all objects in map. More... | |
~Map () | |
Destructor It will release all objects in map. More... | |
~Map () | |
Destructor It will release all objects in map. More... | |
void | reserve (ssize_t capacity) |
Sets capacity of the map. More... | |
var | reserve ( var capacity) |
Sets capacity of the map. More... | |
local | reserve ( local capacity) |
Sets capacity of the map. More... | |
ssize_t | bucketCount () const |
Returns the number of buckets in the Map container. More... | |
var | bucketCount () |
Returns the number of buckets in the Map container. More... | |
local | bucketCount () |
Returns the number of buckets in the Map container. More... | |
ssize_t | bucketSize (ssize_t n) const |
Returns the number of elements in bucket n. More... | |
local | bucketSize ( local n) |
Returns the number of elements in bucket n. More... | |
ssize_t | bucket (const K &k) const |
Returns the bucket number where the element with key k is located. More... | |
ssize_t | size () const |
The number of elements in the map. More... | |
bool | empty () const |
Returns a bool value indicating whether the map container is empty, i.e. More... | |
std::vector< K > | keys () const |
Returns all keys in the map. More... | |
var | keys () |
Returns all keys in the map. More... | |
local | keys () |
Returns all keys in the map. More... | |
std::vector< K > | keys (V object) const |
Returns all keys that matches the object. More... | |
local | keys ( local object) |
Returns all keys that matches the object. More... | |
const V | at (const K &key) const |
Returns a reference to the mapped value of the element with key k in the map. More... | |
V | at (const K &key) |
const_iterator | find (const K &key) const |
Searches the container for an element with 'key' as key and returns an iterator to it if found, otherwise it returns an iterator to Map<K, V>::end (the element past the end of the container). More... | |
local | find ( local key) |
Searches the container for an element with 'key' as key and returns an iterator to it if found, otherwise it returns an iterator to Map<K, V>::end (the element past the end of the container). More... | |
iterator | find (const K &key) |
var | find ( var key) |
local | find ( local key) |
void | insert (const K &key, V object) |
Inserts new elements in the map. More... | |
iterator | erase (const_iterator position) |
Removes an element with an iterator from the Map<K, V> container. More... | |
local | erase ( local position) |
Removes an element with an iterator from the Map<K, V> container. More... | |
size_t | erase (const K &k) |
Removes an element with an iterator from the Map<K, V> container. More... | |
void | erase (const std::vector< K > &keys) |
Removes some elements with a vector which contains keys in the map. More... | |
void | clear () |
All the elements in the Map<K,V> container are dropped: their reference count will be decreased, and they are removed from the container, leaving it with a size of 0. More... | |
V | getRandomObject () const |
Gets a random object in the map. More... | |
Map< K, V > & | operator= (const Map< K, V > &other) |
Copy assignment operator. More... | |
local | operator= ( local K, local other) |
Copy assignment operator. More... | |
Map< K, V > & | operator= (Map< K, V > &&other) |
Move assignment operator. More... | |
var | operator= ( var K, var other) |
Move assignment operator. More... | |
local | operator= ( local K, local other) |
Move assignment operator. More... | |
Protected Member Functions | |
void | addRefForAllObjects () |
Retains all the objects in the map. More... | |
var | addRefForAllObjects () |
Retains all the objects in the map. More... | |
local | addRefForAllObjects () |
Retains all the objects in the map. More... | |
Protected Attributes | |
RefMap | _data |
var | _data |
local | _data |
typedef RefMap::const_iterator const_iterator |
var const_iterator |
local const_iterator |
typedef RefMap::iterator iterator |
var iterator |
local iterator |
typedef std::unordered_map<K, V> RefMap |
var RefMap |
local RefMap |
|
inline |
Default constructor.
|
inline |
Default constructor.
|
inline |
Default constructor.
|
inlineexplicit |
Contructor with capacity.
|
inlineexplicit |
Contructor with capacity.
|
inline |
Copy constructor.
|
inline |
Copy constructor.
|
inline |
Move constructor.
|
inline |
Move constructor.
|
inline |
Destructor It will release all objects in map.
|
inline |
Destructor It will release all objects in map.
|
inline |
Destructor It will release all objects in map.
|
inlineprotected |
Retains all the objects in the map.
|
inlineprotected |
Retains all the objects in the map.
|
inlineprotected |
Retains all the objects in the map.
|
inline |
Returns a reference to the mapped value of the element with key k in the map.
key | Key value of the element whose mapped value is accessed. Member type K is the keys for the elements in the container. defined in Map<K, V> as an alias of its first template parameter (Key). |
|
inline |
Returns a reference to the mapped value of the element with key k in the map.
key | Key value of the element whose mapped value is accessed. Member type K is the keys for the elements in the container. defined in Map<K, V> as an alias of its first template parameter (Key). |
|
inline |
Returns a reference to the mapped value of the element with key k in the map.
key | Key value of the element whose mapped value is accessed. Member type K is the keys for the elements in the container. defined in Map<K, V> as an alias of its first template parameter (Key). |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the bucket number where the element with key k is located.
|
inline |
Returns the bucket number where the element with key k is located.
|
inline |
Returns the bucket number where the element with key k is located.
|
inline |
Returns the number of buckets in the Map container.
|
inline |
Returns the number of buckets in the Map container.
|
inline |
Returns the number of elements in bucket n.
|
inline |
Returns the number of elements in bucket n.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
All the elements in the Map<K,V> container are dropped: their reference count will be decreased, and they are removed from the container, leaving it with a size of 0.
|
inline |
All the elements in the Map<K,V> container are dropped: their reference count will be decreased, and they are removed from the container, leaving it with a size of 0.
|
inline |
All the elements in the Map<K,V> container are dropped: their reference count will be decreased, and they are removed from the container, leaving it with a size of 0.
|
inline |
Returns a bool value indicating whether the map container is empty, i.e.
whether its size is 0.
|
inline |
Returns a bool value indicating whether the map container is empty, i.e.
whether its size is 0.
|
inline |
Returns a bool value indicating whether the map container is empty, i.e.
whether its size is 0.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Removes an element with an iterator from the Map<K, V> container.
position | Iterator pointing to a single element to be removed from the Map<K, V>. Member type const_iterator is a forward iterator type. |
|
inline |
Removes an element with an iterator from the Map<K, V> container.
position | Iterator pointing to a single element to be removed from the Map<K, V>. Member type const_iterator is a forward iterator type. |
|
inline |
Removes an element with an iterator from the Map<K, V> container.
position | Iterator pointing to a single element to be removed from the Map<K, V>. Member type const_iterator is a forward iterator type. |
|
inline |
Removes an element with an iterator from the Map<K, V> container.
k | Key of the element to be erased. Member type 'K' is the type of the keys for the elements in the container, defined in Map<K, V> as an alias of its first template parameter (Key). |
|
inline |
Removes an element with an iterator from the Map<K, V> container.
k | Key of the element to be erased. Member type 'K' is the type of the keys for the elements in the container, defined in Map<K, V> as an alias of its first template parameter (Key). |
|
inline |
Removes an element with an iterator from the Map<K, V> container.
k | Key of the element to be erased. Member type 'K' is the type of the keys for the elements in the container, defined in Map<K, V> as an alias of its first template parameter (Key). |
|
inline |
Removes some elements with a vector which contains keys in the map.
keys | Keys of elements to be erased. |
|
inline |
Removes some elements with a vector which contains keys in the map.
keys | Keys of elements to be erased. |
|
inline |
Removes some elements with a vector which contains keys in the map.
keys | Keys of elements to be erased. |
|
inline |
Searches the container for an element with 'key' as key and returns an iterator to it if found, otherwise it returns an iterator to Map<K, V>::end (the element past the end of the container).
key | Key to be searched for. Member type 'K' is the type of the keys for the elements in the container, defined in Map<K, V> as an alias of its first template parameter (Key). |
|
inline |
Searches the container for an element with 'key' as key and returns an iterator to it if found, otherwise it returns an iterator to Map<K, V>::end (the element past the end of the container).
key | Key to be searched for. Member type 'K' is the type of the keys for the elements in the container, defined in Map<K, V> as an alias of its first template parameter (Key). |
|
inline |
Searches the container for an element with 'key' as key and returns an iterator to it if found, otherwise it returns an iterator to Map<K, V>::end (the element past the end of the container).
key | Key to be searched for. Member type 'K' is the type of the keys for the elements in the container, defined in Map<K, V> as an alias of its first template parameter (Key). |
|
inline |
|
inline |
|
inline |
|
inline |
Gets a random object in the map.
|
inline |
Gets a random object in the map.
|
inline |
Gets a random object in the map.
|
inline |
Inserts new elements in the map.
key | The key to be inserted. |
object | The object to be inserted. |
|
inline |
Inserts new elements in the map.
key | The key to be inserted. |
object | The object to be inserted. |
|
inline |
Inserts new elements in the map.
key | The key to be inserted. |
object | The object to be inserted. |
|
inline |
Returns all keys in the map.
|
inline |
Returns all keys in the map.
|
inline |
Returns all keys in the map.
|
inline |
Returns all keys that matches the object.
|
inline |
Returns all keys that matches the object.
|
inline |
Returns all keys that matches the object.
|
inline |
Copy assignment operator.
|
inline |
Copy assignment operator.
|
inline |
Move assignment operator.
|
inline |
Move assignment operator.
|
inline |
Sets capacity of the map.
|
inline |
Sets capacity of the map.
|
inline |
Sets capacity of the map.
|
inline |
The number of elements in the map.
|
inline |
The number of elements in the map.
|
inline |
The number of elements in the map.
|
protected |
|
protected |
|
protected |