build: use C++11
Change-Id: I0e58ac4e9cb42d07a9b58125d761875f91c7744c
Refs: #1930
diff --git a/src/storage/repo-storage.hpp b/src/storage/repo-storage.hpp
index ed0ce9d..bc2ecbe 100644
--- a/src/storage/repo-storage.hpp
+++ b/src/storage/repo-storage.hpp
@@ -84,15 +84,14 @@
/**
* @brief read data from repo
* @param interest used to request data
- * @return std::pair<bool,shared_ptr<Data> >
+ * @return std::shared_ptr<Data>
*/
- shared_ptr<Data>
+ std::shared_ptr<Data>
readData(const Interest& interest) const;
private:
Index m_index;
Storage& m_storage;
-
};
} // namespace repo
diff --git a/src/storage/skiplist.hpp b/src/storage/skiplist.hpp
index 34c7c57..e6dd6a0 100644
--- a/src/storage/skiplist.hpp
+++ b/src/storage/skiplist.hpp
@@ -397,7 +397,7 @@
m_head->prevs.resize(newLevel + 1, m_head);
insertPositions.resize(newLevel + 1, m_head);
}
- for (int i = 0; i <= newLevel; i++) {
+ for (size_t i = 0; i <= newLevel; i++) {
newNode->nexts[i] = insertPositions[i]->nexts[i];
newNode->prevs[i] = insertPositions[i];
insertPositions[i]->nexts[i] = newNode;
diff --git a/src/storage/sqlite-storage.cpp b/src/storage/sqlite-storage.cpp
index 78b1792..7edcda7 100644
--- a/src/storage/sqlite-storage.cpp
+++ b/src/storage/sqlite-storage.cpp
@@ -25,6 +25,8 @@
namespace repo {
+using std::string;
+
SqliteStorage::SqliteStorage(const string& dbPath)
: m_size(0)
{
diff --git a/src/storage/sqlite-storage.hpp b/src/storage/sqlite-storage.hpp
index 73579c7..168cc41 100755
--- a/src/storage/sqlite-storage.hpp
+++ b/src/storage/sqlite-storage.hpp
@@ -48,7 +48,7 @@
};
explicit
- SqliteStorage(const string& dbPath);
+ SqliteStorage(const std::string& dbPath);
virtual
~SqliteStorage();
@@ -72,7 +72,7 @@
* @brief get the data from database
* @para id id number of each entry in the database, used to find the data
*/
- virtual shared_ptr<Data>
+ virtual std::shared_ptr<Data>
read(const int64_t id);
/**
@@ -86,7 +86,7 @@
* insertItemToIndex to reubuild index from database
*/
void
- fullEnumerate(const ndn::function<void(const Storage::ItemMeta)>& f);
+ fullEnumerate(const std::function<void(const Storage::ItemMeta)>& f);
private:
void
@@ -94,7 +94,7 @@
private:
sqlite3* m_db;
- string m_dbPath;
+ std::string m_dbPath;
int64_t m_size;
};
diff --git a/src/storage/storage.hpp b/src/storage/storage.hpp
index 04f366f..bf75306 100755
--- a/src/storage/storage.hpp
+++ b/src/storage/storage.hpp
@@ -76,7 +76,7 @@
* @brief get the data from database
* @param id id number of each entry in the database, used to find the data
*/
- virtual shared_ptr<Data>
+ virtual std::shared_ptr<Data>
read(const int64_t id) = 0;
/**
@@ -90,7 +90,7 @@
* insertItemToIndex to reubuild index from database
*/
virtual void
- fullEnumerate(const ndn::function<void(const Storage::ItemMeta)>& f) = 0;
+ fullEnumerate(const std::function<void(const Storage::ItemMeta)>& f) = 0;
};