api-changes: Use ndn-cpp-dev
Change-Id: I4540e601106598d51601e59e5fe9524a9080a572
diff --git a/src/contact-storage.h b/src/contact-storage.h
index dfc06ef..da6c812 100644
--- a/src/contact-storage.h
+++ b/src/contact-storage.h
@@ -8,14 +8,15 @@
* Author: Yingdi Yu <yingdi@cs.ucla.edu>
*/
-#ifndef LINKNDN_CONTACT_STORAGE_H
-#define LINKNDN_CONTACT_STORAGE_H
+#ifndef CHRONOS_CONTACT_STORAGE_H
+#define CHRONOS_CONTACT_STORAGE_H
-#include <sqlite3.h>
#include "contact-item.h"
-#include "endorse-certificate.h"
+#include <sqlite3.h>
+namespace chronos{
+
class ContactStorage
{
@@ -25,13 +26,33 @@
ContactStorage();
~ContactStorage()
- {sqlite3_close(m_db);}
+ { sqlite3_close(m_db); }
+
+ ndn::shared_ptr<Profile>
+ getSelfProfile(const ndn::Name& identity) const;
+
+ // ndn::Block
+ // getSelfEndorseCertificate(const ndn::Name& identity);
+
+ void
+ addSelfEndorseCertificate(const EndorseCertificate& endorseCertificate, const ndn::Name& identity);
+
+ // ndn::Block
+ // getEndorseCertificate(const ndn::Name& identity);
void
- setSelfProfileEntry(const ndn::Name& identity, const std::string& profileType, const ndn::Buffer& profileValue);
+ addEndorseCertificate(const EndorseCertificate& endorseCertificate, const ndn::Name& identity);
- ndn::ptr_lib::shared_ptr<Profile>
- getSelfProfile(const ndn::Name& identity);
+ void
+ updateCollectEndorse(const EndorseCertificate& endorseCertificate);
+
+ void
+ getCollectEndorseList(const ndn::Name& name, std::vector<ndn::Buffer>& endorseList);
+
+ void
+ getEndorseList(const ndn::Name& identity, std::vector<std::string>& endorseList);
+
+
void
removeContact(const ndn::Name& identity);
@@ -39,6 +60,9 @@
void
addContact(const ContactItem& contactItem);
+ ndn::shared_ptr<ContactItem>
+ getContact(const ndn::Name& name);
+
void
updateIsIntroducer(const ndn::Name& identity, bool isIntroducer);
@@ -46,51 +70,14 @@
updateAlias(const ndn::Name& identity, std::string alias);
void
- getAllContacts(std::vector<ndn::ptr_lib::shared_ptr<ContactItem> >& contacts) const;
+ getAllContacts(std::vector<ndn::shared_ptr<ContactItem> >& contacts) const;
- ndn::ptr_lib::shared_ptr<ContactItem>
- getContact(const ndn::Name& name);
-
- ndn::ptr_lib::shared_ptr<Profile>
- getSelfProfile(const ndn::Name& identity) const;
-
-
- //SelfEndorse
- ndn::Block
- getSelfEndorseCertificate(const ndn::Name& identity);
-
- void
- updateSelfEndorseCertificate(const EndorseCertificate& endorseCertificate, const ndn::Name& identity);
-
- void
- addSelfEndorseCertificate(const EndorseCertificate& endorseCertificate, const ndn::Name& identity);
-
-
- //ProfileEndorse
- ndn::Block
- getEndorseCertificate(const ndn::Name& identity);
-
- void
- updateEndorseCertificate(const EndorseCertificate& endorseCertificate, const ndn::Name& identity);
-
- void
- addEndorseCertificate(const EndorseCertificate& endorseCertificate, const ndn::Name& identity);
-
- void
- getEndorseList(const ndn::Name& identity, std::vector<std::string>& endorseList);
-
-
- //CollectEndorse
- void
- updateCollectEndorse(const EndorseCertificate& endorseCertificate);
-
- void
- getCollectEndorseList(const ndn::Name& name, std::vector<ndn::Buffer>& endorseList);
+
private:
- bool
- doesSelfEntryExist(const ndn::Name& identity, const std::string& profileType);
+ void
+ initializeTable(const std::string& tableName, const std::string& sqlCreateStmt);
bool
doesContactExist(const ndn::Name& name);
@@ -99,4 +86,5 @@
sqlite3 *m_db;
};
+}//chronos
#endif