stub_analytics_plugin  1.6
Network Optix Video Analytics SDK
string_map.h
1 #pragma once
2 
3 #include <map>
4 
5 #include <nx/sdk/helpers/ref_countable.h>
6 
7 #include <nx/sdk/i_string_map.h>
8 
9 namespace nx {
10 namespace sdk {
11 
12 // TODO: Do something with O(N^2) complexity of lookup by index.
13 class StringMap: public RefCountable<IStringMap>
14 {
15  using Map = std::map<std::string, std::string>;
16 
17 public:
18  void addItem(const std::string& key, const std::string& value);
19 
20  void clear();
21 
22  virtual int count() const override;
23 
25  virtual const char* key(int i) const override;
26 
28  virtual const char* value(int i) const override;
29 
30  virtual const char* value(const char* key) const override;
31 
32 private:
33  Map m_map;
34 };
35 
36 } // namespace sdk
37 } // namespace nx
Definition: string_map.h:13
virtual const char * key(int i) const override
Definition: string_map.cpp:26
Definition: debug.cpp:12
virtual const char * value(int i) const override
Definition: string_map.cpp:36
Definition: ref_countable.h:79