Flyby SDK v0.3.0
Loading...
Searching...
No Matches
component.h
Go to the documentation of this file.
1
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) : m_name { std::move(name) } {}
32
39 Component(std::string name, std::string uuid) : m_name { std::move(name) }, m_uuid { std::move(uuid) } {}
40
41 virtual ~Component() = default;
42
48 [[nodiscard]] std::string get_name() const {
49 return m_name;
50 }
51
57 [[nodiscard]] std::string get_uuid() const {
58 return m_uuid;
59 }
60
61 private:
67 void set_uuid(std::string uuid) {
68 m_uuid = std::move(uuid);
69 }
70
76 void set_name(std::string name) {
77 m_name = std::move(name);
78 }
79
80 std::string m_name {};
81 std::string m_uuid {};
82 };
83}
Holds the common info for all SDK components.
Definition component.h:18
Component(std::string name, std::string uuid)
The name and UUID constructor.
Definition component.h:39
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:48
std::string get_uuid() const
Gets the uuid of the component.
Definition component.h:57