Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone 4/N: Implement and test stream settings, with API setters and getters #296

Closed
wants to merge 7 commits into from
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_subdirectory(logger)
add_subdirectory(streaming)

if (BUILD_ACQUIRE_DRIVER_ZARR)
add_subdirectory(driver)
endif ()
36 changes: 36 additions & 0 deletions src/streaming/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
set(tgt acquire-zarr)

add_library(${tgt}
macros.hh
stream.settings.hh
stream.settings.cpp
)

target_include_directories(${tgt}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/logger>
)

target_link_libraries(${tgt} PRIVATE
acquire-zarr-logger
blosc_static
miniocpp::miniocpp
)

set_target_properties(${tgt} PROPERTIES
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
)

install(TARGETS ${tgt}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

# Install public header files
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
DESTINATION include
FILES_MATCHING PATTERN "*.h"
)
28 changes: 28 additions & 0 deletions src/streaming/macros.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

#include "logger.hh"

#define EXPECT(e, ...) \
do { \
if (!(e)) { \
const std::string __err = LOG_ERROR(__VA_ARGS__); \
throw std::runtime_error(__err); \
} \
} while (0)
#define CHECK(e) EXPECT(e, "Expression evaluated as false:\n\t%s", #e)

#define EXPECT_VALID_ARGUMENT(e, ...) \
do { \
if (!(e)) { \
LOG_ERROR(__VA_ARGS__); \
return ZarrStatus_InvalidArgument; \
} \
} while (0)

#define EXPECT_VALID_INDEX(e, ...) \
do { \
if (!(e)) { \
LOG_ERROR(__VA_ARGS__); \
return ZarrStatus_InvalidIndex; \
} \
} while (0)
Loading