Skip to content
Snippets Groups Projects
Commit 4bd4265e authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

Merge pull request #19 in ASAPO/asapo from Rename-hidra2-to-asapo to develop

* commit '0cd2bf30':
  rename
parents d4a0d235 0cd2bf30
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 52 deletions
#ifndef HIDRA2_LOGGER_H
#define HIDRA2_LOGGER_H
#ifndef ASAPO_LOGGER_H
#define ASAPO_LOGGER_H
#include <memory>
#include <string>
#include "common/error.h"
namespace hidra2 {
namespace asapo {
enum class LogLevel {
None,
......@@ -38,4 +38,4 @@ LogLevel StringToLogLevel(const std::string& name, Error* err);
}
#endif //HIDRA2_LOGGER_H
#endif //ASAPO_LOGGER_H
#ifndef HIDRA2_MOCKDATABASE_H
#define HIDRA2_MOCKDATABASE_H
#ifndef ASAPO_MOCKDATABASE_H
#define ASAPO_MOCKDATABASE_H
#include <gmock/gmock.h>
#include <gtest/gtest.h>
......@@ -7,7 +7,7 @@
#include "database/database.h"
#include "common/error.h"
namespace hidra2 {
namespace asapo {
class MockDatabase : public Database {
public:
......@@ -34,4 +34,4 @@ class MockDatabase : public Database {
}
#endif //HIDRA2_MOCKDATABASE_H
#endif //ASAPO_MOCKDATABASE_H
#ifndef HIDRA2_MOCKHTTPCLIENT_H
#define HIDRA2_MOCKHTTPCLIENT_H
#ifndef ASAPO_MOCKHTTPCLIENT_H
#define ASAPO_MOCKHTTPCLIENT_H
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "http_client/http_client.h"
namespace hidra2 {
namespace asapo {
class MockHttpClient : public HttpClient {
public:
......@@ -32,4 +32,4 @@ class MockHttpClient : public HttpClient {
}
#endif //HIDRA2_MOCKHTTPCLIENT_H
#endif //ASAPO_MOCKHTTPCLIENT_H
#ifndef HIDRA2_COMMON__MOCKIO_H
#define HIDRA2_COMMON__MOCKIO_H
#ifndef ASAPO_COMMON__MOCKIO_H
#define ASAPO_COMMON__MOCKIO_H
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "io/io.h"
namespace hidra2 {
namespace asapo {
class MockIO : public IO {
public:
std::unique_ptr<std::thread> NewThread(std::function<void()> function) const override {
......@@ -157,7 +157,7 @@ class MockIO : public IO {
}
MOCK_CONST_METHOD4(Write_t, size_t(FileDescriptor fd, const void* buf, size_t length, ErrorInterface** err));
void CreateNewDirectory(const std::string& directory_name, hidra2::Error* err) const override {
void CreateNewDirectory(const std::string& directory_name, asapo::Error* err) const override {
ErrorInterface* error = nullptr;
CreateNewDirectory_t(directory_name, &error);
err->reset(error);
......@@ -208,4 +208,4 @@ class MockIO : public IO {
}
#endif //HIDRA2_COMMON__MOCKIO_H
#endif //ASAPO_COMMON__MOCKIO_H
#ifndef HIDRA2_MOCKLOGGER_H
#define HIDRA2_MOCKLOGGER_H
#ifndef ASAPO_MOCKLOGGER_H
#define ASAPO_MOCKLOGGER_H
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "logger/logger.h"
namespace hidra2 {
namespace asapo {
class MockLogger : public AbstractLogger {
public:
......@@ -21,4 +21,4 @@ class MockLogger : public AbstractLogger {
}
#endif //HIDRA2_MOCKLOGGER_H
#endif //ASAPO_MOCKLOGGER_H
......@@ -3,5 +3,5 @@ set(TARGET_NAME common)
set(TEST_SOURCE_FILES ../../unittests/common/test_error.cpp)
set(TEST_LIBRARIES "${TARGET_NAME};system_io")
include_directories(${HIDRA2_CXX_COMMON_INCLUDE_DIR})
include_directories(${ASAPO_CXX_COMMON_INCLUDE_DIR})
add_plain_unit_test(${TARGET_NAME} "${TEST_SOURCE_FILES}" "${TEST_LIBRARIES}")
......@@ -8,7 +8,7 @@ set(SOURCE_FILES
################################
add_library(${TARGET_NAME} OBJECT ${SOURCE_FILES})
target_include_directories(${TARGET_NAME} PUBLIC ${HIDRA2_CXX_COMMON_INCLUDE_DIR}
target_include_directories(${TARGET_NAME} PUBLIC ${ASAPO_CXX_COMMON_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/3d_party/rapidjson/include)
################################
......@@ -17,6 +17,6 @@ target_include_directories(${TARGET_NAME} PUBLIC ${HIDRA2_CXX_COMMON_INCLUDE_DIR
set(TEST_SOURCE_FILES ../../unittests/data_structs/test_data_structs.cpp)
set(TEST_LIBRARIES "${TARGET_NAME};json_parser;system_io")
include_directories(${HIDRA2_CXX_COMMON_INCLUDE_DIR})
include_directories(${ASAPO_CXX_COMMON_INCLUDE_DIR})
gtest(${TARGET_NAME} "${TEST_SOURCE_FILES}" "${TEST_LIBRARIES}")
......@@ -2,7 +2,7 @@
#include "json_parser/json_parser.h"
namespace hidra2 {
namespace asapo {
std::string FileInfo::Json() const {
......
......@@ -13,7 +13,7 @@ message ("-- mongoc libraries \"${MONGOC_STATIC_LIBRARIES}\"")
add_library(${TARGET_NAME} STATIC ${SOURCE_FILES} $<TARGET_OBJECTS:data_structs> $<TARGET_OBJECTS:json_parser> $<TARGET_OBJECTS:system_io>)
target_include_directories(${TARGET_NAME} PUBLIC ${HIDRA2_CXX_COMMON_INCLUDE_DIR}
target_include_directories(${TARGET_NAME} PUBLIC ${ASAPO_CXX_COMMON_INCLUDE_DIR}
PUBLIC "${MONGOC_STATIC_INCLUDE_DIRS}")
target_link_libraries (${TARGET_NAME} PRIVATE "${MONGOC_STATIC_LIBRARIES}")
target_compile_definitions (${TARGET_NAME} PRIVATE "${MONGOC_STATIC_DEFINITIONS}")
#include "database/database.h"
#include "mongodb_client.h"
namespace hidra2 {
namespace asapo {
std::unique_ptr<Database> DatabaseFactory::Create(Error* err) const noexcept {
std::unique_ptr<Database> p = nullptr;
......
#include "mongodb_client.h"
namespace hidra2 {
namespace asapo {
using std::string;
using hidra2::Database;
using asapo::Database;
MongoDbInstance::MongoDbInstance() {
mongoc_init ();
......@@ -78,7 +78,7 @@ Error MongoDBClient::Connect(const string& address, const string& database_name,
}
string MongoDBClient::DBAddress(const string& address) const {
return "mongodb://" + address + "/?appname=hidra2";
return "mongodb://" + address + "/?appname=asapo";
}
void MongoDBClient::CleanUp() {
......
#ifndef HIDRA2_MONGO_DATABASE_H
#define HIDRA2_MONGO_DATABASE_H
#ifndef ASAPO_MONGO_DATABASE_H
#define ASAPO_MONGO_DATABASE_H
#include "mongoc.h"
......@@ -7,7 +7,7 @@
#include "database/database.h"
namespace hidra2 {
namespace asapo {
// An attempt to automize mongoc_init/mongoc_cleanup.
// One has to be carefull with cleanup order - since it is called after main exits
......@@ -56,4 +56,4 @@ class MongoDBClient final : public Database {
}
#endif //HIDRA2_MONGO_DATABASE_H
#endif //ASAPO_MONGO_DATABASE_H
......@@ -11,6 +11,6 @@ add_library(${TARGET_NAME} OBJECT ${SOURCE_FILES})
IF(WIN32)
target_compile_definitions(${TARGET_NAME} PUBLIC -DCURL_STATICLIB)
ENDIF()
target_include_directories(${TARGET_NAME} PUBLIC ${HIDRA2_CXX_COMMON_INCLUDE_DIR} ${CURL_INCLUDE_DIRS})
target_include_directories(${TARGET_NAME} PUBLIC ${ASAPO_CXX_COMMON_INCLUDE_DIR} ${CURL_INCLUDE_DIRS})
......@@ -2,7 +2,7 @@
#include <cstring>
namespace hidra2 {
namespace asapo {
// use CurlHttpClientInstance and static variable to init curl on program start end cleanup on exit
class CurlHttpClientInstance {
......
#ifndef HIDRA2_CURL_HTTP_CLIENT_H
#define HIDRA2_CURL_HTTP_CLIENT_H
#ifndef ASAPO_CURL_HTTP_CLIENT_H
#define ASAPO_CURL_HTTP_CLIENT_H
#include <string>
#include <mutex>
......@@ -7,7 +7,7 @@
#include "http_client/http_client.h"
#include "curl/curl.h"
namespace hidra2 {
namespace asapo {
class CurlHttpClient final : public HttpClient {
public:
......@@ -26,4 +26,4 @@ class CurlHttpClient final : public HttpClient {
}
#endif //HIDRA2_CURL_HTTP_CLIENT_H
#endif //ASAPO_CURL_HTTP_CLIENT_H
#include "curl_http_client.h"
namespace hidra2 {
namespace asapo {
std::unique_ptr<HttpClient> DefaultHttpClient() {
return std::unique_ptr<HttpClient> {new CurlHttpClient};
......
......@@ -8,7 +8,7 @@ set(SOURCE_FILES
################################
add_library(${TARGET_NAME} OBJECT ${SOURCE_FILES})
target_include_directories(${TARGET_NAME} PUBLIC ${HIDRA2_CXX_COMMON_INCLUDE_DIR}
target_include_directories(${TARGET_NAME} PUBLIC ${ASAPO_CXX_COMMON_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/3d_party/rapidjson/include)
################################
......@@ -19,5 +19,5 @@ target_include_directories(${TARGET_NAME} PUBLIC ${HIDRA2_CXX_COMMON_INCLUDE_DIR
set(TEST_SOURCE_FILES ../../unittests/json_parser/test_json_parser.cpp)
set(TEST_LIBRARIES "${TARGET_NAME};system_io")
include_directories(${HIDRA2_CXX_COMMON_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/3d_party/rapidjson/include)
include_directories(${ASAPO_CXX_COMMON_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/3d_party/rapidjson/include)
gtest(${TARGET_NAME} "${TEST_SOURCE_FILES}" "${TEST_LIBRARIES}")
......@@ -2,7 +2,7 @@
#include "rapid_json.h"
#include "io/io_factory.h"
namespace hidra2 {
namespace asapo {
JsonParser::~JsonParser() {
......
......@@ -3,7 +3,7 @@
using namespace rapidjson;
namespace hidra2 {
namespace asapo {
RapidJson::RapidJson(const std::string& json, const std::unique_ptr<IO>* io): io__{io}, json_{json} {
......@@ -36,7 +36,7 @@ Error RapidJson::LazyInitialize()const noexcept {
return nullptr;
}
hidra2::Error CheckValueType(const std::string& name, ValueType type, const Value* val) {
asapo::Error CheckValueType(const std::string& name, ValueType type, const Value* val) {
bool res = false;
switch (type) {
case ValueType::kObject:
......@@ -63,7 +63,7 @@ hidra2::Error CheckValueType(const std::string& name, ValueType type, const Valu
}
hidra2::Error RapidJson::GetValuePointer(const std::string& name, ValueType type, Value** val)const noexcept {
asapo::Error RapidJson::GetValuePointer(const std::string& name, ValueType type, Value** val)const noexcept {
if (Error err = LazyInitialize()) {
return err;
}
......
#ifndef HIDRA2_RAPID_JSON_H
#define HIDRA2_RAPID_JSON_H
#ifndef ASAPO_RAPID_JSON_H
#define ASAPO_RAPID_JSON_H
#include "rapidjson/document.h"
#include "common/error.h"
#include "io/io.h"
namespace hidra2 {
namespace asapo {
enum class ValueType {
kUint64,
......@@ -35,8 +35,8 @@ class RapidJson {
Error LazyInitialize() const noexcept;
Error embedded_error_ = nullptr;
hidra2::Error GetValuePointer(const std::string& name, ValueType type, rapidjson::Value** val)const noexcept;
asapo::Error GetValuePointer(const std::string& name, ValueType type, rapidjson::Value** val)const noexcept;
};
}
#endif //HIDRA2_RAPID_JSON_H
#endif //ASAPO_RAPID_JSON_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment