Flyby SDK v1.0.2
Loading...
Searching...
No Matches
component.h
Go to the documentation of this file.
1
8
9#pragma once
10
11#include <string>
12
13namespace flyby {
18 class Component {
19 public:
20 friend class ComponentHandler;
24 Component() = default;
25
31 explicit Component(std::string name)
32 : m_name { std::move(name) } {}
33
40 Component(std::string name, std::string uuid)
41 : m_name { std::move(name) },
42 m_uuid { std::move(uuid) } {}
43
44 virtual ~Component() = default;
45
51 [[nodiscard]] std::string get_name() const {
52 return m_name;
53 }
54
60 [[nodiscard]] std::string get_uuid() const {
61 return m_uuid;
62 }
63
64 protected:
70 void set_name(std::string name) {
71 m_name = std::move(name);
72 }
73
74 private:
80 void set_uuid(std::string uuid) {
81 m_uuid = std::move(uuid);
82 }
83
84 std::string m_name {};
85 std::string m_uuid {};
86 };
87} // namespace flyby
Holds the common info for all SDK components.
Definition component.h:18
void set_name(std::string name)
Sets the name of the component.
Definition component.h:70
Component(std::string name, std::string uuid)
The name and UUID constructor.
Definition component.h:40
Component()=default
The default constructor.
Component(std::string name)
The name constructor.
Definition component.h:31
std::string get_name() const
Gets the name of the component.
Definition component.h:51
std::string get_uuid() const
Gets the uuid of the component.
Definition component.h:60