22 #ifndef NDN_CXX_DETAIL_TAG_HOST_HPP
23 #define NDN_CXX_DETAIL_TAG_HOST_HPP
52 setTag(shared_ptr<T> tag)
const;
62 mutable std::map<int, shared_ptr<Tag>> m_tags;
69 static_assert(std::is_base_of<Tag, T>::value,
"T must inherit from Tag");
71 auto it = m_tags.find(T::getTypeId());
72 if (it == m_tags.end()) {
75 return static_pointer_cast<T>(it->second);
82 static_assert(std::is_base_of<Tag, T>::value,
"T must inherit from Tag");
85 m_tags.erase(T::getTypeId());
88 m_tags[T::getTypeId()] = std::move(tag);
Base class to store tag information, e.g., inside Interest and Data packets.
void removeTag() const
Remove a tag item.
shared_ptr< T > getTag() const
Get a tag item.
void setTag(shared_ptr< T > tag) const
Set (add or replace) a tag item.
Common includes and macros used throughout the library.