MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / DeSerialize

Method DeSerialize

libminifi/include/core/repository/VolatileRepository.h:345–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343
344template<typename T>
345bool VolatileRepository<T>::DeSerialize(std::vector<std::shared_ptr<core::SerializableComponent>> &store, size_t &max_size, std::function<std::shared_ptr<core::SerializableComponent>()> lambda) {
346 size_t requested_batch = max_size;
347 max_size = 0;
348 for (auto ent : value_vector_) {
349 // let the destructor do the cleanup
350 RepoValue<T> repo_value;
351
352 if (ent->getValue(repo_value)) {
353 std::shared_ptr<core::SerializableComponent> newComponent = lambda();
354 // we've taken ownership of this repo value
355 newComponent->DeSerialize(repo_value.getBuffer(), repo_value.getBufferSize());
356
357 store.push_back(newComponent);
358
359 current_size_ -= repo_value.getBufferSize();
360
361 if (max_size++ >= requested_batch) {
362 break;
363 }
364 }
365 }
366 if (max_size > 0) {
367 return true;
368 } else {
369 return false;
370 }
371}
372
373template<typename T>
374bool VolatileRepository<T>::DeSerialize(std::vector<std::shared_ptr<core::SerializableComponent>> &store, size_t &max_size) {

Callers

nothing calls this directly

Calls 6

log_debugMethod · 0.80
getValueMethod · 0.45
getBufferMethod · 0.45
getBufferSizeMethod · 0.45
loadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected