22 #ifndef NDN_CONTROL_PARAMETERS_HPP
23 #define NDN_CONTROL_PARAMETERS_HPP
26 #include "forwarding-flags.hpp"
27 #include "encoding/wire-format.hpp"
28 #include "lite/control-parameters-lite.hpp"
40 : hasName_(
false), faceId_(-1), localControlFeature_(-1), origin_(-1), cost_(-1),
41 expirationPeriod_(-1.0)
48 return wireFormat.encodeControlParameters(*
this);
54 wireFormat.decodeControlParameters(*
this, input, inputLength);
60 wireDecode(&input[0], input.size(), wireFormat);
68 wireDecode(input.
buf(), input.
size(), wireFormat);
105 getFaceId()
const {
return faceId_; }
108 getUri()
const {
return uri_; }
111 getLocalControlFeature()
const {
return localControlFeature_; }
114 getOrigin()
const {
return origin_; }
117 getCost()
const {
return cost_; }
120 getForwardingFlags() {
return flags_; }
122 const ForwardingFlags&
123 getForwardingFlags()
const {
return flags_; }
126 getStrategy() {
return strategy_; }
129 getStrategy()
const {
return strategy_; }
132 getExpirationPeriod()
const {
return expirationPeriod_; }
189 localControlFeature_ = localControlFeature;
238 strategy_ = strategy;
251 expirationPeriod_ = expirationPeriod;
260 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:102
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
ControlParameters & setLocalControlFeature(int localControlFeature)
Set the local control feature value.
Definition: control-parameters.hpp:187
A ForwardingFlags object holds the flags which specify how the forwarding daemon should forward an in...
Definition: forwarding-flags.hpp:35
ControlParameters & setForwardingFlags(const ForwardingFlags &flags)
Set the ForwardingFlags object to a copy of forwardingFlags.
Definition: control-parameters.hpp:224
ControlParameters & setName(const Name &name)
Set the name.
Definition: control-parameters.hpp:149
ControlParameters & setOrigin(int origin)
Set the origin value.
Definition: control-parameters.hpp:199
ControlParameters & setStrategy(const Name &strategy)
Set the strategy to a copy of the given Name.
Definition: control-parameters.hpp:236
A ControlParameters holds a Name and other fields for a ControlParameters which is used...
Definition: control-parameters.hpp:37
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
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:159
size_t size() const
Return the length of the immutable byte array.
Definition: blob.hpp:147
A ControlParametersLite holds a Name and other fields for a ControlParameters which is used...
Definition: control-parameters-lite.hpp:37
ControlParameters & setCost(int cost)
Set the cost value.
Definition: control-parameters.hpp:211
ControlParameters & setFaceId(int faceId)
Set the Face ID.
Definition: control-parameters.hpp:162
ControlParameters & setUri(const std::string &uri)
Set the URI.
Definition: control-parameters.hpp:174
void setHasName(bool hasName)
Set the flag for whether the name is specified.
Definition: control-parameters.hpp:140
ControlParameters & setExpirationPeriod(Milliseconds expirationPeriod)
Set the expiration period.
Definition: control-parameters.hpp:249
void set(const ControlParametersLite &controlParametersLite)
Clear this ControlParameters, and set the values by copying from controlParametersLite.
Definition: control-parameters.cpp:49
bool getHasName() const
Check if the name is specified.
Definition: control-parameters.hpp:95