forwarding-flags.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
22 #ifndef NDN_FORWARDING_FLAGS_HPP
23 #define NDN_FORWARDING_FLAGS_HPP
24 
25 #include "c/forwarding-flags.h"
26 
27 namespace ndn {
28 
35 public:
40 
41  ForwardingFlags(const struct ndn_ForwardingFlags &forwardingFlagsStruct)
42  : ndn_ForwardingFlags(forwardingFlagsStruct)
43  {
44  }
45 
50  bool getActive() const { return active != 0; }
51 
56  bool getChildInherit() const { return childInherit != 0; }
57 
62  bool getAdvertise() const { return advertise != 0; }
63 
68  bool getLast() const { return last != 0; }
69 
74  bool getCapture() const { return capture != 0; }
75 
80  bool getLocal() const { return local != 0; }
81 
86  bool getTap() const { return tap != 0; }
87 
92  bool getCaptureOk() const { return captureOk != 0; }
93 
98  void setActive(bool active) { this->active = active ? 1 : 0; }
99 
104  void setChildInherit(bool childInherit) { this->childInherit = childInherit ? 1 : 0; }
105 
110  void setAdvertise(bool advertise) { this->advertise = advertise ? 1 : 0; }
111 
116  void setLast(bool last) { this->last = last ? 1 : 0; }
117 
122  void setCapture(bool capture) { this->capture = capture ? 1 : 0; }
123 
128  void setLocal(bool local) { this->local = local ? 1 : 0; }
129 
134  void setTap(bool tap) { this->tap = tap ? 1 : 0; }
135 
140  void setCaptureOk(bool captureOk) { this->captureOk = captureOk ? 1 : 0; }
141 };
142 
143 }
144 
145 #endif
bool getTap() const
Get the value of the "tap" flag.
Definition: forwarding-flags.hpp:86
Copyright (C) 2013-2015 Regents of the University of California.
Definition: common.hpp:35
void setActive(bool active)
Set the value of the "active" flag.
Definition: forwarding-flags.hpp:98
void setChildInherit(bool childInherit)
Set the value of the "childInherit" flag.
Definition: forwarding-flags.hpp:104
void setLast(bool last)
Set the value of the "last" flag.
Definition: forwarding-flags.hpp:116
A ForwardingFlags object holds the flags which specify how the forwarding daemon should forward an in...
Definition: forwarding-flags.hpp:34
bool getActive() const
Get the value of the "active" flag.
Definition: forwarding-flags.hpp:50
bool getCapture() const
Get the value of the "capture" flag.
Definition: forwarding-flags.hpp:74
bool getLocal() const
Get the value of the "local" flag.
Definition: forwarding-flags.hpp:80
Copyright (C) 2013-2015 Regents of the University of California.
Definition: forwarding-flags.h:38
void setLocal(bool local)
Set the value of the "local" flag.
Definition: forwarding-flags.hpp:128
int active
1 if the flag is set, 0 if cleared.
Definition: forwarding-flags.h:39
void setCapture(bool capture)
Set the value of the "capture" flag.
Definition: forwarding-flags.hpp:122
bool getLast() const
Get the value of the "last" flag.
Definition: forwarding-flags.hpp:68
bool getChildInherit() const
Get the value of the "childInherit" flag.
Definition: forwarding-flags.hpp:56
void setCaptureOk(bool captureOk)
Set the value of the "captureOk" flag.
Definition: forwarding-flags.hpp:140
bool getAdvertise() const
Get the value of the "advertise" flag.
Definition: forwarding-flags.hpp:62
void setTap(bool tap)
Set the value of the "tap" flag.
Definition: forwarding-flags.hpp:134
bool getCaptureOk() const
Get the value of the "captureOk" flag.
Definition: forwarding-flags.hpp:92
ForwardingFlags()
Create a new ForwardingFlags with "active" and "childInherit" set and all other flags cleared...
Definition: forwarding-flags.cpp:27
void setAdvertise(bool advertise)
Set the value of the "advertise" flag.
Definition: forwarding-flags.hpp:110