status-dataset.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013-2022 Regents of the University of California.
4  *
5  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6  *
7  * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License as published by the Free Software
9  * Foundation, either version 3 of the License, or (at your option) any later version.
10  *
11  * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13  * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14  *
15  * You should have received copies of the GNU General Public License and GNU Lesser
16  * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17  * <http://www.gnu.org/licenses/>.
18  *
19  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20  */
21 
22 #ifndef NDN_CXX_MGMT_NFD_STATUS_DATASET_HPP
23 #define NDN_CXX_MGMT_NFD_STATUS_DATASET_HPP
24 
25 #include "ndn-cxx/name.hpp"
34 
35 namespace ndn {
36 namespace nfd {
37 
43 class StatusDataset : noncopyable
44 {
45 public:
46  virtual
48 
49 #ifdef DOXYGEN
54  using ParamType = int;
55 #endif
56 
62  Name
63  getDatasetPrefix(const Name& prefix) const;
64 
65 #ifdef DOXYGEN
69  using ResultType = std::vector<int>;
70 #endif
71 
76  {
77  public:
78  using tlv::Error::Error;
79  };
80 
81 #ifdef DOXYGEN
88  parseResult(ConstBufferPtr payload) const;
89 #endif
90 
91 protected:
96  explicit
97  StatusDataset(const PartialName& datasetName);
98 
99 private:
104  virtual void
105  addParameters(Name& name) const;
106 
107 private:
108  PartialName m_datasetName;
109 };
110 
117 {
118 public:
120 
122 
123  ResultType
124  parseResult(ConstBufferPtr payload) const;
125 };
126 
132 {
133 public:
134  using ResultType = std::vector<FaceStatus>;
135 
136  ResultType
137  parseResult(ConstBufferPtr payload) const;
138 
139 protected:
140  explicit
141  FaceDatasetBase(const PartialName& datasetName);
142 };
143 
150 {
151 public:
152  FaceDataset();
153 };
154 
161 {
162 public:
164 
165  explicit
166  FaceQueryDataset(const FaceQueryFilter& filter);
167 
168 private:
169  void
170  addParameters(Name& name) const override;
171 
172 private:
173  FaceQueryFilter m_filter;
174 };
175 
182 {
183 public:
184  ChannelDataset();
185 
186  using ResultType = std::vector<ChannelStatus>;
187 
188  ResultType
189  parseResult(ConstBufferPtr payload) const;
190 };
191 
197 class FibDataset : public StatusDataset
198 {
199 public:
200  FibDataset();
201 
202  using ResultType = std::vector<FibEntry>;
203 
204  ResultType
205  parseResult(ConstBufferPtr payload) const;
206 };
207 
214 {
215 public:
216  CsInfoDataset();
217 
219 
220  ResultType
221  parseResult(ConstBufferPtr payload) const;
222 };
223 
230 {
231 public:
233 
234  using ResultType = std::vector<StrategyChoice>;
235 
236  ResultType
237  parseResult(ConstBufferPtr payload) const;
238 };
239 
245 class RibDataset : public StatusDataset
246 {
247 public:
248  RibDataset();
249 
250  using ResultType = std::vector<RibEntry>;
251 
252  ResultType
253  parseResult(ConstBufferPtr payload) const;
254 };
255 
256 } // namespace nfd
257 } // namespace ndn
258 
259 #endif // NDN_CXX_MGMT_NFD_STATUS_DATASET_HPP
Represents an absolute name.
Definition: name.hpp:44
Represents a faces/channels dataset.
ResultType parseResult(ConstBufferPtr payload) const
Represents a cs/info dataset.
ResultType parseResult(ConstBufferPtr payload) const
Provides common functionality among FaceDataset and FaceQueryDataset.
ResultType parseResult(ConstBufferPtr payload) const
FaceDatasetBase(const PartialName &datasetName)
Represents a faces/list dataset.
Represents a faces/query dataset.
FaceQueryDataset(const FaceQueryFilter &filter)
Represents Face Query Filter.
Represents a fib/list dataset.
ResultType parseResult(ConstBufferPtr payload) const
Represents a status/general dataset.
ResultType parseResult(ConstBufferPtr payload) const
Represents NFD General Status dataset.
Represents a rib/list dataset.
ResultType parseResult(ConstBufferPtr payload) const
Indicates reassembled payload cannot be parsed as ResultType.
Base class of NFD StatusDataset.
ResultType parseResult(ConstBufferPtr payload) const
Parses a result from reassembled payload.
int ParamType
If defined, specifies constructor argument type; otherwise, the constructor has no arguments.
std::vector< int > ResultType
Specifies the result type, usually a vector.
Name getDatasetPrefix(const Name &prefix) const
Constructs a name prefix for the dataset.
StatusDataset(const PartialName &datasetName)
Constructs a StatusDataset instance with given sub-prefix.
Represents a strategy-choice/list dataset.
ResultType parseResult(ConstBufferPtr payload) const
Represents an error in TLV encoding or decoding.
Definition: tlv.hpp:54
Error(const char *expectedType, uint32_t actualType)
Definition: tlv.cpp:27
Definition: data.cpp:25
shared_ptr< const Buffer > ConstBufferPtr
Definition: buffer.hpp:139