This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::HashMap Class

Header: #include <UnigineHashMap.h>

A hash map container template. The hash map stores items represented by key-value pairs.

HashMap Class

Members


HashMap ( ) #

Default constructor that produces an empty hash map.

HashMap ( std::initializer_list<Pair<Key,Type>> list ) #

Constructor. Creates a hash map from given key-value pairs.

Arguments

  • std::initializer_list<Pair<Key,Type>> list - List of pairs.

HashMap ( const HashMap& o ) #

Constructor. Creates a hash map by copying a source hash map.

Arguments

  • const HashMap& o - Hash map.

HashMap ( HashMap&& o ) #

Constructor. Creates a hash map by copying a source hash map.

Arguments

  • HashMap&& o - Hash map.

HashMap<Key, Type, Counter> & operator= ( const HashMap& o ) #

Assignment operator for the hash map.

Arguments

  • const HashMap& o - Hash map.

HashMap<Key, Type, Counter> & operator= ( HashMap&& o ) #

Assignment operator for the hash map.

Arguments

  • HashMap&& o - Hash map.

Iterator append ( const Key& key, const Type& value ) #

Appends an item with a given key and value to the hash map.

Arguments

  • const Key& key - Key.
  • const Type& value - Value.

Return value

Item iterator.

Iterator append ( const Key& key, Type&& value ) #

Appends an item with a given key and value to the hash map.

Arguments

  • const Key& key - Key.
  • Type&& value - Value.

Return value

Item iterator.

Iterator append ( Key&& key, const Type& value ) #

Appends an item with a given key and value to the hash map.

Arguments

  • Key&& key - Key.
  • const Type& value - Value.

Return value

Item iterator.

Iterator append ( Key&& key, Type&& value ) #

Appends an item with a given key and value to the hash map.

Arguments

  • Key&& key - Key.
  • Type&& value - Value.

Return value

Item iterator.

void append ( const HashMap& o ) #

Appends a given hash map to the current one.

Arguments

  • const HashMap& o - Hash map.

void append ( HashMap&& o ) #

Appends a given hash map to the current one.

Arguments

  • HashMap&& o - Hash map.

Iterator insert ( const Key& key, const Type& value ) #

Inserts an item with a given key and value into the hash map.

Arguments

  • const Key& key - Key.
  • const Type& value - Value.

Return value

Item iterator.

Iterator insert ( const Key& key, Type&& value ) #

Inserts an item with a given key and value into the hash map.

Arguments

  • const Key& key - Key.
  • Type&& value - Value.

Return value

Item iterator.

Iterator insert ( Key&& key, const Type& value ) #

Inserts an item with a given key and value into the hash map.

Arguments

  • Key&& key - Key.
  • const Type& value - Value.

Return value

Item iterator.

Iterator insert ( Key&& key, Type&& value ) #

Inserts an item with a given key and value into the hash map.

Arguments

  • Key&& key - Key.
  • Type&& value - Value.

Return value

Item iterator.

void insert ( const HashMap& o ) #

Inserts a given hash map into the current one.

Arguments

  • const HashMap& o - Hash map.

void insert ( HashMap&& o ) #

Inserts a given hash map into the current one.

Arguments

  • HashMap&& o - Hash map.

Type & append ( const Key& key ) #

Appends an item with a specified key to the hash map. The item value is default-constructed.

Arguments

  • const Key& key - Key.

Return value

Added item value.

Type & append ( Key&& key ) #

Appends an item with a specified key to the hash map. The item value is default-constructed.

Arguments

  • Key&& key - Key.

Return value

Added item value.

Type & insert ( const Key& key ) #

Inserts an item with a specified key into the hash map. The item value is default-constructed.

Arguments

  • const Key& key - Key.

Return value

Inserted item value.

Type & insert ( Key&& key ) #

Inserts an item with a specified key into the hash map. The item value is default-constructed.

Arguments

  • Key&& key - Key.

Return value

Inserted item value.

Type & emplace ( const Key& key, Args&& args ) #

Inserts an item with a specified key into the hash map. The new item value is constructed in-place with the given arguments avoiding unnecessary copying.

Arguments

  • const Key& key - Key.
  • Args&& args - Arguments for an item value constructor.

Return value

Inserted item value.

Type & emplace ( Key&& key, Args&& args ) #

Inserts an item with a specified key into the hash map. The new item value is constructed in-place with the given arguments avoiding unnecessary copying.

Arguments

  • Key&& key - Key.
  • Args&& args - Arguments for an item value constructor.

Return value

Inserted item value.

Type take ( const Key& key, const Type& value ) #

Removes an item with a specified key from the hash map and returns an item value. If there is no item with the specified key, a default value is returned.

Arguments

  • const Key& key - Key.
  • const Type& value - Default value.

Return value

Removed item value.

Type take ( const Key& key ) #

Removes an item with a specified key from the hash map and returns its value. If there is no item with the specified key, a default-constructed value is returned.

Arguments

  • const Key& key - Key.

Return value

Removed item value.

Type take ( const Iterator& it ) #

Removes an item from the hash map by its iterator and returns an item value. If there is no such item, a default-constructed value is returned.

Arguments

  • const Iterator& it - Item iterator.

Return value

Removed item value.

Type take ( const ConstIterator& it ) #

Removes an item from the hash map by its iterator and returns an item value. If there is no such item, a default-constructed value is returned.

Arguments

  • const ConstIterator& it - Item iterator.

Return value

Removed item value.

Type & operator[] ( const Key& key ) #

Hash map item access.

Arguments

  • const Key& key - Key.

Return value

Accessed item value.

Type & operator[] ( Key&& key ) #

Hash map item access.

Arguments

  • Key&& key - Key.

Return value

Accessed item value.

const Type & operator[] ( const Key& key ) const#

Hash map item access.

Arguments

  • const Key& key - Key.

Return value

Accessed item value.

Type & get ( Key&& key ) #

Returns a value by a specified key. If there is no item with the key, inserts a new value.

Arguments

  • Key&& key - Key.

Return value

Value.

Type & get ( const Key& key ) #

Returns a value by a specified key. If there is no item with the key, inserts a new value.

Arguments

  • const Key& key - Key.

Return value

Value.

const Type & get ( const T& key ) const#

Returns a value by a specified key.

Arguments

  • const T& key - Key.

Return value

Value.

const Type & get ( const T& key, const Type& value ) const#

Returns a value by a specified key. If there is no item with the key, the default value is returned.

Arguments

  • const T& key - Key.
  • const Type& value - Default value.

Return value

Value.

bool contains ( const T& key, const Type& value ) const#

Checks if an item with a specified key and value exists in the hash map.

Arguments

  • const T& key - Key.
  • const Type& value - Value.

Return value

Returns 1 if an item exists; otherwise, 0 is returned.

Iterator findData ( const Type& t ) #

Searches for an item with a specified value in the hash map.

Arguments

  • const Type& t - Value.

Return value

Item iterator.

ConstIterator findData ( const Type& t ) const#

Searches for an item with a specified value in the hash map.

Arguments

  • const Type& t - Value.

Return value

Item iterator.

Type value ( const T& key ) const#

Returns a value with a specified key from the hash map. If there is no such key, returns a default-constructed value.

Arguments

  • const T& key - Key.

Return value

Value.

Type value ( const T& key, const Type& def ) const#

Returns a value with a specified key from the hash map. If there is no such key, returns a default value.

Arguments

  • const T& key - Key.
  • const Type& def - Default value.

Return value

Value.

const Type & valueRef ( const T& key, const Type& def ) const#

Returns a value with a specified key from the hash map. If there is no such key, returns a default value.

Arguments

  • const T& key - Key.
  • const Type& def - Default value.

Return value

Value.

int values ( ) const#

Returns a vector of all values of the hash map.

Return value

Vector of hash map values.

void getValues ( Vector<Type>& values ) const#

Appends hash map values to a given vector.

Arguments

  • Vector<Type>& values - Vector of hash map values.

void getPairs ( Vector<Pair<Key,Type >>& pairs ) const#

Appends hash map key-value pairs to a given vector.

Arguments

  • Vector<Pair<Key,Type >>& pairs - Vector of hash map key-value pairs.

bool operator== ( const HashMap& o ) const#

Checks if two hash maps are equal. The hash maps are considered equal if their key-value pairs are the same.

Arguments

  • const HashMap& o - Hash map.

Return value

Returns 1 if hash maps are equal; otherwise, 0 is returned.

bool operator!= ( const HashMap& o ) const#

Checks if two hash maps are not equal. The hash maps are considered equal if their key-value pairs are the same.

Arguments

  • const HashMap& o - Hash map.

Return value

Returns 1 if hash maps are not equal; otherwise, 0 is returned.
Last update: 2022-03-10
Build: ()