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

Class to represent Exclude component in NDN interests. More...

#include <exclude.hpp>

Classes

class  Error
 

Public Types

typedef std::map< name::Component, bool, std::greater< name::Component > > exclude_type
 
typedef exclude_type::iterator iterator
 
typedef exclude_type::const_iterator const_iterator
 
typedef exclude_type::reverse_iterator reverse_iterator
 
typedef exclude_type::const_reverse_iterator const_reverse_iterator
 

Public Member Functions

 Exclude ()
 Default constructor 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 from range [from, to]. More...
 
ExcludeexcludeBefore (const name::Component &to)
 Exclude all components from range [/, to]. More...
 
ExcludeexcludeAfter (const name::Component &from)
 Exclude all components from range [from, +Inf]. More...
 
bool empty () const
 Check if exclude filter is empty. More...
 
void clear ()
 Clear the exclude filter. More...
 
bool operator== (const Exclude &other) const
 
bool operator!= (const Exclude &other) const
 
void appendExclude (const name::Component &name, bool any)
 Method to directly append exclude element. More...
 
size_t size () const
 Get number of exclude terms. More...
 
const_iterator begin () const
 Get begin iterator of the exclude terms. More...
 
const_iterator end () const
 Get end iterator of the exclude terms. More...
 
const_reverse_iterator rbegin () const
 Get begin iterator of the exclude terms. More...
 
const_reverse_iterator rend () const
 Get end iterator of the exclude terms. More...
 

Detailed Description

Class to represent Exclude component in NDN interests.

Definition at line 38 of file exclude.hpp.

Member Typedef Documentation

typedef std::map< name::Component, bool , std::greater<name::Component> > ndn::Exclude::exclude_type

Definition at line 148 of file exclude.hpp.

typedef exclude_type::iterator ndn::Exclude::iterator

Definition at line 150 of file exclude.hpp.

typedef exclude_type::const_iterator ndn::Exclude::const_iterator

Definition at line 151 of file exclude.hpp.

typedef exclude_type::reverse_iterator ndn::Exclude::reverse_iterator

Definition at line 152 of file exclude.hpp.

typedef exclude_type::const_reverse_iterator ndn::Exclude::const_reverse_iterator

Definition at line 153 of file exclude.hpp.

Constructor & Destructor Documentation

ndn::Exclude::Exclude ( )

Default constructor an empty exclude.

Definition at line 38 of file exclude.cpp.

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

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

Create from wire encoding.

Definition at line 42 of file exclude.cpp.

References wireDecode().

Member Function Documentation

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

Fast encoding or block size estimation.

Definition at line 49 of file exclude.cpp.

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

Referenced by operator==(), and ndn::Selectors::wireEncode().

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

Encode to a wire format.

Definition at line 81 of file exclude.cpp.

References ndn::Block::hasWire().

Referenced by ndn::Exclude::Error::Error(), and operator==().

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

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

Definition at line 289 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.

Parameters
compName component to check against exclude filter

Definition at line 159 of file exclude.cpp.

References end().

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.

Parameters
compcomponent to exclude
Returns
*this to allow chaining

Definition at line 172 of file exclude.cpp.

References isExcluded(), and ndn::Block::reset().

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

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

Exclude components from range [from, to].

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

Definition at line 209 of file exclude.cpp.

References end(), ndn::Block::reset(), and ndn::name::Component::toUri().

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

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

Exclude all components from range [/, to].

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

Definition at line 211 of file exclude.hpp.

References excludeRange().

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

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

Exclude all components from range [from, +Inf].

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

Definition at line 244 of file exclude.cpp.

References end(), and ndn::Block::reset().

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

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

Clear the exclude filter.

Definition at line 229 of file exclude.hpp.

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

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

Definition at line 297 of file exclude.cpp.

References empty(), and wireEncode().

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

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

Definition at line 266 of file exclude.hpp.

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

void ndn::Exclude::appendExclude ( const name::Component name,
bool  any 
)
inline

Method to directly append exclude element.

Parameters
nameexcluded name component
anyflag indicating if there is a postfix ANY component after the name

This method is used during conversion from wire format of exclude filter

If there is an error with ranges (e.g., order of components is wrong) an exception is thrown

Definition at line 217 of file exclude.hpp.

Referenced by wireDecode().

size_t ndn::Exclude::size ( ) const
inline

Get number of exclude terms.

Definition at line 236 of file exclude.hpp.

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

Get begin iterator of the exclude terms.

Definition at line 242 of file exclude.hpp.

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

Get end iterator of the exclude terms.

Definition at line 248 of file exclude.hpp.

Referenced by excludeAfter(), excludeRange(), and isExcluded().

Exclude::const_reverse_iterator ndn::Exclude::rbegin ( ) const
inline

Get begin iterator of the exclude terms.

Definition at line 254 of file exclude.hpp.

Exclude::const_reverse_iterator ndn::Exclude::rend ( ) const
inline

Get end iterator of the exclude terms.

Definition at line 260 of file exclude.hpp.


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