22 #ifndef NDN_DELEGATION_LIST_HPP 23 #define NDN_DELEGATION_LIST_HPP 26 #include <initializer_list> 43 Error(
const std::string& what);
45 Error(
const std::string& what,
const std::exception& innerException);
71 template<encoding::Tag TAG>
94 return m_dels.begin();
106 return m_dels.empty();
112 return m_dels.size();
121 BOOST_ASSERT(i <
size());
189 return this->eraseImpl(preference, name);
207 return this->eraseImpl(
nullopt, name);
212 isValidTlvType(uint32_t type);
215 insertImpl(uint64_t preference,
const Name&
name);
230 std::vector<Delegation> m_dels;
236 extern template size_t 237 DelegationList::wireEncode<encoding::EncoderTag>(
EncodingBuffer&, uint32_t)
const;
239 extern template size_t 240 DelegationList::wireEncode<encoding::EstimatorTag>(
EncodingEstimator&, uint32_t)
const;
253 return !(lhs == rhs);
261 #endif // NDN_DELEGATION_LIST_HPP constexpr nullopt_t nullopt
Copyright (c) 2011-2015 Regents of the University of California.
existing delegation(s) with the same name are replaced with the new delegation
const Delegation & at(size_t i) const
get the i-th delegation
new delegation is not inserted if an existing delegation has the same name
DelegationList()
construct an empty DelegationList
std::ostream & operator<<(std::ostream &os, const Data &data)
friend bool operator==(const DelegationList &, const DelegationList &)
compare whether two DelegationLists are equal
Represents a TLV element of NDN packet format.
std::vector< Delegation >::const_iterator const_iterator
size_t erase(uint64_t preference, const Name &name)
delete Delegation(s) with specified preference and name
size_t erase(const Name &name)
erase Delegation(s) with specified name
bool operator!=(const Data &lhs, const Data &rhs)
void wireDecode(const Block &block, bool wantSort=true)
decode a DelegationList
const_iterator end() const noexcept
bool insert(const Delegation &del, InsertConflictResolution onConflict=INS_REPLACE)
insert Delegation
bool isSorted() const noexcept
Error(const std::string &what)
size_t size() const noexcept
Represents an absolute name.
bool insert(uint64_t preference, const Name &name, InsertConflictResolution onConflict=INS_REPLACE)
insert Delegation
InsertConflictResolution
what to do when inserting a duplicate name
size_t erase(const Delegation &del)
delete Delegation(s) with matching preference and name
const Delegation & operator[](size_t i) const
get the i-th delegation
void sort()
sort the delegation list
bool empty() const noexcept
represents a list of Delegations
multiple delegations with the same name are kept in the DelegationList
EncodingImpl< EncoderTag > EncodingBuffer
size_t wireEncode(EncodingImpl< TAG > &encoder, uint32_t type=tlv::ForwardingHint) const
encode into wire format
represents an error in TLV encoding or decoding
EncodingImpl< EstimatorTag > EncodingEstimator
const_iterator begin() const noexcept