22 #ifndef NDN_EXCLUDE_HPP
23 #define NDN_EXCLUDE_HPP
26 #include "c/interest-types.h"
55 : type_(ndn_Exclude_ANY)
62 Entry(
const uint8_t *component,
size_t componentLen)
63 : type_(ndn_Exclude_COMPONENT), component_(component, componentLen)
71 : type_(ndn_Exclude_COMPONENT), component_(component)
84 getType()
const {
return type_; }
87 getComponent()
const {
return component_; }
90 ndn_ExcludeType type_;
91 Name::Component component_;
99 size()
const {
return entries_.size(); }
107 get(
size_t i)
const {
return entries_[i]; }
119 DEPRECATED_IN_NDN_CPP
getEntry(
size_t i)
const {
return entries_[i]; }
143 entries_.push_back(
Entry());
157 entries_.push_back(
Entry(component, componentLength));
170 entries_.push_back(
Entry(component));
185 DEPRECATED_IN_NDN_CPP
addComponent(uint8_t *component,
size_t componentLength)
235 std::vector<Entry> entries_;
236 uint64_t changeCount_;
An ndn_ExcludeEntry holds an ndn_ExcludeType, and if it is a COMPONENT, it holds a pointer to the com...
Definition: interest-types.h:40
Copyright (C) 2013-2015 Regents of the University of California.
Definition: common.hpp:35
Exclude()
Create a new Exclude with no entries.
Definition: exclude.hpp:41
Exclude & appendAny()
Append a new entry of type ndn_Exclude_ANY.
Definition: exclude.hpp:141
size_t size() const
Get the number of entries.
Definition: exclude.hpp:99
Entry()
Create an Exclude::Entry of type ndn_Exclude_ANY.
Definition: exclude.hpp:54
Entry(const Name::Component &component)
Create an Exclude::Entry of type ndn_Exclude_COMPONENT.
Definition: exclude.hpp:70
An Exclude::Entry holds an ndn_ExcludeType, and if it is a COMPONENT, it holds the component value...
Definition: exclude.hpp:49
const Exclude::Entry & operator[](int i) const
The same as get(i), get the entry at the given index.
Definition: exclude.hpp:222
An Exclude holds a vector of Exclude::Entry.
Definition: exclude.hpp:36
void clear()
Clear all the entries.
Definition: exclude.hpp:194
uint64_t getChangeCount() const
Get the change count, which is incremented each time this object is changed.
Definition: exclude.hpp:232
A Name::Component holds a read-only name component value.
Definition: name.hpp:47
Exclude & appendComponent(const uint8_t *component, size_t componentLength)
Append a new entry of type ndn_Exclude_COMPONENT, copying from component of length componentLength...
Definition: exclude.hpp:155
An ndn_Exclude holds an array of ndn_ExcludeEntry.
Definition: interest-types.h:48
Entry(const uint8_t *component, size_t componentLen)
Create an Exclude::Entry of type ndn_Exclude_COMPONENT.
Definition: exclude.hpp:62
Exclude &DEPRECATED_IN_NDN_CPP addComponent(uint8_t *component, size_t componentLength)
Definition: exclude.hpp:185
size_t DEPRECATED_IN_NDN_CPP getEntryCount() const
Definition: exclude.hpp:113
bool matches(const Name::Component &component) const
Check if the component matches any of the exclude criteria.
Definition: exclude.cpp:67
Exclude &DEPRECATED_IN_NDN_CPP addAny()
Definition: exclude.hpp:179
Exclude & appendComponent(const Name::Component &component)
Append a new entry of type ndn_Exclude_COMPONENT, taking another pointer to the Blob value...
Definition: exclude.hpp:168
const Exclude::Entry &DEPRECATED_IN_NDN_CPP getEntry(size_t i) const
Definition: exclude.hpp:119
std::string toUri() const
Encode this Exclude with elements separated by "," and ndn_Exclude_ANY shown as "*".
Definition: exclude.cpp:122
void set(const struct ndn_Exclude &excludeStruct)
Clear this Exclude, and set the entries by copying from the ndn_Exclude struct.
Definition: exclude.cpp:51