Exclude Class

The Exclude class is used by Interest and holds an array of Exclude.Entry to represent the fields of an NDN Exclude selector.

[C++]:
#include <ndn-cpp/exclude.hpp>
Namespace: ndn
[Python]:Module: pyndn
[Java]:Package: net.named_data.jndn

Exclude Constructors

Exclude Constructor (default)

Create a new Exclude with no entries.

[C++]:
Exclude();
[Python]:
def __init__(self)
[JavaScript]:
var Exclude = function Exclude()
[Java]:
public Exclude()

Exclude Constructor (copy)

Create a new Exclude as a deep copy of the given exclude.

[C++]:
Exclude(
    const Exclude& exclude
);
[Python]:
def __init__(self,
    exclude  # Exclude
)
[JavaScript]:
var Exclude = function Exclude(
    exclude  // Exclude
)
[Java]:
public Exclude(
    Exclude exclude
)
Parameters:
  • exclude
    The Exclude to copy.

Exclude.appendAny Method

Append a new entry which represents any component.

[C++]:
Exclude& appendAny();
[Python]:
# Returns Exclude
def appendAny(self)
[JavaScript]:
// Returns Exclude
Exclude.prototype.appendAny = function()
[Java]:
public final Exclude appendAny()
Returns:

This exclude so that you can chain calls to append.

Exclude.appendComponent Method

Append a new entry, taking another pointer to the Name.Component.

[C++]:
Exclude& appendComponent(
    const Name::Component& component
);
[Python]:
# Returns Exclude
def appendComponent(self,
    component  # Name.Component
)
[JavaScript]:
// Returns Exclude
Exclude.prototype.appendComponent = function(
    component  // Name.Component
)
[Java]:
public final Exclude appendComponent(
    Name.Component component
)
Parameters:
  • component
    The Name.Component to append.
Returns:

This exclude so that you can chain calls to append.

Exclude.clear Method

Clear all the entries.

[C++]:
void clear();
[Python]:
def clear(self)
[JavaScript]:
Exclude.prototype.clear = function()
[Java]:
public final void clear()

Exclude.get Method

Get an Exclude.Entry by index number.

[C++]:
const Exclude::Entry& get(
    size_t i
) const;
[Python]:
# Returns Exclude.Entry
def get(self,
    i  # int
)
[Java]:
public final Exclude.Entry get(
    int i
)
Parameters:
  • i
    The index of the entry to get, starting from 0.
Returns:

The Exclude.Entry at the index.

Exclude.matches Method

Check if the component matches any of the exclude criteria.

[C++]:
bool matches(
    const Name::Component& component
) const;
[Python]:
# Returns bool
def matches(self,
    component  # Name.Component
)
[JavaScript]:
// Returns boolean
Exclude.prototype.matches = function(
    component  // Name.Component
);
[Java]:
public final boolean matches(
    Name.Component component
)
Parameters:
  • name
    The name component to check.
Returns:

True if the component matches any of the exclude criteria, otherwise false.

Exclude.size Method

Get the number of entries.

[C++]:
size_t size() const;
[Python]:
# Returns int
def size(self)
[JavaScript]:
// Returns number
Exclude.prototype.size = function()
[Java]:
public final int size()
Returns:

The number of entries.

Exclude.toUri Method

Experimental

This method is experimental. The NDN specifications don’t officially define how to show exclude entries in a URI.

Encode this Exclude with entries separated by “,” and ANY shown as “*”. For example “month5,*”.

[C++]:
std::string toUri() const;
[Python]:
# Returns str
def toUri(self)
[JavaScript]:
// Returns string
Exclude.prototype.toUri = function()
[Java]:
public final String toUri()
Returns:

The URI string.

Exclude.Entry Class

An Exclude.Entry holds a type which is ANY or COMPONENT. If the type is COMPONENT, this also holds the component value. You do not construct an Exclude.Entry directly, but use Exclude.appendAny or Exclude.appendComponent.

[C++]:
#include <ndn-cpp/exclude.hpp>
Namespace: ndn
[Python]:Module: pyndn
[Java]:Package: net.named_data.jndn

Exclude.Entry.getType Method

Get the type of this Exclude.Entry.

[C++]:
ndn_ExcludeType getType() const;
[Python]:
# Returns int
def getType(self)
[Java]:
public final Exclude.Type getType()
Returns:

The type of this entry which is ANY or COMPONENT as follows:

  • C++: ndn_Exclude_ANY or ndn_Exclude_COMPONENT
  • Python: Exclude.ANY or Exclude.COMPONENT
  • Java: Exclude.Type.ANY or Exclude.Type.COMPONENT

Exclude.Entry.getComponent Method

Get the component value for this entry (only valid if this entry has type COMPONENT).

[C++]:
const Name::Component& getComponent() const;
[Python]:
# Returns Name.Component
def getComponent(self)
[Java]:
public final Name.Component getComponent()
Returns:

The component value (only valid if this entry has type COMPONENT).