20 #ifndef PSYNC_PRODUCER_BASE_HPP 21 #define PSYNC_PRODUCER_BASE_HPP 29 #include <ndn-cxx/face.hpp> 30 #include <ndn-cxx/util/random.hpp> 31 #include <ndn-cxx/util/scheduler.hpp> 32 #include <ndn-cxx/util/time.hpp> 33 #include <ndn-cxx/security/key-chain.hpp> 34 #include <ndn-cxx/security/validator-config.hpp> 37 #include <unordered_set> 53 class Error :
public std::runtime_error
56 using std::runtime_error::runtime_error;
72 const ndn::Name& syncPrefix,
73 const ndn::Name& userPrefix,
74 ndn::time::milliseconds syncReplyFreshness = SYNC_REPLY_FRESHNESS,
75 ndn::time::milliseconds helloReplyFreshness = HELLO_REPLY_FRESHNESS);
82 ndn::optional<uint64_t>
85 auto it = m_prefixes.find(prefix);
86 if (it == m_prefixes.end()) {
104 addUserNode(
const ndn::Name& prefix);
114 removeUserNode(
const ndn::Name& prefix);
129 updateSeqNo(
const ndn::Name& prefix, uint64_t seq);
133 if (m_prefixes.find(prefix) == m_prefixes.end()) {
148 sendApplicationNack(
const ndn::Name& name);
157 onRegisterFailed(
const ndn::Name& prefix,
const std::string& msg)
const;
186 ndn::random::RandomNumberEngine&
m_rng;
191 #endif // PSYNC_PRODUCER_BASE_HPP
const ndn::time::milliseconds HELLO_REPLY_FRESHNESS
const ndn::time::milliseconds SYNC_REPLY_FRESHNESS
ndn::optional< uint64_t > getSeqNo(const ndn::Name &prefix) const
Returns the current sequence number of the given prefix.
Invertible Bloom Lookup Table (Invertible Bloom Filter)
bool isUserNode(const ndn::Name &prefix)
Segment Publisher to publish segmented data.
uint32_t m_expectedNumEntries
std::map< uint32_t, ndn::Name > m_hash2prefix
#define PUBLIC_WITH_TESTS_ELSE_PROTECTED
ndn::random::RandomNumberEngine & m_rng
std::map< ndn::Name, uint32_t > m_prefix2hash
ndn::Scheduler m_scheduler
ndn::time::milliseconds m_syncReplyFreshness
SegmentPublisher m_segmentPublisher
Base class for PartialProducer and FullProducer.
ndn::time::milliseconds m_helloReplyFreshness
std::map< ndn::Name, uint64_t > m_prefixes