22 #ifndef NDN_CXX_SECURITY_PIB_IDENTITY_CONTAINER_HPP
23 #define NDN_CXX_SECURITY_PIB_IDENTITY_CONTAINER_HPP
28 #include <unordered_map>
45 using NameSet = std::set<Name>;
48 class const_iterator :
public boost::forward_iterator_helper<const_iterator, const Identity>
56 BOOST_ASSERT(m_container !=
nullptr);
57 return m_container->
get(*m_it);
70 return lhs.equals(rhs);
76 , m_container(&container)
84 NameSet::const_iterator m_it;
96 return {m_identityNames.begin(), *
this};
114 return m_identityNames.empty();
123 return m_identityNames.size();
143 get(
const Name& identity)
const;
170 mutable std::unordered_map<Name, shared_ptr<IdentityImpl>> m_identities;
173 NameSet m_identityNames;
174 const shared_ptr<PibImpl> m_pib;
Represents an absolute name.
const_iterator & operator++()
Identity operator*() const
friend bool operator==(const const_iterator &lhs, const const_iterator &rhs) noexcept
Container of identities of a PIB.
bool empty() const noexcept
Check whether the container is empty.
size_t size() const noexcept
Return the number of identities in the container.
const_iterator begin() const noexcept
Identity get(const Name &identity) const
Return an identity by name.
const_iterator find(const Name &identity) const
const_iterator end() const noexcept
void remove(const Name &identity)
Remove identity from the container.
Identity add(const Name &identity)
Add identity into the container.
bool isConsistent() const
Check if the container is consistent with the backend storage.
void reset()
Reset the state of the container.
Frontend handle for an identity in the PIB.
Frontend to the Public Information Base.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE