2.2.7.5 omap


Contents

Name

omap

Remark

The OriginC omap class is a sorted associative container that contains key-value pairs with unique keys. Key and value must each be a numeric simple type or string. For floating keys or values (double / float), NANUM, NaN, and Inf are rejected. Set/Get/Contains/Erase return FALSE for those keys.

Hierarchy

Examples

EX1

void map_ex()
{
	omap<int, string> m1;
	m1.Set(100, "Hello");
	m1.Set(200, "World");
	string str;
	if (m1.Get(200, str))
		printf("Found value at 200: %s\r\n", str);
}

Header to Include

Reference

Members

Name Brief Example
Contains Check whether a key is in the map Examples
Erase Remove the specified key from the map Examples
Get Get value by key Examples
GetKeys Get all keys Examples
GetSize Return the size of the map Examples
GetValues Get all values Examples
omap Default constructor Examples
RemoveAll Remove all keys and values from the map Examples
Set Set value by key Examples