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