nx_metadata_sdk 1.0 Metadata SDK

abstract_object.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 <functional>
6 #include <map>
7 #include <memory>
8 #include <vector>
9
10 #include <nx/sdk/helpers/attribute.h>
11 #include <nx/sdk/ptr.h>
12
13 #include "vector2d.h"
14
15 namespace nx {
16 namespace vms_server_plugins {
17 namespace analytics {
18 namespace stub {
19
20 using Attributes = std::vector<nx::sdk::Ptr<nx::sdk::Attribute>>;
21
22 class AbstractObject
23 {
24 public:
25 AbstractObject(const std::string& typeId, Attributes attributes);
26 virtual ~AbstractObject() = default;
27
28 Vector2D position() const;
29 Size size() const;
30 Attributes attributes() const;
31 nx::sdk::Uuid id() const;
32 std::string typeId() const;
33
34 bool inBounds() const;
35
36 virtual void update() = 0;
37
38 protected:
39 std::string m_typeId;
40 Attributes m_attributes;
41 nx::sdk::Uuid m_id;
42 Vector2D m_position;
43 Size m_size;
44 float m_speed = 0;
45 Vector2D m_trajectory;
46 };
47
48 } // namespace stub
49 } // namespace analytics
50 } // namespace vms_server_plugins
51 } // namespace nx
nx::vms_server_plugins::analytics::stub::Size
Definition: vector2d.h:10
nx::vms_server_plugins::analytics::stub::AbstractObject
Definition: abstract_object.h:22
nx::sdk::Uuid
Definition: uuid.h:22
nx
Definition: apple_utils.h:6
nx::vms_server_plugins::analytics::stub::Vector2D
Definition: vector2d.h:19