OTX-Runtime for C++  
Map.h
1 #ifndef OpenTestSystem_Otx_Runtime_Api_DataTypes_Map_H
2 #define OpenTestSystem_Otx_Runtime_Api_DataTypes_Map_H
3 #include "Object.h"
4 #include <map>
5 #include "List.h"
6 #include <memory>
7 namespace OpenTestSystem { namespace Otx { namespace Runtime { namespace Api { namespace DataTypes {
11  class API_EXPORTS Map : public Object
12  {
13  protected:
14  std::map<std::shared_ptr<Object>, std::shared_ptr<Object>> _internalMap;
15  bool CompareKey(Object &key1, Object &key2);
16  public:
21  std::string ToLiteralString() const;
22 
28  void Put(std::shared_ptr<Object> key, std::shared_ptr<Object> value);
29 
34  void Remove(const std::shared_ptr<Object> &key);
35 
40  std::shared_ptr<List> Keys();
41 
46  std::shared_ptr<List> Values();
47 
52  bool HasKey(Object &key);
53 
58  size_t Size() const;
59 
64  std::shared_ptr<Object> &operator[] (std::shared_ptr<Object> key);
65 
70  std::shared_ptr<Object> &operator[] (long key);
71 
76  std::shared_ptr<Object> &operator[] (std::string key);
77  };
78 }
79 }}}}
80 
81 #endif
Represents OTX Map DataType.
Definition: Map.h:12
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.
std::shared_ptr< List > Keys()
Gets list of keys.
std::shared_ptr< List > Values()
Gets list of values.
bool HasKey(Object &key)
Checks if this Map has a key.
void Remove(const std::shared_ptr< Object > &key)
Removes a key and its value.
std::string ToLiteralString() const
Gets literal string.
Represents base of OTX DataTypes.
Definition: Object.h:17
Namespace containing all objects related to testing inside automotive industry