nx_metadata_sdk  1.0
Metadata SDK
attribute_generator.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2 
3 #pragma once
4 
5 #include <set>
6 #include <functional>
7 
8 #include "enum_type.h"
9 #include "color_type.h"
10 #include "object_type.h"
11 
12 namespace nx {
13 namespace vms_server_plugins {
14 namespace analytics {
15 namespace stub {
16 namespace modules {
17 namespace standard_taxonomy {
18 
20 {
21 public:
23  const std::map<std::string, ObjectType>* objectTypeById,
24  const std::map<std::string, EnumType>* enumTypeById,
25  const std::map<std::string, ColorType>* colorTypeById);
26 
28 
29  void registerCustomAttributeGenerator(
30  std::string attributeName,
31  std::function<std::string()> generator);
32 
33  std::map<std::string, std::string> generateAttributes(const std::string& objectTypeId) const;
34 
35 private:
36  const std::map<std::string, ObjectType>* m_objectTypeById = nullptr;
37  const std::map<std::string, EnumType>* m_enumTypeById = nullptr;
38  const std::map<std::string, ColorType>* m_colorTypeById = nullptr;
39 
40  std::map<std::string, std::function<std::string()>> m_customAttributeGenerators;
41 };
42 
43 } // namespace standard_taxonomy
44 } // namespace modules
45 } // namespace stub
46 } // namespace analytics
47 } // namespace vms_server_plugins
48 } // namespace nx
Definition: apple_utils.h:6