22 #ifndef NDN_DELEGATION_SET_HPP
23 #define NDN_DELEGATION_SET_HPP
26 #include "lite/delegation-set-lite.hpp"
53 : delegations_(delegationSet.delegations_)
68 : preference_(preference), name_(name)
127 add(
int preference,
const Name& name);
140 delegations_.push_back(delegation);
149 remove(
const Name& name);
162 size()
const {
return delegations_.size(); }
191 return wireFormat.encodeDelegationSet(*
this);
203 (
const uint8_t *input,
size_t inputLength,
206 wireFormat.decodeDelegationSet(*
this, input, inputLength);
218 wireDecode(&input[0], input.size(), wireFormat);
236 std::vector<ptr_lib::shared_ptr<Delegation> > delegations_;
void add(int preference, const Name &name)
Add a new DelegationSet::Delegation to the list of delegations, sorted by preference number then by n...
Definition: delegation-set.cpp:55
DelegationSet()
Create a DelegationSet with an empty list of delegations.
Definition: delegation-set.hpp:43
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
void wireDecode(const std::vector< uint8_t > &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Decode the input using a particular wire format and update this DelegationSet.
Definition: delegation-set.hpp:216
DelegationSet(const DelegationSet &delegationSet)
Create a DelegationSet, copying values from the other DelegationSet.
Definition: delegation-set.hpp:51
Delegation(int preference, const Name &name)
Create a new DelegationSet::Delegation with the given values.
Definition: delegation-set.hpp:67
void clear()
Clear the list of delegations.
Definition: delegation-set.hpp:155
int find(const Name &name) const
Find the first delegation with the given name and return its index.
Definition: delegation-set.cpp:97
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A DelegationSet holds a list of DelegationSet::Delegation entries which is used as the content of a L...
Definition: delegation-set.hpp:38
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
const Name & getName() const
Get the delegation name.
Definition: delegation-set.hpp:90
A DelegationSet::Delegation holds a preference number and delegation name.
Definition: delegation-set.hpp:60
const uint8_t * buf() const
Return a const pointer to the first byte of the immutable byte array, or 0 if the pointer is null...
Definition: blob.hpp:159
size_t size() const
Return the length of the immutable byte array.
Definition: blob.hpp:147
int compare(const Delegation &other)
Compare this Delegation with other according to the ordering, based first on the preference number...
Definition: delegation-set.cpp:37
int getPreference() const
Get the preference number.
Definition: delegation-set.hpp:83
size_t size() const
Get the number of delegation entries.
Definition: delegation-set.hpp:162
Blob wireEncode(WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) const
Encode this DelegationSet for a particular wire format.
Definition: delegation-set.hpp:189
Definition: delegation-set-lite.hpp:32
void wireDecode(const uint8_t *input, size_t inputLength, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Decode the input using a particular wire format and update this DelegationSet.
Definition: delegation-set.hpp:203
void addUnsorted(const ptr_lib::shared_ptr< Delegation > &delegation)
Add the DelegationSet::Delegation to the end of the list of delegations, without sorting or updating ...
Definition: delegation-set.hpp:138