storage: Making use of SkipList-based index

Change-Id: I360af97ae794da383fe00aaad8ab3c417c5167d3
Refs: #1695, #1434
diff --git a/src/repo.cpp b/src/repo.cpp
index d868508..a75bdd5 100644
--- a/src/repo.cpp
+++ b/src/repo.cpp
@@ -18,7 +18,7 @@
  */
 
 #include "repo.hpp"
-
+#include "storage/sqlite-storage.hpp"
 namespace repo {
 
 RepoConfig
@@ -104,6 +104,9 @@
   repoConfig.dbPath = repoConf.get<std::string>("storage.path");
 
   repoConfig.validatorNode = repoConf.get_child("validator");
+
+  repoConfig.nMaxPackets = repoConf.get<int>("storage.max-packets");
+
   return repoConfig;
 }
 
@@ -111,21 +114,16 @@
   : m_config(config)
   , m_scheduler(ioService)
   , m_face(ioService)
-  , m_storageHandle(openStorage(config))
+  , m_store(make_shared<SqliteStorage>(config.dbPath))
+  , m_storageHandle(config.nMaxPackets, *m_store)
   , m_validator(m_face)
-  , m_readHandle(m_face, *m_storageHandle, m_keyChain, m_scheduler)
-  , m_writeHandle(m_face, *m_storageHandle, m_keyChain, m_scheduler, m_validator)
-  , m_deleteHandle(m_face, *m_storageHandle, m_keyChain, m_scheduler, m_validator)
-  , m_tcpBulkInsertHandle(ioService, *m_storageHandle)
+  , m_readHandle(m_face, m_storageHandle, m_keyChain, m_scheduler)
+  , m_writeHandle(m_face, m_storageHandle, m_keyChain, m_scheduler, m_validator)
+  , m_deleteHandle(m_face, m_storageHandle, m_keyChain, m_scheduler, m_validator)
+  , m_tcpBulkInsertHandle(ioService, m_storageHandle)
 
 {
-}
-
-shared_ptr<StorageHandle>
-Repo::openStorage(const RepoConfig& config)
-{
-  shared_ptr<StorageHandle> storageHandle = ndn::make_shared<SqliteHandle>(config.dbPath);
-  return storageHandle;
+  m_validator.load(config.validatorNode, config.repoConfigPath);
 }
 
 void