Commit 286cffda authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

removed boost dependency

parent ab411254
......@@ -84,12 +84,12 @@ SERVER_DEPS_PKG=""
# uncertain what the lowest Boost we need is.
# Ubuntu 14.04 has boost 1.54. Seems like a good starting point
AX_BOOST_BASE([1.54], ,
AC_MSG_ERROR([sdskeyval requires Boost but was unable to find it]))
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
#AX_BOOST_BASE([1.54], ,
# AC_MSG_ERROR([sdskeyval requires Boost but was unable to find it]))
#AX_BOOST_SYSTEM
#AX_BOOST_FILESYSTEM
SERVER_LIBS_EXT="$SERVER_LIBS_EXT ${BOOST_LDFLAGS} ${BOOST_FILESYSTEM_LIB} ${BOOST_SYSTEM_LIB}"
#SERVER_LIBS_EXT="$SERVER_LIBS_EXT ${BOOST_LDFLAGS} ${BOOST_FILESYSTEM_LIB} ${BOOST_SYSTEM_LIB}"
# we have three possible backends for our datastore. If none are selected,
# then nothing will initialize the class and well that doesn't make any sense
......
......@@ -3,9 +3,11 @@
#ifndef bulk_h
#define bulk_h
#include <stddef.h>
#include "kv-config.h"
#include <boost/functional/hash.hpp>
//#include <boost/functional/hash.hpp>
#include <vector>
#include <string>
// implementation is std::vector<char> specific
// typedef is for convenience
......@@ -14,7 +16,8 @@ typedef std::vector<char> ds_bulk_t;
struct ds_bulk_hash {
size_t operator()(const ds_bulk_t &v) const {
size_t hash = 0;
boost::hash_range(hash, v.begin(), v.end());
hash = std::hash<std::string>() ( std::string( v.begin(), v.end() ) );
//boost::hash_range(hash, v.begin(), v.end());
return hash;
}
};
......
......@@ -2,10 +2,10 @@
// All rights reserved.
#include "berkeleydb_datastore.h"
#include "kv-config.h"
#include <sstream>
#include <chrono>
#include <cstring>
#include <iostream>
#include <boost/filesystem.hpp>
using namespace std::chrono;
......@@ -31,7 +31,9 @@ void BerkeleyDBDataStore::createDatabase(const std::string& db_name, const std::
int status = 0;
if (!db_path.empty()) {
boost::filesystem::create_directories(db_path);
std::stringstream str_db_path("mkdir -p ");
str_db_path << db_path;
system(str_db_path.str().c_str());
}
// initialize the environment
......
......@@ -4,7 +4,6 @@
#include "kv-config.h"
#include <chrono>
#include <iostream>
#include <boost/filesystem.hpp>
using namespace std::chrono;
......
......@@ -5,8 +5,6 @@
#include <chrono>
#include <iostream>
#include <boost/filesystem.hpp>
using namespace std::chrono;
AbstractDataStore::AbstractDataStore() {
......
......@@ -6,7 +6,6 @@
#include "kv-config.h"
#include "bulk.h"
#include <boost/functional/hash.hpp>
#include <vector>
enum class Duplicates : int {ALLOW, IGNORE};
......
......@@ -2,9 +2,10 @@
// All rights reserved.
#include "leveldb_datastore.h"
#include "kv-config.h"
#include <cstring>
#include <chrono>
#include <iostream>
#include <boost/filesystem.hpp>
#include <sstream>
using namespace std::chrono;
......@@ -38,7 +39,9 @@ void LevelDBDataStore::createDatabase(const std::string& db_name, const std::str
leveldb::Status status;
if (!db_path.empty()) {
boost::filesystem::create_directories(db_path);
std::stringstream str_db_path("mkdir -p ");
str_db_path << db_path;
system(str_db_path.str().c_str());
}
options.comparator = &_keycmp;
options.create_if_missing = true;
......
......@@ -4,6 +4,7 @@
#define map_datastore_h
#include <map>
#include <cstring>
#include "kv-config.h"
#include "bulk.h"
#include "datastore/datastore.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment