22 #ifndef NDN_CONTROL_PARAMETERS_HPP
23 #define NDN_CONTROL_PARAMETERS_HPP
26 #include "forwarding-flags.hpp"
27 #include "encoding/wire-format.hpp"
41 : hasName_(
false), faceId_(-1), localControlFeature_(-1), origin_(-1), cost_(-1),
42 expirationPeriod_(-1.0)
49 return wireFormat.encodeControlParameters(*
this);
55 wireFormat.decodeControlParameters(*
this, input, inputLength);
61 wireDecode(&input[0], input.size(), wireFormat);
69 wireDecode(input.
buf(), input.
size(), wireFormat);
98 getFaceId()
const {
return faceId_; }
101 getUri()
const {
return uri_; }
104 getLocalControlFeature()
const {
return localControlFeature_; }
107 getOrigin()
const {
return origin_; }
110 getCost()
const {
return cost_; }
113 getForwardingFlags() {
return flags_; }
115 const ForwardingFlags&
116 getForwardingFlags()
const {
return flags_; }
119 getStrategy() {
return strategy_; }
122 getStrategy()
const {
return strategy_; }
125 getExpirationPeriod()
const {
return expirationPeriod_; }
262 int localControlFeature_;
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:111
const Name & getName() const
Get the name, if specified.
Definition: control-parameters.hpp:95
Copyright (C) 2013-2015 Regents of the University of California.
Definition: common.hpp:35
int cost
-1 for none.
Definition: control-parameters.h:49
struct ndn_Name strategy
nComponents == 0 for none.
Definition: control-parameters.h:51
ControlParameters & setLocalControlFeature(int localControlFeature)
Set the local control feature value.
Definition: control-parameters.hpp:189
A ForwardingFlags object holds the flags which specify how the forwarding daemon should forward an in...
Definition: forwarding-flags.hpp:34
ControlParameters & setForwardingFlags(const ForwardingFlags &flags)
Set the ForwardingFlags object to a copy of forwardingFlags.
Definition: control-parameters.hpp:226
int localControlFeature
-1 for none.
Definition: control-parameters.h:47
ControlParameters & setName(const Name &name)
Set the name.
Definition: control-parameters.hpp:151
struct ndn_Blob uri
A Blob whose value is a pointer to pre-allocated buffer.
Definition: control-parameters.h:45
ControlParameters & setOrigin(int origin)
Set the origin value.
Definition: control-parameters.hpp:201
ControlParameters & setStrategy(const Name &strategy)
Set the strategy to a copy of the given Name.
Definition: control-parameters.hpp:238
A ControlParameters holds a Name and other fields for a ControlParameters which is used...
Definition: control-parameters.hpp:38
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:42
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
const uint8_t * buf() const
Return a const pointer to the first byte of the immutable byte array, or 0 if the pointer is null...
Definition: blob.hpp:138
size_t size() const
Return the length of the immutable byte array.
Definition: blob.hpp:126
int faceId
-1 for none.
Definition: control-parameters.h:44
ControlParameters & setCost(int cost)
Set the cost value.
Definition: control-parameters.hpp:213
ControlParameters & setFaceId(int faceId)
Set the Face ID.
Definition: control-parameters.hpp:164
int origin
-1 for none.
Definition: control-parameters.h:48
void set(const struct ndn_ControlParameters &controlParametersStruct)
Clear this ControlParameters, and set the values by copying from controlParametersStruct.
Definition: control-parameters.cpp:51
ControlParameters & setUri(const std::string &uri)
Set the URI.
Definition: control-parameters.hpp:176
void setHasName(bool hasName)
Set the flag for whether the name is specified.
Definition: control-parameters.hpp:142
An ndn_ControlParameters holds fields for a ControlParameters which is used in the command interest s...
Definition: control-parameters.h:41
struct ndn_Name name
Only used if hasName.
Definition: control-parameters.h:43
ControlParameters & setExpirationPeriod(Milliseconds expirationPeriod)
Set the expiration period.
Definition: control-parameters.hpp:251
bool getHasName() const
Check if the name is specified.
Definition: control-parameters.hpp:88
ndn_Milliseconds expirationPeriod
-1 for none.
Definition: control-parameters.h:52