NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
nfd-face-status.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_MANAGEMENT_NFD_FACE_STATUS_HPP
23 #define NDN_MANAGEMENT_NFD_FACE_STATUS_HPP
24 
25 #include "nfd-face-traits.hpp" // include this first, to ensure it compiles on its own.
26 #include "../encoding/block.hpp"
27 #include "../util/time.hpp"
28 
29 namespace ndn {
30 namespace nfd {
31 
37 class FaceStatus : public FaceTraits<FaceStatus>
38 {
39 public:
40  FaceStatus();
41 
42  explicit
43  FaceStatus(const Block& block);
44 
47  template<encoding::Tag TAG>
48  size_t
49  wireEncode(EncodingImpl<TAG>& encoder) const;
50 
53  const Block&
54  wireEncode() const;
55 
58  void
59  wireDecode(const Block& wire);
60 
61 public: // getters & setters
62  bool
64  {
65  return m_hasExpirationPeriod;
66  }
67 
68  const time::milliseconds&
70  {
71  BOOST_ASSERT(m_hasExpirationPeriod);
72  return m_expirationPeriod;
73  }
74 
75  FaceStatus&
76  setExpirationPeriod(const time::milliseconds& expirationPeriod);
77 
78  uint64_t
80  {
81  return m_nInInterests;
82  }
83 
84  FaceStatus&
85  setNInInterests(uint64_t nInInterests);
86 
87  uint64_t
88  getNInDatas() const
89  {
90  return m_nInDatas;
91  }
92 
93  FaceStatus&
94  setNInDatas(uint64_t nInDatas);
95 
96  uint64_t
98  {
99  return m_nOutInterests;
100  }
101 
102  FaceStatus&
103  setNOutInterests(uint64_t nOutInterests);
104 
105  uint64_t
106  getNOutDatas() const
107  {
108  return m_nOutDatas;
109  }
110 
111  FaceStatus&
112  setNOutDatas(uint64_t nOutDatas);
113 
114  uint64_t
115  getNInBytes() const
116  {
117  return m_nInBytes;
118  }
119 
120  FaceStatus&
121  setNInBytes(uint64_t nInBytes);
122 
123  uint64_t
124  getNOutBytes() const
125  {
126  return m_nOutBytes;
127  }
128 
129  FaceStatus&
130  setNOutBytes(uint64_t nOutBytes);
131 
132 protected:
133  void
134  wireReset() const;
135 
136 private:
137  time::milliseconds m_expirationPeriod;
138  bool m_hasExpirationPeriod;
139  uint64_t m_nInInterests;
140  uint64_t m_nInDatas;
141  uint64_t m_nOutInterests;
142  uint64_t m_nOutDatas;
143  uint64_t m_nInBytes;
144  uint64_t m_nOutBytes;
145 
146  mutable Block m_wire;
147 };
148 
149 std::ostream&
150 operator<<(std::ostream& os, const FaceStatus& status);
151 
152 } // namespace nfd
153 } // namespace ndn
154 
155 #endif // NDN_MANAGEMENT_NFD_FACE_STATUS_HPP
void wireDecode(const Block &wire)
decode FaceStatus
Copyright (c) 2011-2015 Regents of the University of California.
FaceStatus & setNInDatas(uint64_t nInDatas)
bool hasExpirationPeriod() const
uint64_t getNInDatas() const
FaceStatus & setNOutDatas(uint64_t nOutDatas)
Class representing a wire element of NDN-TLV packet format.
Definition: block.hpp:43
FaceStatus & setNOutBytes(uint64_t nOutBytes)
FaceStatus & setNOutInterests(uint64_t nOutInterests)
FaceStatus & setNInInterests(uint64_t nInInterests)
FaceStatus & setNInBytes(uint64_t nInBytes)
uint64_t getNInInterests() const
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:38
FaceStatus & setExpirationPeriod(const time::milliseconds &expirationPeriod)
represents Face status
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
uint64_t getNOutBytes() const
uint64_t getNOutInterests() const
const time::milliseconds & getExpirationPeriod() const
uint64_t getNInBytes() const
providers getters and setters of face information fields
uint64_t getNOutDatas() const
const Block & wireEncode() const
encode FaceStatus