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-2023 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::nfd {
36 
42 {
43 public:
44  using tlv::Error::Error;
45 };
46 
53 {
54 public:
60  Name
61  getDatasetPrefix(const Name& prefix) const;
62 
63 #ifdef DOXYGEN
71  ResultType
72  parseResult(ConstBufferPtr payload) const;
73 #endif
74 
75 protected:
80  explicit
82  : m_datasetName(std::move(datasetName))
83  {
84  }
85 
86  ~StatusDatasetBase() = default;
87 
88 protected:
90 };
91 
98 {
99 public:
101 
103  parseResult(ConstBufferPtr payload) const;
104 };
105 
112 {
113 public:
114  FaceDataset();
115 
116  std::vector<FaceStatus>
117  parseResult(ConstBufferPtr payload) const;
118 };
119 
126 {
127 public:
128  explicit
129  FaceQueryDataset(const FaceQueryFilter& filter);
130 
131  Name
132  getDatasetPrefix(const Name& prefix) const;
133 
134  std::vector<FaceStatus>
135  parseResult(ConstBufferPtr payload) const;
136 
137 private:
138  FaceQueryFilter m_filter;
139 };
140 
147 {
148 public:
149  ChannelDataset();
150 
151  std::vector<ChannelStatus>
152  parseResult(ConstBufferPtr payload) const;
153 };
154 
161 {
162 public:
163  FibDataset();
164 
165  std::vector<FibEntry>
166  parseResult(ConstBufferPtr payload) const;
167 };
168 
175 {
176 public:
177  CsInfoDataset();
178 
179  CsInfo
180  parseResult(ConstBufferPtr payload) const;
181 };
182 
189 {
190 public:
192 
193  std::vector<StrategyChoice>
194  parseResult(ConstBufferPtr payload) const;
195 };
196 
203 {
204 public:
205  RibDataset();
206 
207  std::vector<RibEntry>
208  parseResult(ConstBufferPtr payload) const;
209 };
210 
211 } // namespace ndn::nfd
212 
213 #endif // NDN_CXX_MGMT_NFD_STATUS_DATASET_HPP
Represents an absolute name.
Definition: name.hpp:45
Represents a faces/channels dataset.
std::vector< ChannelStatus > parseResult(ConstBufferPtr payload) const
Represents a cs/info dataset.
CsInfo parseResult(ConstBufferPtr payload) const
Represents the CS Information dataset.
Definition: cs-info.hpp:37
Represents a faces/list dataset.
std::vector< FaceStatus > parseResult(ConstBufferPtr payload) const
Represents a faces/query dataset.
std::vector< FaceStatus > parseResult(ConstBufferPtr payload) const
Name getDatasetPrefix(const Name &prefix) const
FaceQueryDataset(const FaceQueryFilter &filter)
Represents Face Query Filter.
Represents a fib/list dataset.
std::vector< FibEntry > parseResult(ConstBufferPtr payload) const
Represents a status/general dataset.
ForwarderStatus parseResult(ConstBufferPtr payload) const
Represents NFD General Status dataset.
Represents a rib/list dataset.
std::vector< RibEntry > parseResult(ConstBufferPtr payload) const
Base class of NFD StatusDataset.
StatusDatasetBase(PartialName datasetName)
Protected constructor.
ResultType parseResult(ConstBufferPtr payload) const
Parses a result from a reassembled payload.
Name getDatasetPrefix(const Name &prefix) const
Constructs a name prefix for the dataset.
Exception raised when the fetched payload cannot be parsed as a StatusDataset.
Represents a strategy-choice/list dataset.
std::vector< StrategyChoice > 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:28
Contains classes and functions related to the NFD Management protocol.
std::shared_ptr< const Buffer > ConstBufferPtr
Definition: buffer.hpp:140