22 #ifndef NLSR_SYNC_PROTOCOL_ADAPTER_HPP 23 #define NLSR_SYNC_PROTOCOL_ADAPTER_HPP 27 #include <ndn-cxx/face.hpp> 28 #include <ChronoSync/logic.hpp> 29 #include <PSync/full-producer.hpp> 33 typedef std::function<void(
const ndn::Name& updateName,
41 const ndn::Name& syncPrefix,
42 const ndn::Name& userPrefix,
43 ndn::time::milliseconds syncInterestLifetime,
44 const SyncUpdateCallback& syncUpdateCallback);
74 onChronoSyncUpdate(
const std::vector<chronosync::MissingDataInfo>& updates);
85 onPSyncUpdate(
const std::vector<psync::MissingDataInfo>& updates);
88 int32_t m_syncProtocol;
89 SyncUpdateCallback m_syncUpdateCallback;
90 std::shared_ptr<chronosync::Logic> m_chronoSyncLogic;
91 std::shared_ptr<psync::FullProducer> m_psyncLogic;
96 #endif // NLSR_SYNC_PROTOCOL_ADAPTER_HPP #define PUBLIC_WITH_TESTS_ELSE_PRIVATE
std::function< void(const ndn::Name &updateName, uint64_t seqNo)> SyncUpdateCallback
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
void addUserNode(const ndn::Name &userPrefix)
Add user node to ChronoSync or PSync.
SyncProtocolAdapter(ndn::Face &facePtr, int32_t syncProtocol, const ndn::Name &syncPrefix, const ndn::Name &userPrefix, ndn::time::milliseconds syncInterestLifetime, const SyncUpdateCallback &syncUpdateCallback)
void publishUpdate(const ndn::Name &userPrefix, uint64_t seq)
Publish update to ChronoSync or PSync.