bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
mesh_entity.h
Go to the documentation of this file.
1#ifndef MESH_ENTITY_H
2#define MESH_ENTITY_H
3
5#include "bitrl/bitrl_types.h"
6
7#include <any>
8#include <type_traits>
9
10namespace bitrl
11{
12namespace utils
13{
14namespace geom
15{
16
21
23{
24
25 public:
29 MeshEntity();
30
34 MeshEntity(uint_t id, uint_t pid, const std::any &data);
35
39 uint_t get_id() const { return id_; }
40
44 void set_id(uint_t id) { id_ = id; }
45
49 uint_t get_pid() const { return pid_; }
50
54 void set_pid(uint_t id) { pid_ = id; }
55
59 bool has_valid_id() const { return true; }
60
64 bool is_active() const { return is_active_; }
65
69 void set_active_flag(bool f) { is_active_ = f; }
70
71 private:
73 uint_t id_;
74
76 uint_t pid_;
77
79 bool is_active_;
80
84 std::any entity_data_;
85};
86
88 : id_(bitrl::consts::INVALID_ID), pid_(bitrl::consts::INVALID_ID), is_active_(true),
89 entity_data_()
90{
91}
92
93inline MeshEntity::MeshEntity(uint_t id, uint_t pid, const std::any &data)
94 : id_(id), pid_(pid), is_active_(true), entity_data_(data)
95{
96}
97
98} // namespace geom
99} // namespace utils
100} // namespace bitrl
101#endif // MESH_ENTITY_H
Helper class that wraps non template dependent parameters and common to every mesh entity.
Definition mesh_entity.h:23
void set_active_flag(bool f)
Definition mesh_entity.h:69
uint_t get_pid() const
Returns the id of the element.
Definition mesh_entity.h:49
bool is_active() const
Definition mesh_entity.h:64
MeshEntity()
Constructor.
Definition mesh_entity.h:87
uint_t get_id() const
Returns the id of the element.
Definition mesh_entity.h:39
void set_pid(uint_t id)
Set the id of the element.
Definition mesh_entity.h:54
void set_id(uint_t id)
Set the id of the element.
Definition mesh_entity.h:44
bool has_valid_id() const
Definition mesh_entity.h:59
OutT resolve(const std::string &name, const std::map< std::string, std::any > &input)
Definition std_map_utils.h:25
Definition bitrl_consts.h:14
std::size_t uint_t
uint_t
Definition bitrl_types.h:43