Class that represents a map type (extends from std::unordered_map). More...
#include <SPL/Runtime/Type/Map.h>
|
|
| |
map () |
| |
| |
map (const std::unordered_map< K, V > &x) |
| |
| |
map (const map< K, V > &x) |
| |
| template<class InputIterator > |
| |
map (InputIterator first, InputIterator last) |
| |
| |
map (const Map &o) |
| |
| |
map (const ConstValueHandle &o) |
| |
| template<class K2 , class V2 > |
| |
map (const map< K2, V2 > &o) |
| |
| template<class K2 , class V2 , int32_t msize> |
| |
map (const bmap< K2, V2, msize > &o) |
| |
| virtual |
~map ()=default |
| |
| map< K, V > & |
add (const K &k, const V &v) |
| |
| const map< K, V > & |
operator= (const map< K, V > &o) |
| |
| const map< K, V > & |
operator= (const std::unordered_map< K, V > &o) |
| |
| bool |
operator== (const map< K, V > &o) const |
| |
| bool |
operator!= (const map< K, V > &o) const |
| |
| V & |
at (const K &k) |
| |
| const V & |
at (const K &k) const |
| |
| V & |
operator[] (const K &k) |
| |
| template<class BufferType > |
| void |
serialize (ByteBuffer< BufferType > &buf) const |
| |
| template<class BufferType > |
| void |
deserialize (ByteBuffer< BufferType > &buf) |
| |
| void |
serialize (std::ostream &ostr) const |
| |
| void |
serializeWithPrecision (std::ostream &ostr) const |
| |
| void |
deserialize (std::istream &istr, bool withSuffix=false) |
| |
| void |
deserializeWithNanAndInfs (std::istream &istr, bool withSuffix=false) |
| |
| size_t |
hashCode () const |
| |
| virtual |
~Map ()=default |
| |
| const Map & |
operator= (const Map &ov) |
| |
| virtual |
~Collection ()=default |
| |
Destructor. More...
|
| |
template<class K, class V>
class SPL::map< K, V >
Class that represents a map type (extends from std::unordered_map).
◆ map() [1/8]
template<class K , class V >
◆ map() [2/8]
template<class K , class V >
| SPL::map< K, V >::map |
( |
const std::unordered_map< K, V > & |
x |
) |
|
|
inline |
Construct from a unordered_map
- Parameters
-
◆ map() [3/8]
template<class K , class V >
Copy constructor
- Parameters
-
◆ map() [4/8]
template<class K , class V >
template<class InputIterator >
| SPL::map< K, V >::map |
( |
InputIterator |
first, |
|
|
InputIterator |
last |
|
) |
|
|
|
inline |
Construct from a sequence
- Parameters
-
| first |
begin iterator, inclusive |
| last |
end iterator, exclusive |
◆ map() [5/8]
template<class K , class V >
Construct from a reflective map
- Parameters
-
| o |
reflective map to construct from |
◆ map() [6/8]
template<class K , class V >
Construct from a value handle
- Parameters
-
| o |
value handle to construct from |
◆ map() [7/8]
template<class K , class V >
template<class K2 , class V2 >
Construct from an assignable map
- Parameters
-
◆ map() [8/8]
template<class K , class V >
template<class K2 , class V2 , int32_t msize>
Construct from an assignable bmap
- Parameters
-
◆ ~map()
template<class K , class V >
◆ add()
template<class K , class V >
| map<K,V>& SPL::map< K, V >::add |
( |
const K & |
k, |
|
|
const V & |
v |
|
) |
|
|
|
inline |
Append to list
- Parameters
-
| k |
key to be added |
| v |
value to be added |
- Returns
- *this
◆ operator=() [1/2]
template<class K , class V >
Assignment operator (from another map)
- Parameters
-
- Returns
- self
◆ operator=() [2/2]
template<class K , class V >
| const map<K,V>& SPL::map< K, V >::operator= |
( |
const std::unordered_map< K, V > & |
o |
) |
|
|
inline |
Assignment operator (from a unordered_map)
- Parameters
-
| o |
unordered_map to assign from |
- Returns
- self
◆ operator==()
template<class K , class V >
| bool SPL::map< K, V >::operator== |
( |
const map< K, V > & |
o |
) |
const |
|
inline |
Equality comparison
- Parameters
-
- Returns
- true if the contained elements are the same, false otherwise
◆ operator!=()
template<class K , class V >
| bool SPL::map< K, V >::operator!= |
( |
const map< K, V > & |
o |
) |
const |
|
inline |
Non-equality comparison
- Parameters
-
- Returns
- true if the contained elements are not the same, false otherwise
◆ at() [1/2]
template<class K , class V >
Get the element with a given key, create it if not present
- Parameters
-
- Returns
- reference to the element
- Exceptions
-
◆ at() [2/2]
template<class K , class V >
| const V& SPL::map< K, V >::at |
( |
const K & |
k |
) |
const |
|
inline |
Get the element with a given key, throw exception if not present
- Parameters
-
- Returns
- constant reference to the element
◆ operator[]()
template<class K , class V >
| V& SPL::map< K, V >::operator[] |
( |
const K & |
k |
) |
|
|
inline |
Get the element with a given key, create it if not present
- Parameters
-
- Returns
- reference to the element
◆ serialize() [1/2]
template<class K , class V >
template<class BufferType >
Serialize (binary)
- Parameters
-
◆ deserialize() [1/2]
template<class K , class V >
template<class BufferType >
Deserialize (binary)
- Parameters
-
◆ serialize() [2/2]
template<class K , class V >
| void SPL::map< K, V >::serialize |
( |
std::ostream & |
ostr |
) |
const |
|
virtual |
◆ serializeWithPrecision()
template<class K , class V >
| void SPL::map< K, V >::serializeWithPrecision |
( |
std::ostream & |
ostr |
) |
const |
|
virtual |
Serialize (character), with maximum precision for floats
- Parameters
-
Implements SPL::Collection.
◆ deserialize() [2/2]
template<class K , class V >
| void SPL::map< K, V >::deserialize |
( |
std::istream & |
istr, |
|
|
bool |
withSuffix = false |
|
) |
|
|
|
virtual |
Deserialize (character)
- Parameters
-
| istr |
input stream |
| withSuffix |
if true then consume suffix, otherwise (false) assume no suffix is present |
Implements SPL::Collection.
◆ deserializeWithNanAndInfs()
template<class K , class V >
| void SPL::map< K, V >::deserializeWithNanAndInfs |
( |
std::istream & |
istr, |
|
|
bool |
withSuffix = false |
|
) |
|
|
Deserialize with Inf and Nan (character)
- Parameters
-
| istr |
input stream |
| withSuffix |
if true then consume suffix, otherwise (false) assume no suffix is present |
◆ hashCode()
template<class K , class V >
| size_t SPL::map< K, V >::hashCode |
( |
|
) |
const |
|
inlinevirtual |
◆ equals()
template<class K , class V >
Compare with another collection
- Parameters
-
| ot |
other collection to compare to |
- Returns
- true if equal, false otherwise
Implements SPL::Collection.
◆ clone()
template<class K , class V >
Create a clone of the collection object
- Returns
- clone of the collection object
Implements SPL::Collection.
◆ assignFrom()
template<class K , class V >
Assign this collection using another collection
- Parameters
-
| ot |
other collection to assign from |
- Exceptions
-
Implements SPL::Collection.
◆ swapWith()
template<class K , class V >
Swap this collection with another collection
- Parameters
-
| ot |
other collection to swap with |
- Exceptions
-
Implements SPL::Collection.
◆ getKeyMetaType()
template<class K , class V >
Get key type
- Returns
- key type of the map
Implements SPL::Map.
◆ getValueMetaType()
template<class K , class V >
Get value type
- Returns
- value type of the map
Implements SPL::Map.
◆ getElementMetaType()
template<class K , class V >
Get element type
- Returns
- element type of this map, as a (key,value) type pair
Implements SPL::Map.
◆ createKey()
template<class K , class V >
Create a new key. The returned value handle is a wrapper for an object allocated on the heap. As a result, the caller is responsible for cleaning up the memory by calling ValueHandle::deleteValue()
- Returns
- value handle for the new key
Implements SPL::Map.
◆ createValue()
template<class K , class V >
Create a new key. The returned value handle is a wrapper for an object allocated on the heap. As a result, the caller is responsible for cleaning up the memory by calling ValueHandle::deleteValue()
- Returns
- value handle for the new value
Implements SPL::Map.
◆ createElement()
template<class K , class V >
Create a new element. The returned value handles are wrappers for objects allocated on the heap. As a result, the caller is responsible for cleaning up the memory by calling ValueHandle::deleteValue()
- Returns
- value handle for the new element (key and value)
Implements SPL::Map.
◆ getSize()
template<class K , class V >
| virtual int32_t SPL::map< K, V >::getSize |
( |
|
) |
const |
|
inlinevirtual |
Get the size of the map
- Returns
- size of the map
Implements SPL::Map.
◆ findElement() [1/2]
template<class K , class V >
Find an element in the map
- Parameters
-
| key |
value handle for the key |
- Returns
- an iterator for the element if found, the end iterator otherwise
Implements SPL::Map.
◆ findElement() [2/2]
template<class K , class V >
Find an element in the map
- Parameters
-
| key |
value handle for the key |
- Returns
- an iterator for the element if found, the end iterator otherwise
Implements SPL::Map.
◆ insertElement()
template<class K , class V >
Insert a given key value pair
- Parameters
-
| key |
value handle for the key |
| value |
value handle for the value |
Implements SPL::Map.
◆ removeElement()
template<class K , class V >
remove the element with a given key
- Parameters
-
| key |
value handle for the key |
Implements SPL::Map.
◆ removeAllElements()
template<class K , class V >
| virtual void SPL::map< K, V >::removeAllElements |
( |
|
) |
|
|
inlinevirtual |
Remove all elements
Implements SPL::Map.
◆ getBeginIterator() [1/2]
template<class K , class V >
Get a begin iterator
- Returns
- begin iterator
Implements SPL::Map.
◆ getBeginIterator() [2/2]
template<class K , class V >
Get a begin const iterator
- Returns
- begin const iterator
Implements SPL::Map.
◆ getEndIterator() [1/2]
template<class K , class V >
Get an end iterator
- Returns
- end iterator
Implements SPL::Map.
◆ getEndIterator() [2/2]
template<class K , class V >
Get an end cost iterator
- Returns
- end const iterator
Implements SPL::Map.
◆ getSerializedSize()
template<class K , class V >
| virtual size_t SPL::map< K, V >::getSerializedSize |
( |
|
) |
const |
|
inlinevirtual |
Get the size in bytes when serialized
- Returns
- size in bytes when serialized
Implements SPL::Collection.
◆ getIterManager()
template<class K , class V >
| const MapIterManager& SPL::map< K, V >::getIterManager |
( |
|
) |
const |
|
inlineprotectedvirtual |
The documentation for this class was generated from the following files: