22 #ifndef NDN_DELEGATION_LIST_HPP 23 #define NDN_DELEGATION_LIST_HPP 27 #include <initializer_list> 43 using tlv::Error::Error;
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);
212 isValidTlvType(uint32_t type);
215 insertImpl(uint64_t preference,
const Name&
name);
218 eraseImpl(optional<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;
248 operator==(
const DelegationList& lhs,
const DelegationList& rhs);
253 return !(lhs == rhs);
257 operator<<(std::ostream& os,
const DelegationList& dl);
261 #endif // NDN_DELEGATION_LIST_HPP
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)
const Delegation & operator[](size_t i) const
get the i-th delegation
friend bool operator==(const DelegationList &, const DelegationList &)
compare whether two DelegationLists are equal
Represents a TLV element of NDN packet format.
Error(const std::string &what, const std::exception &innerException)
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
size_t wireEncode(EncodingImpl< TAG > &encoder, uint32_t type=tlv::ForwardingHint) const
encode into wire format
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
void sort()
sort the delegation list
bool empty() const noexcept
represents a list of Delegations
bool operator==(const Data &lhs, const Data &rhs)
multiple delegations with the same name are kept in the DelegationList
EncodingImpl< EncoderTag > EncodingBuffer
const nullopt_t nullopt((nullopt_t::init()))
represents an error in TLV encoding or decoding
EncodingImpl< EstimatorTag > EncodingEstimator
const_iterator begin() const noexcept