From 3350e9368a2b0d41a37eab9cbfb8bc70f488a98d Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 17 Feb 2015 00:40:34 +0100 Subject: [PATCH] Switch to biicode --- .gitignore | 2 - CMakeLists.txt | 97 +++++++++++++++++++ biicode.conf | 46 +++++++++ .../onblocks/BlobOnBlocks.cpp | 4 +- .../onblocks/BlobOnBlocks.h | 2 +- .../onblocks/BlobStoreOnBlocks.cpp | 4 +- .../onblocks/BlobStoreOnBlocks.h | 4 +- .../onblocks/datanodestore/DataInnerNode.cpp | 1 - .../onblocks/datanodestore/DataInnerNode.h | 0 .../onblocks/datanodestore/DataLeafNode.cpp | 0 .../onblocks/datanodestore/DataLeafNode.h | 0 .../onblocks/datanodestore/DataNode.cpp | 0 .../onblocks/datanodestore/DataNode.h | 2 +- .../onblocks/datanodestore/DataNodeStore.cpp | 6 +- .../onblocks/datanodestore/DataNodeStore.h | 2 +- .../onblocks/datanodestore/DataNodeView.h | 6 +- .../onblocks/datatreestore/DataTree.cpp | 16 +-- .../onblocks/datatreestore/DataTree.h | 4 +- .../onblocks/datatreestore/DataTreeStore.cpp | 4 +- .../onblocks/datatreestore/DataTreeStore.h | 2 +- ...tBorderNodeWithLessThanKChildrenOrNull.cpp | 16 +-- ...ghtBorderNodeWithLessThanKChildrenOrNull.h | 4 +- {src/blobstore/interface => interface}/Blob.h | 0 .../interface => interface}/BlobStore.h | 2 +- src/blobstore/CMakeLists.txt | 3 - src/blobstore/implementations/CMakeLists.txt | 1 - .../implementations/onblocks/CMakeLists.txt | 6 -- .../onblocks/datanodestore/CMakeLists.txt | 3 - .../onblocks/datatreestore/CMakeLists.txt | 3 - .../datanodestore/DataInnerNodeTest.cpp | 16 +-- .../datanodestore/DataLeafNodeTest.cpp | 20 ++-- .../datanodestore/DataNodeStoreTest.cpp | 16 +-- .../datanodestore/DataNodeViewTest.cpp | 12 +-- .../datatreestore/DataTreeGrowingTest.cpp | 12 +-- .../onblocks/datatreestore/DataTreeTest.h | 12 +-- ...derNodeWithLessThanKChildrenOrNullTest.cpp | 8 +- test/main.cpp | 6 ++ .../testutils/DataBlockFixture.cpp | 2 +- .../testutils/DataBlockFixture.h | 0 39 files changed, 237 insertions(+), 107 deletions(-) delete mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 biicode.conf rename {src/blobstore/implementations => implementations}/onblocks/BlobOnBlocks.cpp (75%) rename {src/blobstore/implementations => implementations}/onblocks/BlobOnBlocks.h (93%) rename {src/blobstore/implementations => implementations}/onblocks/BlobStoreOnBlocks.cpp (81%) rename {src/blobstore/implementations => implementations}/onblocks/BlobStoreOnBlocks.h (87%) rename {src/blobstore/implementations => implementations}/onblocks/datanodestore/DataInnerNode.cpp (99%) rename {src/blobstore/implementations => implementations}/onblocks/datanodestore/DataInnerNode.h (100%) rename {src/blobstore/implementations => implementations}/onblocks/datanodestore/DataLeafNode.cpp (100%) rename {src/blobstore/implementations => implementations}/onblocks/datanodestore/DataLeafNode.h (100%) rename {src/blobstore/implementations => implementations}/onblocks/datanodestore/DataNode.cpp (100%) rename {src/blobstore/implementations => implementations}/onblocks/datanodestore/DataNode.h (94%) rename {src/blobstore/implementations => implementations}/onblocks/datanodestore/DataNodeStore.cpp (91%) rename {src/blobstore/implementations => implementations}/onblocks/datanodestore/DataNodeStore.h (96%) rename {src/blobstore/implementations => implementations}/onblocks/datanodestore/DataNodeView.h (95%) rename {src/blobstore/implementations => implementations}/onblocks/datatreestore/DataTree.cpp (79%) rename {src/blobstore/implementations => implementations}/onblocks/datatreestore/DataTree.h (85%) rename {src/blobstore/implementations => implementations}/onblocks/datatreestore/DataTreeStore.cpp (83%) rename {src/blobstore/implementations => implementations}/onblocks/datatreestore/DataTreeStore.h (95%) rename {src/blobstore/implementations => implementations}/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.cpp (67%) rename {src/blobstore/implementations => implementations}/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h (77%) rename {src/blobstore/interface => interface}/Blob.h (100%) rename {src/blobstore/interface => interface}/BlobStore.h (93%) delete mode 100644 src/blobstore/CMakeLists.txt delete mode 100644 src/blobstore/implementations/CMakeLists.txt delete mode 100644 src/blobstore/implementations/onblocks/CMakeLists.txt delete mode 100644 src/blobstore/implementations/onblocks/datanodestore/CMakeLists.txt delete mode 100644 src/blobstore/implementations/onblocks/datatreestore/CMakeLists.txt rename {src/test/blobstore => test}/implementations/onblocks/datanodestore/DataInnerNodeTest.cpp (93%) rename {src/test/blobstore => test}/implementations/onblocks/datanodestore/DataLeafNodeTest.cpp (95%) rename {src/test/blobstore => test}/implementations/onblocks/datanodestore/DataNodeStoreTest.cpp (82%) rename {src/test/blobstore => test}/implementations/onblocks/datanodestore/DataNodeViewTest.cpp (93%) rename {src/test/blobstore => test}/implementations/onblocks/datatreestore/DataTreeGrowingTest.cpp (96%) rename {src/test/blobstore => test}/implementations/onblocks/datatreestore/DataTreeTest.h (82%) rename {src/test/blobstore => test}/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNullTest.cpp (93%) create mode 100644 test/main.cpp rename {src/test => test}/testutils/DataBlockFixture.cpp (98%) rename {src/test => test}/testutils/DataBlockFixture.h (100%) diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d69a93cf..00000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build.debug -build.release diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..296384cd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,97 @@ +INCLUDE(messmer/cmake/tools) + +# Initializes block variables +INIT_BIICODE_BLOCK() + +SETUP_GOOGLETEST() + +# Actually create targets: EXEcutables and libraries. +ADD_BIICODE_TARGETS() + +ACTIVATE_CPP14() + +# You can safely delete lines from here... + +############################################################################### +# REFERENCE # +############################################################################### +# +# This CMakeLists.txt file helps defining your block building and compiling +# To learn more about the CMake use with biicode, visit http://docs.biicode.com/c++.html +# +# ---------------------------------------------------- +# NEW FEATURE! Include cmake files from remote blocks: +# ----------------------------------------------------- +# Now you can handle cmake dependencies alike you do with c/c++: +# +# INCLUDE(user/block/myrecipe) # include myrecipe.cmake from remote user/block +# +# > EXAMPLE: Include our recipes and activate C++11 in your block (http://www.biicode.com/biicode/cmake) +# +# INCLUDE(biicode/cmake/tools) # Include tools.cmake file from "cmake" block from the "biicode" user +# ACTIVATE_CPP11(INTERFACE ${BII_BLOCK_TARGET}) +# +# Remember to run "bii find" to download out cmake tools file +# +# --------------------- +# INIT_BIICODE_BLOCK() +# --------------------- +# This function creates several helper variables as ${BII_BLOCK_NAME} and ${BII_BLOCK_USER} +# Also it loads variables from the cmake/bii_user_block_vars.cmake +# ${BII_LIB_SRC} File list to create the library +# ${BII_LIB_TYPE} Empty (default, STATIC most casess) STATIC or SHARED +# ${BII_LIB_DEPS} Dependencies to other libraries (user2_block2, user3_blockX) +# ${BII_LIB_SYSTEM_HEADERS} System linking requirements as windows.h, pthread.h, etc +# +# You can use or modify them here, for example, to add or remove files from targets based on OS +# Or use typical cmake configurations done BEFORE defining targets. Examples: +# ADD_DEFINITIONS(-DFOO) +# FIND_PACKAGE(OpenGL QUIET) +# You can add INCLUDE_DIRECTORIES here too +# +# --------------------- +# ADD_BIICODE_TARGETS() +# --------------------- +# +# This function creates the following variables: +# ${BII_BLOCK_TARGET} Interface (no files) target for convenient configuration of all +# targets in this block, as the rest of targets always depend on it +# has name in the form "user_block_interface" +# ${BII_LIB_TARGET} Target library name, usually in the form "user_block". May not exist +# if BII_LIB_SRC is empty +# ${BII_BLOCK_TARGETS} List of all targets defined in this block +# ${BII_BLOCK_EXES} List of executables targets defined in this block +# ${BII_exe_name_TARGET}: Executable target (e.g. ${BII_main_TARGET}. You can also use +# directly the name of the executable target (e.g. user_block_main) +# +# > EXAMPLE: Add include directories to all targets of this block +# +# TARGET_INCLUDE_DIRECTORIES(${BII_BLOCK_TARGET} INTERFACE myincludedir) +# +# You can add private include directories to the Lib (if existing) +# +# > EXAMPLE: Link with pthread: +# +# TARGET_LINK_LIBRARIES(${BII_BLOCK_TARGET} INTERFACE pthread) +# or link against library: +# TARGET_LINK_LIBRARIES(${BII_LIB_TARGET} PUBLIC pthread) +# or directly use the library target name: +# TARGET_LINK_LIBRARIES(user_block PUBLIC pthread) +# +# NOTE: This can be also done adding pthread to ${BII_LIB_DEPS} +# BEFORE calling ADD_BIICODE_TARGETS() +# +# > EXAMPLE: how to activate C++11 +# +# IF(APPLE) +# TARGET_COMPILE_OPTIONS(${BII_BLOCK_TARGET} INTERFACE "-std=c++11 -stdlib=libc++") +# ELSEIF (WIN32 OR UNIX) +# TARGET_COMPILE_OPTIONS(${BII_BLOCK_TARGET} INTERFACE "-std=c++11") +# ENDIF(APPLE) +# +# > EXAMPLE: Set properties to target +# +# SET_TARGET_PROPERTIES(${BII_BLOCK_TARGET} PROPERTIES COMPILE_DEFINITIONS "IOV_MAX=255") +# + + diff --git a/biicode.conf b/biicode.conf new file mode 100644 index 00000000..82bd78f5 --- /dev/null +++ b/biicode.conf @@ -0,0 +1,46 @@ +# Biicode configuration file + +[requirements] + google/gtest: 10 + messmer/blockstore + messmer/cmake: 1 + messmer/cpp-utils + +[parent] + # The parent version of this block. Must match folder name. E.g. + # user/block # No version number means not published yet + # You can change it to publish to a different track, and change version, e.g. + # user/block(track): 7 + +[paths] + # Local directories to look for headers (within block) + # / + # include + +[dependencies] + # Manual adjust file implicit dependencies, add (+), remove (-), or overwrite (=) + # hello.h + hello_imp.cpp hello_imp2.cpp + # *.h + *.cpp + + test/main.cpp + test/*.cpp + +[mains] + # Manual adjust of files that define an executable + # !main.cpp # Do not build executable from this file + # main2.cpp # Build it (it doesnt have a main() function, but maybe it includes it) + +[hooks] + # These are defined equal to [dependencies],files names matching bii*stage*hook.py + # will be launched as python scripts at stage = {post_process, clean} + # CMakeLists.txt + bii/my_post_process1_hook.py bii_clean_hook.py + +[includes] + # Mapping of include patterns to external blocks + # hello*.h: user3/depblock # includes will be processed as user3/depblock/hello*.h + +[data] + # Manually define data files dependencies, that will be copied to bin for execution + # By default they are copied to bin/user/block/... which should be taken into account + # when loading from disk such data + # image.cpp + image.jpg # code should write open("user/block/image.jpg") + diff --git a/src/blobstore/implementations/onblocks/BlobOnBlocks.cpp b/implementations/onblocks/BlobOnBlocks.cpp similarity index 75% rename from src/blobstore/implementations/onblocks/BlobOnBlocks.cpp rename to implementations/onblocks/BlobOnBlocks.cpp index 74bd3711..51cc6354 100644 --- a/src/blobstore/implementations/onblocks/BlobOnBlocks.cpp +++ b/implementations/onblocks/BlobOnBlocks.cpp @@ -1,6 +1,6 @@ -#include +#include "BlobOnBlocks.h" -#include +#include "datanodestore/DataNode.h" using std::unique_ptr; diff --git a/src/blobstore/implementations/onblocks/BlobOnBlocks.h b/implementations/onblocks/BlobOnBlocks.h similarity index 93% rename from src/blobstore/implementations/onblocks/BlobOnBlocks.h rename to implementations/onblocks/BlobOnBlocks.h index d975cbfd..072d1e89 100644 --- a/src/blobstore/implementations/onblocks/BlobOnBlocks.h +++ b/implementations/onblocks/BlobOnBlocks.h @@ -2,7 +2,7 @@ #ifndef BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_BLOBONBLOCKS_H_ #define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_BLOBONBLOCKS_H_ -#include "blobstore/interface/Blob.h" +#include "../../interface/Blob.h" #include diff --git a/src/blobstore/implementations/onblocks/BlobStoreOnBlocks.cpp b/implementations/onblocks/BlobStoreOnBlocks.cpp similarity index 81% rename from src/blobstore/implementations/onblocks/BlobStoreOnBlocks.cpp rename to implementations/onblocks/BlobStoreOnBlocks.cpp index ee442849..1926432c 100644 --- a/src/blobstore/implementations/onblocks/BlobStoreOnBlocks.cpp +++ b/implementations/onblocks/BlobStoreOnBlocks.cpp @@ -1,5 +1,5 @@ -#include -#include +#include "datanodestore/DataLeafNode.h" +#include "datanodestore/DataNodeStore.h" #include "BlobStoreOnBlocks.h" #include "BlobOnBlocks.h" diff --git a/src/blobstore/implementations/onblocks/BlobStoreOnBlocks.h b/implementations/onblocks/BlobStoreOnBlocks.h similarity index 87% rename from src/blobstore/implementations/onblocks/BlobStoreOnBlocks.h rename to implementations/onblocks/BlobStoreOnBlocks.h index 64e6062a..316ae082 100644 --- a/src/blobstore/implementations/onblocks/BlobStoreOnBlocks.h +++ b/implementations/onblocks/BlobStoreOnBlocks.h @@ -2,8 +2,8 @@ #ifndef BLOBSTORE_IMPLEMENTATIONS_BLOCKED_BLOBSTOREONBLOCKS_H_ #define BLOBSTORE_IMPLEMENTATIONS_BLOCKED_BLOBSTOREONBLOCKS_H_ -#include "blobstore/interface/BlobStore.h" -#include "blockstore/interface/BlockStore.h" +#include "../../interface/BlobStore.h" +#include "messmer/blockstore/interface/BlockStore.h" namespace blobstore { namespace onblocks { diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataInnerNode.cpp b/implementations/onblocks/datanodestore/DataInnerNode.cpp similarity index 99% rename from src/blobstore/implementations/onblocks/datanodestore/DataInnerNode.cpp rename to implementations/onblocks/datanodestore/DataInnerNode.cpp index 0fb1b8b9..6f59a10e 100644 --- a/src/blobstore/implementations/onblocks/datanodestore/DataInnerNode.cpp +++ b/implementations/onblocks/datanodestore/DataInnerNode.cpp @@ -1,7 +1,6 @@ #include "DataInnerNode.h" #include "DataNodeStore.h" - using std::unique_ptr; using blockstore::Block; using blockstore::Data; diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataInnerNode.h b/implementations/onblocks/datanodestore/DataInnerNode.h similarity index 100% rename from src/blobstore/implementations/onblocks/datanodestore/DataInnerNode.h rename to implementations/onblocks/datanodestore/DataInnerNode.h diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataLeafNode.cpp b/implementations/onblocks/datanodestore/DataLeafNode.cpp similarity index 100% rename from src/blobstore/implementations/onblocks/datanodestore/DataLeafNode.cpp rename to implementations/onblocks/datanodestore/DataLeafNode.cpp diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataLeafNode.h b/implementations/onblocks/datanodestore/DataLeafNode.h similarity index 100% rename from src/blobstore/implementations/onblocks/datanodestore/DataLeafNode.h rename to implementations/onblocks/datanodestore/DataLeafNode.h diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataNode.cpp b/implementations/onblocks/datanodestore/DataNode.cpp similarity index 100% rename from src/blobstore/implementations/onblocks/datanodestore/DataNode.cpp rename to implementations/onblocks/datanodestore/DataNode.cpp diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataNode.h b/implementations/onblocks/datanodestore/DataNode.h similarity index 94% rename from src/blobstore/implementations/onblocks/datanodestore/DataNode.h rename to implementations/onblocks/datanodestore/DataNode.h index 4d9578aa..02e1d5df 100644 --- a/src/blobstore/implementations/onblocks/datanodestore/DataNode.h +++ b/implementations/onblocks/datanodestore/DataNode.h @@ -3,7 +3,7 @@ #define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATANODE_H_ #include "DataNodeView.h" -#include "blockstore/utils/Data.h" +#include "messmer/blockstore/utils/Data.h" namespace blobstore { namespace onblocks { diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.cpp b/implementations/onblocks/datanodestore/DataNodeStore.cpp similarity index 91% rename from src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.cpp rename to implementations/onblocks/datanodestore/DataNodeStore.cpp index f85eb43c..6a96696e 100644 --- a/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.cpp +++ b/implementations/onblocks/datanodestore/DataNodeStore.cpp @@ -1,9 +1,9 @@ #include "DataInnerNode.h" #include "DataLeafNode.h" #include "DataNodeStore.h" -#include "blockstore/interface/BlockStore.h" -#include "blockstore/interface/Block.h" -#include "blockstore/utils/BlockStoreUtils.h" +#include "messmer/blockstore/interface/BlockStore.h" +#include "messmer/blockstore/interface/Block.h" +#include "messmer/blockstore/utils/BlockStoreUtils.h" using blockstore::BlockStore; diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.h b/implementations/onblocks/datanodestore/DataNodeStore.h similarity index 96% rename from src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.h rename to implementations/onblocks/datanodestore/DataNodeStore.h index f54a7399..b9ee1265 100644 --- a/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.h +++ b/implementations/onblocks/datanodestore/DataNodeStore.h @@ -3,7 +3,7 @@ #define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATANODESTORE_H_ #include -#include "fspp/utils/macros.h" +#include "messmer/cpp-utils/macros.h" namespace blockstore{ class Block; diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataNodeView.h b/implementations/onblocks/datanodestore/DataNodeView.h similarity index 95% rename from src/blobstore/implementations/onblocks/datanodestore/DataNodeView.h rename to implementations/onblocks/datanodestore/DataNodeView.h index 97f82049..161462ce 100644 --- a/src/blobstore/implementations/onblocks/datanodestore/DataNodeView.h +++ b/implementations/onblocks/datanodestore/DataNodeView.h @@ -2,10 +2,10 @@ #ifndef BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATANODEVIEW_H_ #define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATANODEVIEW_H_ -#include "blockstore/interface/Block.h" -#include "blobstore/implementations/onblocks/BlobStoreOnBlocks.h" +#include "messmer/blockstore/interface/Block.h" +#include "../BlobStoreOnBlocks.h" -#include "fspp/utils/macros.h" +#include "messmer/cpp-utils/macros.h" #include #include diff --git a/src/blobstore/implementations/onblocks/datatreestore/DataTree.cpp b/implementations/onblocks/datatreestore/DataTree.cpp similarity index 79% rename from src/blobstore/implementations/onblocks/datatreestore/DataTree.cpp rename to implementations/onblocks/datatreestore/DataTree.cpp index 438ebbdf..d410af21 100644 --- a/src/blobstore/implementations/onblocks/datatreestore/DataTree.cpp +++ b/implementations/onblocks/datatreestore/DataTree.cpp @@ -1,12 +1,12 @@ #include "DataTree.h" -#include "blobstore/implementations/onblocks/datanodestore/DataNodeStore.h" -#include "blobstore/implementations/onblocks/datanodestore/DataInnerNode.h" -#include "blobstore/implementations/onblocks/datanodestore/DataLeafNode.h" +#include "../datanodestore/DataNodeStore.h" +#include "../datanodestore/DataInnerNode.h" +#include "../datanodestore/DataLeafNode.h" #include "impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h" -#include "fspp/utils/pointer.h" +#include "messmer/cpp-utils/pointer.h" using blockstore::Key; using blobstore::onblocks::datanodestore::DataNodeStore; @@ -18,8 +18,8 @@ using std::unique_ptr; using std::dynamic_pointer_cast; using std::function; -using fspp::dynamic_pointer_move; -using fspp::ptr::optional_ownership_ptr; +using cpputils::dynamic_pointer_move; +using cpputils::optional_ownership_ptr; namespace blobstore { namespace onblocks { @@ -49,10 +49,10 @@ unique_ptr DataTree::addDataLeafAt(DataInnerNode *insertPos) { } optional_ownership_ptr DataTree::createChainOfInnerNodes(unsigned int num, DataLeafNode *leaf) { - optional_ownership_ptr chain = fspp::ptr::WithoutOwnership(leaf); + optional_ownership_ptr chain = cpputils::WithoutOwnership(leaf); for(unsigned int i=0; icreateNewInnerNode(*chain); - chain = fspp::ptr::WithOwnership(std::move(newnode)); + chain = cpputils::WithOwnership(std::move(newnode)); } return chain; } diff --git a/src/blobstore/implementations/onblocks/datatreestore/DataTree.h b/implementations/onblocks/datatreestore/DataTree.h similarity index 85% rename from src/blobstore/implementations/onblocks/datatreestore/DataTree.h rename to implementations/onblocks/datatreestore/DataTree.h index 325da044..cecf67b4 100644 --- a/src/blobstore/implementations/onblocks/datatreestore/DataTree.h +++ b/implementations/onblocks/datatreestore/DataTree.h @@ -3,7 +3,7 @@ #define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATATREE_H_ #include -#include "fspp/utils/macros.h" +#include "messmer/cpp-utils/macros.h" #include "impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h" namespace blockstore { @@ -34,7 +34,7 @@ private: std::unique_ptr _rootNode; std::unique_ptr addDataLeafAt(datanodestore::DataInnerNode *insertPos); - fspp::ptr::optional_ownership_ptr createChainOfInnerNodes(unsigned int num, datanodestore::DataLeafNode *leaf); + cpputils::optional_ownership_ptr createChainOfInnerNodes(unsigned int num, datanodestore::DataLeafNode *leaf); std::unique_ptr addDataLeafToFullTree(); DISALLOW_COPY_AND_ASSIGN(DataTree); diff --git a/src/blobstore/implementations/onblocks/datatreestore/DataTreeStore.cpp b/implementations/onblocks/datatreestore/DataTreeStore.cpp similarity index 83% rename from src/blobstore/implementations/onblocks/datatreestore/DataTreeStore.cpp rename to implementations/onblocks/datatreestore/DataTreeStore.cpp index 8cce055d..153644d3 100644 --- a/src/blobstore/implementations/onblocks/datatreestore/DataTreeStore.cpp +++ b/implementations/onblocks/datatreestore/DataTreeStore.cpp @@ -1,6 +1,6 @@ #include "DataTreeStore.h" -#include "blobstore/implementations/onblocks/datanodestore/DataNodeStore.h" -#include "blobstore/implementations/onblocks/datanodestore/DataLeafNode.h" +#include "../datanodestore/DataNodeStore.h" +#include "../datanodestore/DataLeafNode.h" #include "DataTree.h" using std::unique_ptr; diff --git a/src/blobstore/implementations/onblocks/datatreestore/DataTreeStore.h b/implementations/onblocks/datatreestore/DataTreeStore.h similarity index 95% rename from src/blobstore/implementations/onblocks/datatreestore/DataTreeStore.h rename to implementations/onblocks/datatreestore/DataTreeStore.h index 625bab0f..b88d695f 100644 --- a/src/blobstore/implementations/onblocks/datatreestore/DataTreeStore.h +++ b/implementations/onblocks/datatreestore/DataTreeStore.h @@ -3,7 +3,7 @@ #define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATATREESTORE_DATATREESTORE_H_ #include -#include "fspp/utils/macros.h" +#include "messmer/cpp-utils/macros.h" namespace blockstore{ class Key; diff --git a/src/blobstore/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.cpp b/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.cpp similarity index 67% rename from src/blobstore/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.cpp rename to implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.cpp index 491633ef..121edf0a 100644 --- a/src/blobstore/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.cpp +++ b/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.cpp @@ -1,14 +1,14 @@ #include "GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h" -#include "blobstore/implementations/onblocks/datanodestore/DataInnerNode.h" -#include "blobstore/implementations/onblocks/datanodestore/DataLeafNode.h" -#include "blobstore/implementations/onblocks/datanodestore/DataNodeStore.h" +#include "../../datanodestore/DataInnerNode.h" +#include "../../datanodestore/DataLeafNode.h" +#include "../../datanodestore/DataNodeStore.h" -#include "fspp/utils/pointer.h" +#include "messmer/cpp-utils/pointer.h" using std::unique_ptr; -using fspp::dynamic_pointer_move; -using fspp::ptr::optional_ownership_ptr; +using cpputils::dynamic_pointer_move; +using cpputils::optional_ownership_ptr; using blobstore::onblocks::datanodestore::DataNode; using blobstore::onblocks::datanodestore::DataInnerNode; using blobstore::onblocks::datanodestore::DataLeafNode; @@ -27,8 +27,8 @@ unique_ptr getLastChildAsInnerNode(DataNodeStore *nodeStore, cons } optional_ownership_ptr GetLowestRightBorderNodeWithLessThanKChildrenOrNull::run(DataNodeStore *nodeStore, DataNode *rootNode) { - optional_ownership_ptr currentNode = fspp::ptr::WithoutOwnership(dynamic_cast(rootNode)); - optional_ownership_ptr result = fspp::ptr::null(); + optional_ownership_ptr currentNode = cpputils::WithoutOwnership(dynamic_cast(rootNode)); + optional_ownership_ptr result = cpputils::null(); for (unsigned int i=0; i < rootNode->depth(); ++i) { auto lastChild = getLastChildAsInnerNode(nodeStore, *currentNode); if (currentNode->numChildren() < DataInnerNode::MAX_STORED_CHILDREN) { diff --git a/src/blobstore/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h b/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h similarity index 77% rename from src/blobstore/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h rename to implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h index 8b329ac3..a27fafa4 100644 --- a/src/blobstore/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h +++ b/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull.h @@ -2,7 +2,7 @@ #ifndef TEST_BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATATREESTORE_IMPL_GETLOWESTRIGHTBORDERNODEWITHLESSTHANKCHILDRENORNULL_H_ #define TEST_BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATATREESTORE_IMPL_GETLOWESTRIGHTBORDERNODEWITHLESSTHANKCHILDRENORNULL_H_ -#include "fspp/utils/OptionalOwnershipPointer.h" +#include "messmer/cpp-utils/optional_ownership_ptr.h" namespace blobstore { namespace onblocks { @@ -18,7 +18,7 @@ class GetLowestRightBorderNodeWithLessThanKChildrenOrNull { public: //Returns the lowest right border node with less than k children (not considering leaves). //Returns nullptr, if all right border nodes have k children (the tree is full) - static fspp::ptr::optional_ownership_ptr run(datanodestore::DataNodeStore *nodeStore, datanodestore::DataNode *rootNode); + static cpputils::optional_ownership_ptr run(datanodestore::DataNodeStore *nodeStore, datanodestore::DataNode *rootNode); }; } diff --git a/src/blobstore/interface/Blob.h b/interface/Blob.h similarity index 100% rename from src/blobstore/interface/Blob.h rename to interface/Blob.h diff --git a/src/blobstore/interface/BlobStore.h b/interface/BlobStore.h similarity index 93% rename from src/blobstore/interface/BlobStore.h rename to interface/BlobStore.h index 780fa091..db476954 100644 --- a/src/blobstore/interface/BlobStore.h +++ b/interface/BlobStore.h @@ -6,7 +6,7 @@ #include #include -#include "blockstore/utils/Key.h" +#include "messmer/blockstore/utils/Key.h" namespace blobstore { diff --git a/src/blobstore/CMakeLists.txt b/src/blobstore/CMakeLists.txt deleted file mode 100644 index 8e4e1300..00000000 --- a/src/blobstore/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -#add_subdirectory(interface) -#add_subdirectory(utils) -add_subdirectory(implementations) diff --git a/src/blobstore/implementations/CMakeLists.txt b/src/blobstore/implementations/CMakeLists.txt deleted file mode 100644 index d3b4c375..00000000 --- a/src/blobstore/implementations/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(onblocks) diff --git a/src/blobstore/implementations/onblocks/CMakeLists.txt b/src/blobstore/implementations/onblocks/CMakeLists.txt deleted file mode 100644 index 62bd9680..00000000 --- a/src/blobstore/implementations/onblocks/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(datanodestore) -add_subdirectory(datatreestore) - -add_library(blobstore_onblocks BlobOnBlocks.cpp BlobStoreOnBlocks.cpp) - -target_link_libraries(blobstore_onblocks blobstore_onblocks_datatreestore) diff --git a/src/blobstore/implementations/onblocks/datanodestore/CMakeLists.txt b/src/blobstore/implementations/onblocks/datanodestore/CMakeLists.txt deleted file mode 100644 index ecb185ef..00000000 --- a/src/blobstore/implementations/onblocks/datanodestore/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_library(blobstore_onblocks_datanodestore DataInnerNode.cpp DataLeafNode.cpp DataNode.cpp DataNodeStore.cpp) - -target_link_libraries(blobstore_onblocks_datanodestore blockstore_interface) diff --git a/src/blobstore/implementations/onblocks/datatreestore/CMakeLists.txt b/src/blobstore/implementations/onblocks/datatreestore/CMakeLists.txt deleted file mode 100644 index 2c507bd5..00000000 --- a/src/blobstore/implementations/onblocks/datatreestore/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_library(blobstore_onblocks_datatreestore DataTree.cpp DataTreeStore.cpp impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNull) - -target_link_libraries(blobstore_onblocks_datatreestore blobstore_onblocks_datanodestore) diff --git a/src/test/blobstore/implementations/onblocks/datanodestore/DataInnerNodeTest.cpp b/test/implementations/onblocks/datanodestore/DataInnerNodeTest.cpp similarity index 93% rename from src/test/blobstore/implementations/onblocks/datanodestore/DataInnerNodeTest.cpp rename to test/implementations/onblocks/datanodestore/DataInnerNodeTest.cpp index 12954baa..fabc3c16 100644 --- a/src/test/blobstore/implementations/onblocks/datanodestore/DataInnerNodeTest.cpp +++ b/test/implementations/onblocks/datanodestore/DataInnerNodeTest.cpp @@ -1,18 +1,18 @@ -#include +#include -#include -#include -#include +#include "../../../../implementations/onblocks/datanodestore/DataInnerNode.h" +#include "../../../../implementations/onblocks/datanodestore/DataLeafNode.h" +#include "../../../../implementations/onblocks/datanodestore/DataNodeStore.h" -#include "blockstore/implementations/testfake/FakeBlockStore.h" -#include "blockstore/implementations/testfake/FakeBlock.h" +#include "messmer/blockstore/implementations/testfake/FakeBlockStore.h" +#include "messmer/blockstore/implementations/testfake/FakeBlock.h" #include -#include "fspp/utils/pointer.h" +#include "messmer/cpp-utils/pointer.h" using ::testing::Test; -using fspp::dynamic_pointer_move; +using cpputils::dynamic_pointer_move; using blockstore::Key; using blockstore::testfake::FakeBlockStore; diff --git a/src/test/blobstore/implementations/onblocks/datanodestore/DataLeafNodeTest.cpp b/test/implementations/onblocks/datanodestore/DataLeafNodeTest.cpp similarity index 95% rename from src/test/blobstore/implementations/onblocks/datanodestore/DataLeafNodeTest.cpp rename to test/implementations/onblocks/datanodestore/DataLeafNodeTest.cpp index 388ce7be..b376a1ec 100644 --- a/src/test/blobstore/implementations/onblocks/datanodestore/DataLeafNodeTest.cpp +++ b/test/implementations/onblocks/datanodestore/DataLeafNodeTest.cpp @@ -1,14 +1,14 @@ -#include -#include -#include -#include +#include "../../../../implementations/onblocks/datanodestore/DataLeafNode.h" +#include "../../../../implementations/onblocks/datanodestore/DataInnerNode.h" +#include "../../../../implementations/onblocks/datanodestore/DataNodeStore.h" +#include -#include "fspp/utils/pointer.h" +#include "messmer/cpp-utils/pointer.h" -#include "blockstore/implementations/testfake/FakeBlockStore.h" -#include "blockstore/implementations/testfake/FakeBlock.h" -#include "blobstore/implementations/onblocks/BlobStoreOnBlocks.h" -#include "test/testutils/DataBlockFixture.h" +#include "messmer/blockstore/implementations/testfake/FakeBlockStore.h" +#include "messmer/blockstore/implementations/testfake/FakeBlock.h" +#include "messmer/blobstore/implementations/onblocks/BlobStoreOnBlocks.h" +#include "../../../testutils/DataBlockFixture.h" using ::testing::Test; using ::testing::WithParamInterface; @@ -18,7 +18,7 @@ using std::unique_ptr; using std::make_unique; using std::string; -using fspp::dynamic_pointer_move; +using cpputils::dynamic_pointer_move; using blockstore::BlockStore; using blockstore::Data; diff --git a/src/test/blobstore/implementations/onblocks/datanodestore/DataNodeStoreTest.cpp b/test/implementations/onblocks/datanodestore/DataNodeStoreTest.cpp similarity index 82% rename from src/test/blobstore/implementations/onblocks/datanodestore/DataNodeStoreTest.cpp rename to test/implementations/onblocks/datanodestore/DataNodeStoreTest.cpp index 41a4270d..17a2fc8f 100644 --- a/src/test/blobstore/implementations/onblocks/datanodestore/DataNodeStoreTest.cpp +++ b/test/implementations/onblocks/datanodestore/DataNodeStoreTest.cpp @@ -1,12 +1,12 @@ -#include -#include -#include -#include -#include +#include "../../../../implementations/onblocks/datanodestore/DataInnerNode.h" +#include "../../../../implementations/onblocks/datanodestore/DataLeafNode.h" +#include "../../../../implementations/onblocks/datanodestore/DataNode.h" +#include "../../../../implementations/onblocks/datanodestore/DataNodeStore.h" +#include -#include "blockstore/implementations/testfake/FakeBlockStore.h" -#include "blockstore/implementations/testfake/FakeBlock.h" -#include "blobstore/implementations/onblocks/BlobStoreOnBlocks.h" +#include "messmer/blockstore/implementations/testfake/FakeBlockStore.h" +#include "messmer/blockstore/implementations/testfake/FakeBlock.h" +#include "messmer/blobstore/implementations/onblocks/BlobStoreOnBlocks.h" using ::testing::Test; using std::unique_ptr; diff --git a/src/test/blobstore/implementations/onblocks/datanodestore/DataNodeViewTest.cpp b/test/implementations/onblocks/datanodestore/DataNodeViewTest.cpp similarity index 93% rename from src/test/blobstore/implementations/onblocks/datanodestore/DataNodeViewTest.cpp rename to test/implementations/onblocks/datanodestore/DataNodeViewTest.cpp index 36098af7..9e79b159 100644 --- a/src/test/blobstore/implementations/onblocks/datanodestore/DataNodeViewTest.cpp +++ b/test/implementations/onblocks/datanodestore/DataNodeViewTest.cpp @@ -1,10 +1,10 @@ -#include -#include +#include "../../../../implementations/onblocks/datanodestore/DataNodeView.h" +#include -#include "blockstore/implementations/testfake/FakeBlockStore.h" -#include "blockstore/implementations/testfake/FakeBlock.h" -#include "blobstore/implementations/onblocks/BlobStoreOnBlocks.h" -#include "test/testutils/DataBlockFixture.h" +#include "messmer/blockstore/implementations/testfake/FakeBlockStore.h" +#include "messmer/blockstore/implementations/testfake/FakeBlock.h" +#include "../../../../implementations/onblocks/BlobStoreOnBlocks.h" +#include "../../../testutils/DataBlockFixture.h" using ::testing::Test; using ::testing::WithParamInterface; diff --git a/src/test/blobstore/implementations/onblocks/datatreestore/DataTreeGrowingTest.cpp b/test/implementations/onblocks/datatreestore/DataTreeGrowingTest.cpp similarity index 96% rename from src/test/blobstore/implementations/onblocks/datatreestore/DataTreeGrowingTest.cpp rename to test/implementations/onblocks/datatreestore/DataTreeGrowingTest.cpp index 36a2b28a..4dbc672b 100644 --- a/src/test/blobstore/implementations/onblocks/datatreestore/DataTreeGrowingTest.cpp +++ b/test/implementations/onblocks/datatreestore/DataTreeGrowingTest.cpp @@ -1,13 +1,13 @@ #include "DataTreeTest.h" -#include "blobstore/implementations/onblocks/datatreestore/DataTree.h" -#include "blobstore/implementations/onblocks/datanodestore/DataLeafNode.h" -#include "blobstore/implementations/onblocks/datanodestore/DataInnerNode.h" -#include "test/testutils/DataBlockFixture.h" +#include "../../../../implementations/onblocks/datatreestore/DataTree.h" +#include "../../../../implementations/onblocks/datanodestore/DataLeafNode.h" +#include "../../../../implementations/onblocks/datanodestore/DataInnerNode.h" +#include "../../../testutils/DataBlockFixture.h" -#include "fspp/utils/pointer.h" +#include "messmer/cpp-utils/pointer.h" -using fspp::dynamic_pointer_move; +using cpputils::dynamic_pointer_move; using blobstore::onblocks::datanodestore::DataNode; using blobstore::onblocks::datanodestore::DataInnerNode; diff --git a/src/test/blobstore/implementations/onblocks/datatreestore/DataTreeTest.h b/test/implementations/onblocks/datatreestore/DataTreeTest.h similarity index 82% rename from src/test/blobstore/implementations/onblocks/datatreestore/DataTreeTest.h rename to test/implementations/onblocks/datatreestore/DataTreeTest.h index c3ca3d70..84354354 100644 --- a/src/test/blobstore/implementations/onblocks/datatreestore/DataTreeTest.h +++ b/test/implementations/onblocks/datatreestore/DataTreeTest.h @@ -2,13 +2,13 @@ #ifndef TEST_BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATATREESTORE_DATATREETEST_H_ #define TEST_BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATATREESTORE_DATATREETEST_H_ -#include "gtest/gtest.h" +#include "google/gtest/gtest.h" -#include "blobstore/implementations/onblocks/datanodestore/DataNodeStore.h" -#include "blobstore/implementations/onblocks/datanodestore/DataInnerNode.h" -#include "blobstore/implementations/onblocks/datanodestore/DataLeafNode.h" -#include "blobstore/implementations/onblocks/datatreestore/DataTree.h" -#include "blockstore/implementations/testfake/FakeBlockStore.h" +#include "../../../../implementations/onblocks/datanodestore/DataNodeStore.h" +#include "../../../../implementations/onblocks/datanodestore/DataInnerNode.h" +#include "../../../../implementations/onblocks/datanodestore/DataLeafNode.h" +#include "../../../../implementations/onblocks/datatreestore/DataTree.h" +#include "messmer/blockstore/implementations/testfake/FakeBlockStore.h" #include diff --git a/src/test/blobstore/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNullTest.cpp b/test/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNullTest.cpp similarity index 93% rename from src/test/blobstore/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNullTest.cpp rename to test/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNullTest.cpp index fdb5f7d5..5cd37db0 100644 --- a/src/test/blobstore/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNullTest.cpp +++ b/test/implementations/onblocks/datatreestore/impl/GetLowestRightBorderNodeWithLessThanKChildrenOrNullTest.cpp @@ -1,9 +1,9 @@ -#include "gtest/gtest.h" +#include "google/gtest/gtest.h" #include "../DataTreeTest.h" -#include "blobstore/implementations/onblocks/datatreestore/DataTree.h" -#include "blobstore/implementations/onblocks/datanodestore/DataLeafNode.h" -#include "blobstore/implementations/onblocks/datanodestore/DataInnerNode.h" +#include "../../../../../implementations/onblocks/datatreestore/DataTree.h" +#include "../../../../../implementations/onblocks/datanodestore/DataLeafNode.h" +#include "../../../../../implementations/onblocks/datanodestore/DataInnerNode.h" using ::testing::Test; using std::unique_ptr; diff --git a/test/main.cpp b/test/main.cpp new file mode 100644 index 00000000..f7a14877 --- /dev/null +++ b/test/main.cpp @@ -0,0 +1,6 @@ +#include "google/gtest/gtest.h" + +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/src/test/testutils/DataBlockFixture.cpp b/test/testutils/DataBlockFixture.cpp similarity index 98% rename from src/test/testutils/DataBlockFixture.cpp rename to test/testutils/DataBlockFixture.cpp index ec50b91c..52c3c6ee 100644 --- a/src/test/testutils/DataBlockFixture.cpp +++ b/test/testutils/DataBlockFixture.cpp @@ -1,4 +1,4 @@ -#include +#include "DataBlockFixture.h" #include #include diff --git a/src/test/testutils/DataBlockFixture.h b/test/testutils/DataBlockFixture.h similarity index 100% rename from src/test/testutils/DataBlockFixture.h rename to test/testutils/DataBlockFixture.h