nlsr::SyncProtocolAdapter Class Reference

#include <sync-protocol-adapter.hpp>

Public Member Functions

 SyncProtocolAdapter (ndn::Face &facePtr, int32_t syncProtocol, const ndn::Name &syncPrefix, const ndn::Name &userPrefix, ndn::time::milliseconds syncInterestLifetime, const SyncUpdateCallback &syncUpdateCallback)
 
void addUserNode (const ndn::Name &userPrefix)
 Add user node to ChronoSync or PSync. More...
 
void publishUpdate (const ndn::Name &userPrefix, uint64_t seq)
 Publish update to ChronoSync or PSync. More...
 

Detailed Description

Definition at line 36 of file sync-protocol-adapter.hpp.

Constructor & Destructor Documentation

nlsr::SyncProtocolAdapter::SyncProtocolAdapter ( ndn::Face &  facePtr,
int32_t  syncProtocol,
const ndn::Name &  syncPrefix,
const ndn::Name &  userPrefix,
ndn::time::milliseconds  syncInterestLifetime,
const SyncUpdateCallback syncUpdateCallback 
)

Definition at line 31 of file sync-protocol-adapter.cpp.

Member Function Documentation

void nlsr::SyncProtocolAdapter::addUserNode ( const ndn::Name &  userPrefix)

Add user node to ChronoSync or PSync.

Parameters
userPrefixthe Name under which the application will publishData

Definition at line 68 of file sync-protocol-adapter.cpp.

void nlsr::SyncProtocolAdapter::publishUpdate ( const ndn::Name &  userPrefix,
uint64_t  seq 
)

Publish update to ChronoSync or PSync.

NLSR forces sequences number on the sync protocol as it manages is its own sequence number by storing it in a file.

Parameters
userPrefixthe Name to be updated
seqthe sequence of userPrefix

Definition at line 79 of file sync-protocol-adapter.cpp.