Public Member Functions | Static Public Member Functions | Friends | List of all members
ndn::ControlParametersLite Class Reference

A ControlParametersLite holds a Name and other fields for a ControlParameters which is used, for example, in the command interest to register a prefix with a forwarder. More...

#include <control-parameters-lite.hpp>

Inheritance diagram for ndn::ControlParametersLite:
ndn_ControlParameters

Public Member Functions

 ControlParametersLite (struct ndn_NameComponent *nameComponents, size_t maxNameComponents, struct ndn_NameComponent *strategyNameComponents, size_t strategyMaxNameComponents)
 Create a ControlParametersLite to use the pre-allocated nameComponents and strategyNameComponents, and with default field values. More...
 
bool getHasName () const
 Check if the name is specified. More...
 
NameLitegetName ()
 Get the name, if specified. More...
 
const NameLitegetName () const
 
int getFaceId () const
 
const BlobLitegetUri () const
 
int getLocalControlFeature () const
 
int getOrigin () const
 
int getCost () const
 
ForwardingFlagsLitegetForwardingFlags ()
 
const ForwardingFlagsLitegetForwardingFlags () const
 
NameLitegetStrategy ()
 
const NameLitegetStrategy () const
 
Milliseconds getExpirationPeriod () const
 
void setHasName (bool hasName)
 Set the flag for whether the name is specified. More...
 
ndn_Error setName (const NameLite &name)
 Set the name to have the values from the given name. More...
 
ControlParametersLitesetFaceId (int faceId)
 Set the Face ID. More...
 
ControlParametersLitesetUri (const BlobLite &uri)
 Set the URI. More...
 
ControlParametersLitesetLocalControlFeature (int localControlFeature)
 Set the local control feature value. More...
 
ControlParametersLitesetOrigin (int origin)
 Set the origin value. More...
 
ControlParametersLitesetCost (int cost)
 Set the cost value. More...
 
ControlParametersLitesetForwardingFlags (const ForwardingFlagsLite &flags)
 Set the ForwardingFlags object to a copy of forwardingFlags. More...
 
ndn_Error setStrategy (const NameLite &strategy)
 Set the strategy to a copy of the given Name. More...
 
ControlParametersLitesetExpirationPeriod (Milliseconds expirationPeriod)
 Set the expiration period. More...
 
ndn_Error set (const ControlParametersLite &other)
 Set this control parameters to have the values from the other control parameters. More...
 

Static Public Member Functions

static ControlParametersLitedownCast (ndn_ControlParameters &controlParameters)
 Downcast the reference to the ndn_ControlParameters struct to a ControlParametersLite. More...
 
static const ControlParametersLitedownCast (const ndn_ControlParameters &controlParameters)
 

Friends

class Tlv0_1_1WireFormatLite
 

Detailed Description

A ControlParametersLite holds a Name and other fields for a ControlParameters which is used, for example, in the command interest to register a prefix with a forwarder.

Constructor & Destructor Documentation

ndn::ControlParametersLite::ControlParametersLite ( struct ndn_NameComponent * nameComponents  ,
size_t  maxNameComponents,
struct ndn_NameComponent * strategyNameComponents  ,
size_t  strategyMaxNameComponents 
)

Create a ControlParametersLite to use the pre-allocated nameComponents and strategyNameComponents, and with default field values.

Parameters
nameComponentsThe pre-allocated array of ndn_NameComponent for the main name. Instead of an array of NameLite::Component, this is an array of the underlying ndn_NameComponent struct so that it doesn't run the default constructor unnecessarily.
maxNameComponentsThe number of elements in the allocated nameComponents array.
strategyNameComponentsThe pre-allocated array of ndn_NameComponent for the strategy name. Instead of an array of NameLite::Component, this is an array of the underlying ndn_NameComponent struct so that it doesn't run the default constructor unnecessarily.
strategyMaxNameComponentsThe number of elements in the allocated strategyNameComponents array.

Member Function Documentation

static ControlParametersLite& ndn::ControlParametersLite::downCast ( ndn_ControlParameters controlParameters)
inlinestatic

Downcast the reference to the ndn_ControlParameters struct to a ControlParametersLite.

Parameters
controlParametersA reference to the ndn_ControlParameters struct.
Returns
The same reference as ControlParametersLite.
bool ndn::ControlParametersLite::getHasName ( ) const
inline

Check if the name is specified.

Returns
True if the name is specified, false if not.
NameLite& ndn::ControlParametersLite::getName ( )
inline

Get the name, if specified.

Returns
The Name. This is only meaningful if getHasName() is true.
ndn_Error ndn::ControlParametersLite::set ( const ControlParametersLite other)

Set this control parameters to have the values from the other control parameters.

Parameters
otherThe other ControlParametersLite to get values from.
Returns
0 for success, or an error code if there is not enough room in this object's components array.
ControlParametersLite& ndn::ControlParametersLite::setCost ( int  cost)
inline

Set the cost value.

Parameters
costThe new cost value, or -1 for not specified.
Returns
This ControlParametersLite so that you can chain calls to update values.
ControlParametersLite& ndn::ControlParametersLite::setExpirationPeriod ( Milliseconds  expirationPeriod)
inline

Set the expiration period.

Parameters
expirationPeriodThe expiration period in milliseconds, or null for not specified.
Returns
This ControlParametersLite so that you can chain calls to update values.
ControlParametersLite& ndn::ControlParametersLite::setFaceId ( int  faceId)
inline

Set the Face ID.

Parameters
faceIdThe new face ID, or -1 for not specified.
Returns
This ControlParametersLite so that you can chain calls to update values.
ControlParametersLite& ndn::ControlParametersLite::setForwardingFlags ( const ForwardingFlagsLite flags)
inline

Set the ForwardingFlags object to a copy of forwardingFlags.

You can use getForwardingFlags() and change the existing ForwardingFlags object.

Parameters
forwardingFlagsThe new cost value, or null for not specified.
Returns
This ControlParametersLite so that you can chain calls to update values.
void ndn::ControlParametersLite::setHasName ( bool  hasName)
inline

Set the flag for whether the name is specified.

Note that setName automatically calls setHasName(true).

Parameters
hasNameTrue if the name is specified, false if not.
ControlParametersLite& ndn::ControlParametersLite::setLocalControlFeature ( int  localControlFeature)
inline

Set the local control feature value.

Parameters
localControlFeatureThe new local control feature value, or -1 for not specified.
Returns
This ControlParametersLite so that you can chain calls to update values.
ndn_Error ndn::ControlParametersLite::setName ( const NameLite name)
inline

Set the name to have the values from the given name.

This also calls setHasName(true).

Parameters
nameThe name to get values from. If the name is not specified, call setHasName(false).
Returns
0 for success, or an error code if there is not enough room in this object's name components array.
ControlParametersLite& ndn::ControlParametersLite::setOrigin ( int  origin)
inline

Set the origin value.

Parameters
originThe new origin value, or -1 for not specified.
Returns
This ControlParametersLite so that you can chain calls to update values.
ndn_Error ndn::ControlParametersLite::setStrategy ( const NameLite strategy)
inline

Set the strategy to a copy of the given Name.

Parameters
strategyThe Name to copy, or an empty Name if not specified.
Returns
0 for success, or an error code if there is not enough room in this object's name components array.
ControlParametersLite& ndn::ControlParametersLite::setUri ( const BlobLite uri)
inline

Set the URI.

Parameters
uriThe new uri, or an empty string for not specified.
Returns
This ControlParametersLite so that you can chain calls to update values.

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