OTX-Runtime for C++  
OpenTestSystem::Otx::Runtime::Api::DataTypes::Map Class Reference

Represents OTX Map DataType. More...

#include <Map.h>

Inheritance diagram for OpenTestSystem::Otx::Runtime::Api::DataTypes::Map:
Inheritance graph

Public Member Functions

bool HasKey (Object &key)
 Checks if this Map has a key. More...
 
std::shared_ptr< ListKeys ()
 Gets list of keys. More...
 
std::shared_ptr< Object > & operator[] (long key)
 Gets or sets value with key. More...
 
std::shared_ptr< Object > & operator[] (std::shared_ptr< Object > key)
 Gets or sets value with key. More...
 
std::shared_ptr< Object > & operator[] (std::string key)
 Gets or sets value with key. More...
 
void Put (std::shared_ptr< Object > key, std::shared_ptr< Object > value)
 Puts a key with new value. If the key already exists, the current value will be overridden. More...
 
void Remove (const std::shared_ptr< Object > &key)
 Removes a key and its value. More...
 
size_t Size () const
 Gets Map size. More...
 
std::string ToLiteralString () const
 Gets literal string. More...
 
std::shared_ptr< ListValues ()
 Gets list of values. More...
 

Detailed Description

Represents OTX Map DataType.

Member Function Documentation

◆ HasKey()

bool OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::HasKey ( Object key)

Checks if this Map has a key.

Returns
True if this Map has the key; otherwise false.

◆ Keys()

std::shared_ptr<List> OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::Keys ( )

Gets list of keys.

Returns
List of keys.

◆ operator[]() [1/3]

std::shared_ptr<Object>& OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::operator[] ( long  key)

Gets or sets value with key.

Returns
Key of value will be get or set. If key was not found, throw OutOfBoundException

◆ operator[]() [2/3]

std::shared_ptr<Object>& OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::operator[] ( std::shared_ptr< Object key)

Gets or sets value with key.

Returns
Key of value will be get or set.

◆ operator[]() [3/3]

std::shared_ptr<Object>& OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::operator[] ( std::string  key)

Gets or sets value with key.

Returns
Key of value will be get or set. If key was not found, throw OutOfBoundException

◆ Put()

void OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::Put ( std::shared_ptr< Object key,
std::shared_ptr< Object value 
)

Puts a key with new value. If the key already exists, the current value will be overridden.

Parameters
keyKey.
valueValue.

◆ Remove()

void OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::Remove ( const std::shared_ptr< Object > &  key)

Removes a key and its value.

Parameters
keyKey.

◆ Size()

size_t OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::Size ( ) const

Gets Map size.

Returns
Number of keys/values.

◆ ToLiteralString()

std::string OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::ToLiteralString ( ) const
virtual

Gets literal string.

Returns
Literal string.

Reimplemented from OpenTestSystem::Otx::Runtime::Api::DataTypes::Object.

◆ Values()

std::shared_ptr<List> OpenTestSystem::Otx::Runtime::Api::DataTypes::Map::Values ( )

Gets list of values.

Returns
List of values.

The documentation for this class was generated from the following file: