forwarding-flags-lite.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
22 #ifndef NDN_FORWARDING_FLAGS_LITE_HPP
23 #define NDN_FORWARDING_FLAGS_LITE_HPP
24 
25 #include "../c/forwarding-flags.h"
26 
27 namespace ndn {
28 
36 public:
42 
47  bool getChildInherit() const { return childInherit != 0; }
48 
53  bool getCapture() const { return capture != 0; }
54 
59  void setChildInherit(bool childInherit) { this->childInherit = childInherit ? 1 : 0; }
60 
65  void setCapture(bool capture) { this->capture = capture ? 1 : 0; }
66 
72  int
73  getNfdForwardingFlags() const;
74 
80  void
81  setNfdForwardingFlags(int nfdForwardingFlags);
82 
89  static ForwardingFlagsLite&
90  downCast(ndn_ForwardingFlags& forwardingFlags)
91  {
92  return *(ForwardingFlagsLite*)&forwardingFlags;
93  }
94 
95  static const ForwardingFlagsLite&
96  downCast(const ndn_ForwardingFlags& forwardingFlags)
97  {
98  return *(ForwardingFlagsLite*)&forwardingFlags;
99  }
100 };
101 
102 }
103 
104 #endif
bool getChildInherit() const
Get the value of the "childInherit" flag.
Definition: forwarding-flags-lite.hpp:47
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
void setChildInherit(bool childInherit)
Set the value of the "childInherit" flag.
Definition: forwarding-flags-lite.hpp:59
void setNfdForwardingFlags(int nfdForwardingFlags)
Set the flags according to the NFD forwarding flags as used in the ControlParameters of the command i...
Definition: forwarding-flags-lite.cpp:39
static ForwardingFlagsLite & downCast(ndn_ForwardingFlags &forwardingFlags)
Downcast the reference to the ndn_ForwardingFlags struct to a ForwardingFlagsLite.
Definition: forwarding-flags-lite.hpp:90
void setCapture(bool capture)
Set the value of the "capture" flag.
Definition: forwarding-flags-lite.hpp:65
Copyright (C) 2013-2016 Regents of the University of California.
Definition: forwarding-flags.h:38
bool getCapture() const
Get the value of the "capture" flag.
Definition: forwarding-flags-lite.hpp:53
ForwardingFlagsLite()
Create a ForwardingFlagsLite with "childInherit" set and all other flags cleared. ...
Definition: forwarding-flags-lite.cpp:27
int getNfdForwardingFlags() const
Get an integer with the bits set according to the NFD forwarding flags as used in the ControlParamete...
Definition: forwarding-flags-lite.cpp:33
A ForwardingFlagsLite holds the flags which specify how the forwarding daemon should forward an inter...
Definition: forwarding-flags-lite.hpp:35