Represents Exclude selector in NDN Interest. More...
#include <exclude.hpp>
Classes | |
class | const_iterator |
class | Error |
class | ExcludeComponent |
either a name::Component or "negative infinity" More... | |
class | Range |
represent an excluded component or range More... | |
Public Types | |
typedef std::map< ExcludeComponent, bool, std::greater< ExcludeComponent > > | ExcludeMap |
a map of exclude entries More... | |
typedef ExcludeMap::value_type | Entry |
Public Member Functions | |
Exclude () | |
Constructs an empty Exclude. More... | |
Exclude (const Block &wire) | |
Create from wire encoding. More... | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
Fast encoding or block size estimation. More... | |
const Block & | wireEncode () const |
Encode to a wire format. More... | |
void | wireDecode (const Block &wire) |
Decode from the wire format. More... | |
std::string | toUri () const |
Get escaped string representation (e.g., for use in URI) of the exclude filter. More... | |
bool | isExcluded (const name::Component &comp) const |
Check if name component is excluded. More... | |
Exclude & | excludeOne (const name::Component &comp) |
Exclude specific name component. More... | |
Exclude & | excludeRange (const name::Component &from, const name::Component &to) |
Exclude components in range [from, to]. More... | |
Exclude & | excludeBefore (const name::Component &to) |
Exclude all components in range (-Inf, to]. More... | |
Exclude & | excludeAfter (const name::Component &from) |
Exclude all components in range [from, +Inf) More... | |
bool | operator== (const Exclude &other) const |
bool | operator!= (const Exclude &other) const |
const_iterator | begin () const |
const_iterator | end () const |
bool | empty () const |
size_t | size () const |
void | clear () |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Exclude &name) |
Represents Exclude selector in NDN Interest.
Definition at line 37 of file exclude.hpp.
typedef std::map<ExcludeComponent, bool, std::greater<ExcludeComponent> > ndn::Exclude::ExcludeMap |
a map of exclude entries
Each key, except "negative infinity", is a name component that is excluded. The mapped boolean indicates whether the range between a key and the next greater key is also excluded. If true, the wire encoding shall have an ANY element.
The map is ordered in descending order to simplify isExcluded
.
Definition at line 169 of file exclude.hpp.
typedef ExcludeMap::value_type ndn::Exclude::Entry |
Definition at line 170 of file exclude.hpp.
|
default |
Constructs an empty Exclude.
Referenced by ndn::Exclude::Error::Error().
|
explicit |
size_t ndn::Exclude::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
Fast encoding or block size estimation.
Definition at line 122 of file exclude.cpp.
References ndn::tlv::Any, ndn::tlv::Exclude, ndn::NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(), and ndn::encoding::prependEmptyBlock().
Referenced by ndn::Selectors::wireEncode().
const Block & ndn::Exclude::wireEncode | ( | ) | const |
Encode to a wire format.
Definition at line 150 of file exclude.cpp.
Referenced by ndn::Exclude::Error::Error().
void ndn::Exclude::wireDecode | ( | const Block & | wire | ) |
Decode from the wire format.
Definition at line 166 of file exclude.cpp.
References ndn::tlv::Any, clear(), ndn::tlv::Exclude, ndn::Block::parse(), and ndn::Block::type().
Referenced by ndn::Exclude::Error::Error(), Exclude(), and ndn::Selectors::wireDecode().
std::string ndn::Exclude::toUri | ( | ) | const |
Get escaped string representation (e.g., for use in URI) of the exclude filter.
Definition at line 344 of file exclude.cpp.
Referenced by ndn::Exclude::Error::Error().
bool ndn::Exclude::isExcluded | ( | const name::Component & | comp | ) | const |
Check if name component is excluded.
comp | Name component to check against exclude filter |
Definition at line 228 of file exclude.cpp.
Referenced by ndn::Exclude::Error::Error(), excludeOne(), ndn::Interest::matchesData(), and ndn::Interest::matchesName().
Exclude & ndn::Exclude::excludeOne | ( | const name::Component & | comp | ) |
Exclude specific name component.
comp | component to exclude |
Definition at line 237 of file exclude.cpp.
References isExcluded().
Referenced by ndn::Exclude::Error::Error().
Exclude & ndn::Exclude::excludeRange | ( | const name::Component & | from, |
const name::Component & | to | ||
) |
Exclude components in range [from, to].
from | first element of the range |
to | last element of the range |
Error | from equals or comes after to in canonical ordering |
Definition at line 253 of file exclude.cpp.
References ndn::Exclude::ExcludeComponent::component, ndn::Exclude::Range::from, ndn::Exclude::ExcludeComponent::isNegInf, ndn::Exclude::Range::to, and ndn::name::Component::toUri().
Referenced by ndn::Exclude::Error::Error(), and excludeBefore().
Exclude & ndn::Exclude::excludeBefore | ( | const name::Component & | to | ) |
Exclude all components in range (-Inf, to].
to | last element of the range |
Definition at line 247 of file exclude.cpp.
References excludeRange().
Referenced by ndn::Exclude::Error::Error().
Exclude & ndn::Exclude::excludeAfter | ( | const name::Component & | from | ) |
Exclude all components in range [from, +Inf)
from | the first element of the range |
Definition at line 307 of file exclude.cpp.
Referenced by ndn::Exclude::Error::Error().
bool ndn::Exclude::operator== | ( | const Exclude & | other | ) | const |
Definition at line 352 of file exclude.cpp.
Referenced by ndn::Exclude::Error::Error(), ndn::Exclude::Range::operator!=(), and ndn::Exclude::const_iterator::operator!=().
|
inline |
Definition at line 328 of file exclude.hpp.
Referenced by ndn::Exclude::Error::Error().
|
inline |
Definition at line 310 of file exclude.hpp.
Referenced by size().
|
inline |
Definition at line 316 of file exclude.hpp.
Referenced by size().
|
inline |
Definition at line 322 of file exclude.hpp.
Referenced by ndn::Selectors::empty(), ndn::Interest::matchesData(), ndn::Interest::matchesName(), and ndn::operator<<().
size_t ndn::Exclude::size | ( | ) | const |
Definition at line 358 of file exclude.cpp.
void ndn::Exclude::clear | ( | ) |
Definition at line 364 of file exclude.cpp.
Referenced by wireDecode().
|
friend |
Definition at line 329 of file exclude.cpp.