Classes | Public Member Functions | Static Public Member Functions | List of all members
ndn::ExcludeLite Class Reference

An ExcludeLite holds an array of ExcludeLite::Entry. More...

#include <exclude-lite.hpp>

Inheritance diagram for ndn::ExcludeLite:
ndn_Exclude

Classes

class  Entry
 

Public Member Functions

 ExcludeLite (ndn_ExcludeEntry *entries, size_t maxEntries)
 Create an ExcludeLite with the entries array. More...
 
size_t size () const
 Get the number of entries. More...
 
const ExcludeLite::Entryget (size_t i) const
 Get the entry at the given index. More...
 
ndn_Error appendAny ()
 Append a new entry of type ndn_Exclude_ANY. More...
 
ndn_Error appendComponent (const uint8_t *component, size_t componentLength)
 Append a new entry of type ndn_Exclude_COMPONENT with the given component value. More...
 
ndn_Error appendComponent (const NameLite::Component &component)
 Append a new entry of type ndn_Exclude_COMPONENT with the given component value. More...
 
void clear ()
 Clear all the entries.
 
ndn_Error set (const ExcludeLite &other)
 Set this exclude object to have the values from the other exclude. More...
 

Static Public Member Functions

static ExcludeLitedownCast (ndn_Exclude &exclude)
 Downcast the reference to the ndn_Exclude struct to an ExcludeLite. More...
 
static const ExcludeLitedownCast (const ndn_Exclude &exclude)
 

Detailed Description

An ExcludeLite holds an array of ExcludeLite::Entry.

Constructor & Destructor Documentation

ndn::ExcludeLite::ExcludeLite ( ndn_ExcludeEntry entries,
size_t  maxEntries 
)

Create an ExcludeLite with the entries array.

Parameters
entriesThe pre-allocated array of ndn_ExcludeEntry. Instead of an array of ExcludeLite::Entry, this is an array of the underlying ndn_ExcludeEntry struct so that it doesn't run the default constructor unnecessarily.
maxEntriesThe number of elements in the allocated entries array.

Member Function Documentation

ndn_Error ndn::ExcludeLite::appendAny ( )

Append a new entry of type ndn_Exclude_ANY.

Returns
0 for success, or an error code if there is no more room in the entries array (nEntries is already maxEntries).
ndn_Error ndn::ExcludeLite::appendComponent ( const uint8_t *  component,
size_t  componentLength 
)

Append a new entry of type ndn_Exclude_COMPONENT with the given component value.

Parameters
componentThe bytes of the component. This does not copy the bytes.
componentLengthThe number of bytes in component.
Returns
0 for success, or an error code if there is no more room in the entries array (nEntries is already maxEntries).
ndn_Error ndn::ExcludeLite::appendComponent ( const NameLite::Component component)
inline

Append a new entry of type ndn_Exclude_COMPONENT with the given component value.

Parameters
componentA NameList::Component for the exclude value. This does not copy the bytes.
Returns
0 for success, or an error code if there is no more room in the entries array (nEntries is already maxEntries).
static ExcludeLite& ndn::ExcludeLite::downCast ( ndn_Exclude exclude)
inlinestatic

Downcast the reference to the ndn_Exclude struct to an ExcludeLite.

Parameters
excludeA reference to the ndn_Exclude struct.
Returns
The same reference as ExcludeLite.
const ExcludeLite::Entry& ndn::ExcludeLite::get ( size_t  i) const
inline

Get the entry at the given index.

Parameters
iThe index of the entry, starting from 0.
Returns
The entry at the index.
ndn_Error ndn::ExcludeLite::set ( const ExcludeLite other)

Set this exclude object to have the values from the other exclude.

Parameters
otherThe other ExcludeLite to get values from.
Returns
0 for success, or an error code if there is not enough room in this object's entries array.
size_t ndn::ExcludeLite::size ( ) const
inline

Get the number of entries.

Returns
The number of entries.

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