Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
Gauthier Quesnel
irritator
Commits
63d86d8d
Commit
63d86d8d
authored
Mar 29, 2020
by
Gauthier Quesnel
Browse files
data-array: add get indentifier from pointer
parent
8aec163c
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/include/irritator/core.hpp
View file @
63d86d8d
...
...
@@ -1673,7 +1673,7 @@ enum class model_id : std::uint64_t;
enum
class
dynamics_id
:
std
::
uint64_t
;
enum
class
message_id
:
std
::
uint64_t
;
enum
class
input_port_id
:
std
::
uint64_t
;
enum
struct
output_port_id
:
std
::
uint64_t
;
enum
class
output_port_id
:
std
::
uint64_t
;
enum
class
init_port_id
:
std
::
uint64_t
;
template
<
typename
T
>
...
...
@@ -1961,6 +1961,19 @@ public:
--
m_max_size
;
}
/**
* @brief Accessor to the id part of the item
*
* @return @c Identifier.
*/
Identifier
get_id
(
const
T
*
t
)
const
noexcept
{
assert
(
t
!=
nullptr
);
auto
*
ptr
=
reinterpret_cast
<
const
item
*>
(
t
);
return
ptr
->
id
;
}
/**
* @brief Accessor to the id part of the item
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment