22 #ifndef NDN_MGMT_NFD_CONTROLLER_HPP
23 #define NDN_MGMT_NFD_CONTROLLER_HPP
76 template<
typename Command>
83 startCommand(make_shared<Command>(), parameters, onSuccess, onFailure, options);
88 template<
typename Dataset>
89 std::enable_if_t<std::is_default_constructible<Dataset>::value>
90 fetch(
const std::function<
void(
typename Dataset::ResultType)>& onSuccess,
94 fetchDataset(make_shared<Dataset>(), onSuccess, onFailure, options);
99 template<
typename Dataset,
typename ParamType =
typename Dataset::ParamType>
102 const std::function<
void(
typename Dataset::ResultType)>& onSuccess,
106 fetchDataset(make_shared<Dataset>(param), onSuccess, onFailure, options);
111 startCommand(
const shared_ptr<ControlCommand>& command,
118 processCommandResponse(
const Data& data,
119 const shared_ptr<ControlCommand>& command,
124 processValidatedCommandResponse(
const Data& data,
125 const shared_ptr<ControlCommand>& command,
129 template<
typename Dataset>
131 fetchDataset(shared_ptr<Dataset> dataset,
132 const std::function<
void(
typename Dataset::ResultType)>& onSuccess,
137 fetchDataset(
const Name& prefix,
142 template<
typename Dataset>
144 processDatasetResponse(shared_ptr<Dataset> dataset,
145 const std::function<
void(
typename Dataset::ResultType)>& onSuccess,
150 processDatasetFetchError(
const DatasetFailCallback& onFailure, uint32_t code, std::string msg);
180 std::set<shared_ptr<util::SegmentFetcher>> m_fetchers;
183 template<
typename Dataset>
185 Controller::fetchDataset(shared_ptr<Dataset> dataset,
186 const std::function<
void(
typename Dataset::ResultType)>& onSuccess,
187 const DatasetFailCallback& onFailure,
190 Name prefix = dataset->getDatasetPrefix(options.
getPrefix());
198 template<
typename Dataset>
200 Controller::processDatasetResponse(shared_ptr<Dataset> dataset,
201 const std::function<
void(
typename Dataset::ResultType)>& onSuccess,
202 const DatasetFailCallback& onFailure,
205 typename Dataset::ResultType result;
208 result = dataset->parseResult(
std::move(payload));
210 catch (
const tlv::Error& e) {
223 #endif // NDN_MGMT_NFD_CONTROLLER_HPP