nx_metadata_sdk 1.0 Metadata SDK

attribute.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 <string>
6
7 #include <nx/sdk/helpers/ref_countable.h>
8 #include <nx/sdk/i_attribute.h>
9
10 namespace nx::sdk {
11
12 class Attribute: public nx::sdk::RefCountable<IAttribute>
13 {
14 public:
15 Attribute(
16 Type type,
17 std::string name,
18 std::string value,
19 float confidence = 1.0);
20
21 Attribute(std::string name, std::string value, float confidence = 1.0);
22
23 Attribute(const nx::sdk::Ptr<const IAttribute>& attribute);
24
25 virtual Type type() const override;
26 virtual const char* name() const override;
27 virtual const char* value() const override;
28 virtual float confidence() const override;
29
30 void setValue(std::string value) { m_value = std::move(value); }
31
32 private:
33 const Type m_type;
34 const std::string m_name;
35 std::string m_value;
36 float m_confidence;
37 };
38
39 } // namespace nx::sdk
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::Attribute::name
virtual const char * name() const override
Definition: attribute.cpp:41
nx::sdk
Definition: device_agent.h:12
nx::sdk::RefCountable
Definition: ref_countable.h:83
nx::sdk::Attribute
Definition: attribute.h:12