DayZ Enforce
Script API
Private Member Functions | List of all members
map< class TKey, class TValue > Class Reference

Associative array template
usage: More...

#include <proto.h>

Private Member Functions

proto int  Count ()
 
proto void  Clear ()
 
proto TValue  Get (TKey key)
 
proto TValue  GetElement (int c)
 
proto TKey  GetKey (int c)
 
proto void  Set (TKey key, TValue value)
 
proto void  Remove (TKey key)
 
proto bool  Contains (TKey key)
 
proto bool  Insert (TKey key, TValue value)
 
proto int  Copy (map< TKey, TValue > from)
 
bool  ReplaceKey (TKey old_key, TKey new_key)
 
void  RemoveElement (int c)
 
TKey  GetKeyByValue (TValue value)
 

Detailed Description

Associative array template
usage:

autoptr map<string, int> prg_count = new map<string, int>;
// fill
project_locations.Insert("dayz", 10);
project_locations.Insert("arma", 20);
project_locations.Insert("tkom", 1);
Print(project_locations.Get("arma")); // prints '20'

Member Function Documentation

proto int map< class TKey, class TValue >::Count ( )
private
Returns
The number of elements in the hashmap.
proto void map< class TKey, class TValue >::Clear ( )
private

Clears the hash map.

proto TValue map< class TKey, class TValue >::Get ( TKey  key )
private

Search for an element with the given key.

Parameters
_key The key of the element to find
Returns
Pointer to element data if found, NULL otherwise.
proto TValue map< class TKey, class TValue >::GetElement ( int  c )
private

Return the i:th element in the map. Note: This operation is O(n) complexity. Use with care!

Parameters
i The position of the element in the map
Returns
The element on the i:th position
proto TKey map< class TKey, class TValue >::GetKey ( int  c )
private

Return the i:th element key in the map. Note: This operation is O(n) complexity. Use with care!

Parameters
i The position of the element key in the map
Returns
Return key of i-th element
proto void map< class TKey, class TValue >::Set ( TKey  key,
TValue  value 
)
private

Sets value of element with given key. If element with key not exists, it is created. Note: creating new elements is faster using Insert function.

proto void map< class TKey, class TValue >::Remove ( TKey  key )
private

Removes element with given key.

proto bool map< class TKey, class TValue >::Contains ( TKey  key )
private

Returns if map contains element with given key.

proto bool map< class TKey, class TValue >::Insert ( TKey  key,
TValue  value 
)
private

Insert new element into hash map.

Parameters
_key Key of element to be inserted.
_data Data of element to be inserted.
proto int map< class TKey, class TValue >::Copy ( map< TKey, TValue >  from )
private
bool map< class TKey, class TValue >::ReplaceKey ( TKey  old_key,
TKey  new_key 
)
private
void map< class TKey, class TValue >::RemoveElement ( int  c )
private
TKey map< class TKey, class TValue >::GetKeyByValue ( TValue  value )
private

The documentation for this class was generated from the following file:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)