ECSTASY
All in the name
Loading...
Searching...
No Matches
UserProfile.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_INTEGRATIONS_USER_ACTION_USERPROFILE_HPP_
13#define ECSTASY_INTEGRATIONS_USER_ACTION_USERPROFILE_HPP_
14
15#include <toml++/toml.h>
16
17#include "ActionBindings.hpp"
18
20{
28 public:
30 using Id = size_t;
31
33 static constexpr Id All = static_cast<Id>(-1);
34
43 UserProfile(Id id = 0) noexcept : _id(id)
44 {
45 }
46
55 [[nodiscard]] constexpr ActionBindings &getActionBindings() noexcept
56 {
57 return _actionBindings;
58 }
59
68 [[nodiscard]] constexpr const ActionBindings &getActionBindings() const noexcept
69 {
70 return _actionBindings;
71 }
72
83 [[nodiscard]] constexpr Id getId() const noexcept
84 {
85 return _id;
86 }
87
96 constexpr void setId(Id id) noexcept
97 {
98 _id = id;
99 }
100
109 [[nodiscard]] toml::table dump() const noexcept;
110
123 bool load(const toml::table &infos) noexcept;
124
125 private:
126 // User identifier
128 // User action bindings
130 };
131} // namespace ecstasy::integration::user_action
132
133#endif /* !ECSTASY_INTEGRATIONS_USER_ACTION_USERPROFILE_HPP_ */
Wrapper of a std::vector of ActionBinding.
Represent an application user profile, allowing to configure basic informations like the action bindi...
UserProfile(Id id=0) noexcept
Construct a new user profile with an associated id.
constexpr const ActionBindings & getActionBindings() const noexcept
Get the Action Bindings.
constexpr Id getId() const noexcept
Get the Id of the profile.
constexpr ActionBindings & getActionBindings() noexcept
Get the Action Bindings.
static constexpr Id All
Constant id matching any user ID.
toml::table dump() const noexcept
Dump the user profile informations as a toml table.
constexpr void setId(Id id) noexcept
Change the user ID.
bool load(const toml::table &infos) noexcept
Load a given toml table representing a user profile.
User action integration.
Definition Action.hpp:18