NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::Exclude Class Reference

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 BlockwireEncode () 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...
 
ExcludeexcludeOne (const name::Component &comp)
 Exclude specific name component. More...
 
ExcludeexcludeRange (const name::Component &from, const name::Component &to)
 Exclude components in range [from, to]. More...
 
ExcludeexcludeBefore (const name::Component &to)
 Exclude all components in range (-Inf, to]. More...
 
ExcludeexcludeAfter (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)
 

Detailed Description

Represents Exclude selector in NDN Interest.

Definition at line 38 of file exclude.hpp.

Member Typedef Documentation

◆ ExcludeMap

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 170 of file exclude.hpp.

◆ Entry

typedef ExcludeMap::value_type ndn::Exclude::Entry

Definition at line 171 of file exclude.hpp.

Constructor & Destructor Documentation

◆ Exclude() [1/2]

ndn::Exclude::Exclude ( )
default

Constructs an empty Exclude.

Referenced by ndn::Exclude::Error::Error().

◆ Exclude() [2/2]

ndn::Exclude::Exclude ( const Block wire)
explicit

Create from wire encoding.

Definition at line 100 of file exclude.cpp.

References wireDecode().

Member Function Documentation

◆ wireEncode() [1/2]

template<encoding::Tag TAG>
size_t ndn::Exclude::wireEncode ( EncodingImpl< TAG > &  encoder) const

Fast encoding or block size estimation.

Definition at line 107 of file exclude.cpp.

References ndn::tlv::Any, ndn::tlv::Exclude, and ndn::encoding::prependEmptyBlock().

Referenced by ndn::Selectors::wireEncode().

◆ wireEncode() [2/2]

const Block & ndn::Exclude::wireEncode ( ) const

Encode to a wire format.

Definition at line 139 of file exclude.cpp.

Referenced by ndn::Exclude::Error::Error().

◆ wireDecode()

void ndn::Exclude::wireDecode ( const Block wire)

◆ toUri()

std::string ndn::Exclude::toUri ( ) const

Get escaped string representation (e.g., for use in URI) of the exclude filter.

Definition at line 339 of file exclude.cpp.

Referenced by ndn::Exclude::Error::Error().

◆ isExcluded()

bool ndn::Exclude::isExcluded ( const name::Component comp) const

Check if name component is excluded.

Parameters
compName component to check against exclude filter

Definition at line 217 of file exclude.cpp.

Referenced by ndn::Exclude::Error::Error(), excludeOne(), ndn::Interest::matchesData(), and ndn::Interest::matchesName().

◆ excludeOne()

Exclude & ndn::Exclude::excludeOne ( const name::Component comp)

Exclude specific name component.

Parameters
compcomponent to exclude
Returns
*this to allow chaining

Definition at line 226 of file exclude.cpp.

References isExcluded().

Referenced by ndn::Exclude::Error::Error().

◆ excludeRange()

Exclude & ndn::Exclude::excludeRange ( const name::Component from,
const name::Component to 
)

Exclude components in range [from, to].

Parameters
fromfirst element of the range
tolast element of the range
Exceptions
Errorfrom equals or comes after to in canonical ordering
Returns
*this to allow chaining

Definition at line 242 of file exclude.cpp.

References ndn::Exclude::ExcludeComponent::component, ndn::Exclude::ExcludeComponent::ExcludeComponent(), ndn::Exclude::ExcludeComponent::isNegInf, and ndn::name::Component::toUri().

Referenced by ndn::Exclude::Error::Error(), and excludeBefore().

◆ excludeBefore()

Exclude & ndn::Exclude::excludeBefore ( const name::Component to)

Exclude all components in range (-Inf, to].

Parameters
tolast element of the range
Returns
*this to allow chaining

Definition at line 236 of file exclude.cpp.

References ndn::Exclude::ExcludeComponent::ExcludeComponent(), and excludeRange().

Referenced by ndn::Exclude::Error::Error().

◆ excludeAfter()

Exclude & ndn::Exclude::excludeAfter ( const name::Component from)

Exclude all components in range [from, +Inf)

Parameters
fromthe first element of the range
Returns
*this to allow chaining

Definition at line 296 of file exclude.cpp.

Referenced by ndn::Exclude::Error::Error().

◆ operator==()

bool ndn::Exclude::operator== ( const Exclude other) const

◆ operator!=()

bool ndn::Exclude::operator!= ( const Exclude other) const
inline

Definition at line 323 of file exclude.hpp.

Referenced by ndn::Exclude::Error::Error().

◆ begin()

Exclude::const_iterator ndn::Exclude::begin ( ) const
inline

Definition at line 305 of file exclude.hpp.

Referenced by size().

◆ end()

Exclude::const_iterator ndn::Exclude::end ( ) const
inline

Definition at line 311 of file exclude.hpp.

Referenced by size().

◆ empty()

bool ndn::Exclude::empty ( ) const
inline

◆ size()

size_t ndn::Exclude::size ( ) const

Definition at line 353 of file exclude.cpp.

References begin(), and end().

◆ clear()

void ndn::Exclude::clear ( )
Todo:
const_iterator erase(const_iterator i);

Definition at line 359 of file exclude.cpp.

Referenced by wireDecode().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Exclude name 
)
friend

Definition at line 318 of file exclude.cpp.


The documentation for this class was generated from the following files: