20 #ifndef PSYNC_PRODUCER_BASE_HPP 21 #define PSYNC_PRODUCER_BASE_HPP 28 #include <ndn-cxx/face.hpp> 29 #include <ndn-cxx/security/key-chain.hpp> 30 #include <ndn-cxx/security/validator-config.hpp> 31 #include <ndn-cxx/util/random.hpp> 32 #include <ndn-cxx/util/scheduler.hpp> 33 #include <ndn-cxx/util/time.hpp> 35 #include <boost/bimap/bimap.hpp> 36 #include <boost/bimap/unordered_set_of.hpp> 42 namespace bm = boost::bimaps;
55 class Error :
public std::runtime_error
58 using std::runtime_error::runtime_error;
75 const ndn::Name& syncPrefix,
76 const ndn::Name& userPrefix,
77 ndn::time::milliseconds syncReplyFreshness = SYNC_REPLY_FRESHNESS,
86 ndn::optional<uint64_t>
89 auto it = m_prefixes.find(prefix);
90 if (it == m_prefixes.end()) {
108 addUserNode(
const ndn::Name& prefix);
118 removeUserNode(
const ndn::Name& prefix);
133 updateSeqNo(
const ndn::Name& prefix, uint64_t seq);
138 return m_prefixes.find(prefix) != m_prefixes.end();
150 sendApplicationNack(
const ndn::Name& name);
156 onRegisterFailed(
const ndn::Name& prefix,
const std::string& msg)
const;
168 using HashNameBiMap = bm::bimap<bm::unordered_set_of<uint32_t>,
169 bm::unordered_set_of<ndn::Name, std::hash<ndn::Name>>>;
183 ndn::random::RandomNumberEngine&
m_rng;
190 #endif // PSYNC_PRODUCER_BASE_HPP Invertible Bloom Lookup Table (Invertible Bloom Filter)
const ndn::time::milliseconds SYNC_REPLY_FRESHNESS
bool isUserNode(const ndn::Name &prefix) const
Segment Publisher to publish segmented data.
bm::bimap< bm::unordered_set_of< uint32_t >, bm::unordered_set_of< ndn::Name, std::hash< ndn::Name > >> HashNameBiMap
CompressionScheme m_ibltCompression
ndn::optional< uint64_t > getSeqNo(const ndn::Name &prefix) const
Returns the current sequence number of the given prefix.
uint32_t m_expectedNumEntries
CompressionScheme m_contentCompression
#define PSYNC_PUBLIC_WITH_TESTS_ELSE_PROTECTED
ndn::random::RandomNumberEngine & m_rng
ndn::Scheduler m_scheduler
ndn::time::milliseconds m_syncReplyFreshness
SegmentPublisher m_segmentPublisher
Base class for PartialProducer and FullProducer.
std::map< ndn::Name, uint64_t > m_prefixes