add remove API
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index 6b11c9a..f7bf4e7 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -295,15 +295,9 @@
}
void
-SyncLogic::addLocalNames (const string &prefix, uint32_t session, uint32_t seq)
-{
- NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix);
- SeqNo seqN(session, seq);
- DiffStatePtr diff = make_shared<DiffState>();
- diff->update(info, seqN);
- m_state.update(info, seqN);
+SyncLogic::processPendingSyncInterests(DiffStatePtr &diff) {
diff->setDigest(m_state.getDigest());
- m_log.insert(diff);
+ m_log.insert(diff);
vector<string> pis = m_syncInterestTable.fetchAll ();
stringstream ss;
@@ -315,6 +309,30 @@
}
void
+SyncLogic::addLocalNames (const string &prefix, uint32_t session, uint32_t seq)
+{
+ NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix);
+ SeqNo seqN(session, seq);
+ m_state.update(info, seqN);
+
+ DiffStatePtr diff = make_shared<DiffState>();
+ diff->update(info, seqN);
+
+ processPendingSyncInterests(diff);
+}
+
+void
+SyncLogic::remove(const string &prefix) {
+ NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix);
+ m_state.remove(info);
+
+ DiffStatePtr diff = make_shared<DiffState>();
+ diff->remove(info);
+
+ processPendingSyncInterests(diff);
+}
+
+void
SyncLogic::sendSyncInterest ()
{
ostringstream os;