Commit 63d86d8d authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

data-array: add get indentifier from pointer

parent 8aec163c
......@@ -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
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment