Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ public async ValueTask<Context> ProcessAsync(Context context) {
```
[→ C# Documentation](./packages/csharp/readme.md)

### ⭐ C++ (Modern Implementation)
**Status**: Complete with typed features and C++20 coroutines

- **Modern C++20**: Full coroutine support with RAII and smart pointers
- **Typed Features**: Opt-in generics for compile-time type safety
- **Performance Optimized**: Zero-cost abstractions and efficient data structures
- **Memory Safe**: RAII principles and smart pointer management
- **CMake Build**: Industry-standard build configuration

[→ C++ Documentation](./packages/cpp/README.md)

### JavaScript/Node.js
```javascript
// Native async/await support
Expand Down
313 changes: 313 additions & 0 deletions packages/cpp/CHAIN_PERFORMANCE_OPTIMIZATION.md

Large diffs are not rendered by default.

90 changes: 90 additions & 0 deletions packages/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
cmake_minimum_required(VERSION 3.20)
project(codeuchain VERSION 1.0.0 LANGUAGES CXX)

# Set C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Find required packages
find_package(Threads REQUIRED)

# Create library
add_library(codeuchain
src/core/context.cpp
src/core/link.cpp
src/core/chain.cpp
src/core/middleware.cpp
src/core/timing_middleware.cpp
src/utils/error_handling.cpp
src/typed_context.cpp
)

# Include directories
target_include_directories(codeuchain
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)

# Link libraries
target_link_libraries(codeuchain
PUBLIC
Threads::Threads
)

# Set compile options
target_compile_options(codeuchain PRIVATE
-Wall
-Wextra
-Wpedantic
-Werror
)

# Install library
install(TARGETS codeuchain
EXPORT codeuchain-targets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

# Install headers
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING PATTERN "*.hpp"
)

# Export targets
install(EXPORT codeuchain-targets
FILE codeuchain-targets.cmake
NAMESPACE codeuchain::
DESTINATION lib/cmake/codeuchain
)

# Create and install config file
include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/codeuchain-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/codeuchain-config.cmake
INSTALL_DESTINATION lib/cmake/codeuchain
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/codeuchain-config.cmake
DESTINATION lib/cmake/codeuchain
)

# Examples
option(BUILD_EXAMPLES "Build examples" ON)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

# Tests
option(BUILD_TESTS "Build tests" ON)
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
Loading