Compare commits

..

37 Commits

Author SHA1 Message Date
Ed Hennis
a8c03e2e6c Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-02-03 16:08:06 -04:00
Ed Hennis
2167a66bc7 Fix formatting 2026-01-28 19:39:15 -05:00
Ed Hennis
ed948a858c Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-28 18:49:15 -04:00
Ed Hennis
608c102743 Merge commit '5f638f55536def0d88b970d1018a465a238e55f4' into ximinez/acquireAsyncDispatch
* commit '5f638f55536def0d88b970d1018a465a238e55f4':
  chore: Set ColumnLimit to 120 in clang-format (6288)
2026-01-28 17:47:53 -05:00
Ed Hennis
36d1607a4e Merge commit '92046785d1fea5f9efe5a770d636792ea6cab78b' into ximinez/acquireAsyncDispatch
* commit '92046785d1fea5f9efe5a770d636792ea6cab78b':
  test: Fix the `xrpl.net` unit test using async read (6241)
  ci: Upload Conan recipes for develop, release candidates, and releases (6286)
  fix: Stop embedded tests from hanging on ARM by using `atomic_flag` (6248)
  fix:  Remove DEFAULT fields that change to the default in associateAsset (6259) (6273)
  refactor: Update Boost to 1.90 (6280)
  refactor: clean up uses of `std::source_location` (6272)
  ci: Pass missing sanitizers input to actions (6266)
  ci: Properly propagate Conan credentials (6265)
  ci: Explicitly set version when exporting the Conan recipe (6264)
  ci: Use plus instead of hyphen for Conan recipe version suffix (6261)
  chore: Detect uninitialized variables in CMake files (6247)
  ci: Run on-trigger and on-pr when generate-version is modified (6257)
  refactor: Enforce 15-char limit and simplify labels for thread naming (6212)
  docs: Update Ripple Bug Bounty public key (6258)
  ci: Add missing commit hash to Conan recipe version (6256)
  fix: Include `<functional>` header in `Number.h` (6254)
  ci: Upload Conan recipe for merges into develop and commits to release (6235)
  Limit reply size on `TMGetObjectByHash` queries (6110)
  ci: remove 'master' branch as a trigger (6234)
  Improve ledger_entry lookups for fee, amendments, NUNL, and hashes (5644)
2026-01-28 17:47:47 -05:00
Ed Hennis
53ebb86d60 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-15 13:03:36 -04:00
Ed Hennis
1d989bc6de Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-15 12:06:00 -04:00
Ed Hennis
64c0cb8c7e Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-13 18:19:11 -04:00
Ed Hennis
c77cfef41c Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-13 15:28:01 -04:00
Ed Hennis
08aa8c06d1 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-12 14:52:16 -04:00
Ed Hennis
9498672f8e Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-11 00:50:43 -04:00
Ed Hennis
e91d55a0e0 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-08 17:06:11 -04:00
Ed Hennis
afdc452cfc Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-08 13:04:20 -04:00
Ed Hennis
a0d4ef1a54 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2026-01-06 14:02:15 -05:00
Ed Hennis
8bc384f8bf Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-12-22 17:39:59 -05:00
Ed Hennis
bd961c484b Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-12-18 19:59:52 -05:00
Ed Hennis
aee242a8d4 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-12-12 20:34:59 -05:00
Ed Hennis
fcae74de58 Merge remote-tracking branch 'XRPLF/develop' into ximinez/acquireAsyncDispatch
* XRPLF/develop:
  refactor: Rename `ripple` namespace to `xrpl` (5982)
  refactor: Move JobQueue and related classes into xrpl.core module (6121)
  refactor: Rename `rippled` binary to `xrpld` (5983)
  refactor: rename info() to header() (6138)
  refactor: rename `LedgerInfo` to `LedgerHeader` (6136)
  refactor: clean up `RPCHelpers` (5684)
  chore: Fix docs readme and cmake (6122)
  chore: Clean up .gitignore and .gitattributes (6001)
  chore: Use updated secp256k1 recipe (6118)
2025-12-11 15:33:12 -05:00
Ed Hennis
a56effcb00 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-12-05 21:13:10 -05:00
Ed Hennis
64c2eca465 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-12-02 17:37:29 -05:00
Ed Hennis
e56f750e1d Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-12-01 14:40:45 -05:00
Ed Hennis
fde000f3eb Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-28 15:46:44 -05:00
Ed Hennis
d0a62229da Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-27 01:48:56 -05:00
Ed Hennis
d5932cc7d4 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-26 00:25:17 -05:00
Ed Hennis
0b534da781 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-25 14:55:06 -05:00
Ed Hennis
71a70d343b Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-24 21:49:11 -05:00
Ed Hennis
0899e65030 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-24 21:30:22 -05:00
Ed Hennis
31ba529761 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-21 12:47:58 -05:00
Ed Hennis
e2c6e5ebb6 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-18 22:39:29 -05:00
Ed Hennis
9d807fce48 Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-15 03:08:41 -05:00
Ed Hennis
9ef160765c Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-13 12:19:21 -05:00
Ed Hennis
d6c0eb243b Merge branch 'develop' into ximinez/acquireAsyncDispatch 2025-11-12 14:12:55 -05:00
Ed Hennis
84c9fc123c Fix formatting 2025-11-10 19:53:05 -05:00
Ed Hennis
00a2a58cfa Add missing header 2025-11-10 19:53:05 -05:00
Ed Hennis
bb2098d873 Add a unit test for CanProcess
- Delete the copy ctor & operator
2025-11-10 19:53:05 -05:00
Ed Hennis
46a5bc74db refactor: acquireAsync will dispatch the job, not the other way around 2025-11-10 19:53:05 -05:00
Ed Hennis
7b72b9cc82 Improve job queue collision checks and logging
- Improve logging related to ledger acquisition and operating mode
  changes
- Class "CanProcess" to keep track of processing of distinct items
2025-11-10 19:53:05 -05:00
698 changed files with 3159 additions and 982 deletions

View File

@@ -1,30 +0,0 @@
#!/bin/bash
# Exit the script as soon as an error occurs.
set -e
# This script checks whether there are no new include guards introduced by a new
# PR, as header files should use "#pragma once" instead. The script assumes any
# include guards will use "XRPL_" as prefix.
# Usage: .github/scripts/rename/include.sh <repository directory>
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <repository directory>"
exit 1
fi
DIRECTORY=$1
echo "Processing directory: ${DIRECTORY}"
if [ ! -d "${DIRECTORY}" ]; then
echo "Error: Directory '${DIRECTORY}' does not exist."
exit 1
fi
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" \) | while read -r FILE; do
echo "Processing file: ${FILE}"
if grep -q "#ifndef XRPL_" "${FILE}"; then
echo "Please replace all include guards by #pragma once."
exit 1
fi
done
echo "Checking complete."

View File

@@ -51,20 +51,22 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
# Only generate a subset of configurations in PRs.
if not all:
# Debian:
# - Bookworm using GCC 13: Release on linux/amd64, set the reference
# fee to 500.
# - Bookworm using GCC 15: Debug on linux/amd64, enable code
# coverage (which will be done below).
# - Bookworm using Clang 16: Debug on linux/arm64, enable voidstar.
# - Bookworm using Clang 17: Release on linux/amd64, set the
# reference fee to 1000.
# - Bookworm using Clang 20: Debug on linux/amd64.
# - Bookworm using GCC 13: Release and Unity on linux/amd64, set
# the reference fee to 500.
# - Bookworm using GCC 15: Debug and no Unity on linux/amd64, enable
# code coverage (which will be done below).
# - Bookworm using Clang 16: Debug and no Unity on linux/arm64,
# enable voidstar.
# - Bookworm using Clang 17: Release and no Unity on linux/amd64,
# set the reference fee to 1000.
# - Bookworm using Clang 20: Debug and Unity on linux/amd64.
if os["distro_name"] == "debian":
skip = True
if os["distro_version"] == "bookworm":
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-13"
and build_type == "Release"
and "-Dunity=ON" in cmake_args
and architecture["platform"] == "linux/amd64"
):
cmake_args = f"-DUNIT_TEST_REFERENCE_FEE=500 {cmake_args}"
@@ -72,12 +74,14 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-15"
and build_type == "Debug"
and "-Dunity=OFF" in cmake_args
and architecture["platform"] == "linux/amd64"
):
skip = False
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "clang-16"
and build_type == "Debug"
and "-Dunity=OFF" in cmake_args
and architecture["platform"] == "linux/arm64"
):
cmake_args = f"-Dvoidstar=ON {cmake_args}"
@@ -85,6 +89,7 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "clang-17"
and build_type == "Release"
and "-Dunity=ON" in cmake_args
and architecture["platform"] == "linux/amd64"
):
cmake_args = f"-DUNIT_TEST_REFERENCE_FEE=1000 {cmake_args}"
@@ -92,6 +97,7 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "clang-20"
and build_type == "Debug"
and "-Dunity=ON" in cmake_args
and architecture["platform"] == "linux/amd64"
):
skip = False
@@ -99,14 +105,15 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
continue
# RHEL:
# - 9 using GCC 12: Debug on linux/amd64.
# - 10 using Clang: Release on linux/amd64.
# - 9 using GCC 12: Debug and Unity on linux/amd64.
# - 10 using Clang: Release and no Unity on linux/amd64.
if os["distro_name"] == "rhel":
skip = True
if os["distro_version"] == "9":
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-12"
and build_type == "Debug"
and "-Dunity=ON" in cmake_args
and architecture["platform"] == "linux/amd64"
):
skip = False
@@ -114,6 +121,7 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "clang-any"
and build_type == "Release"
and "-Dunity=OFF" in cmake_args
and architecture["platform"] == "linux/amd64"
):
skip = False
@@ -121,16 +129,17 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
continue
# Ubuntu:
# - Jammy using GCC 12: Debug on linux/arm64.
# - Noble using GCC 14: Release on linux/amd64.
# - Noble using Clang 18: Debug on linux/amd64.
# - Noble using Clang 19: Release on linux/arm64.
# - Jammy using GCC 12: Debug and no Unity on linux/arm64.
# - Noble using GCC 14: Release and Unity on linux/amd64.
# - Noble using Clang 18: Debug and no Unity on linux/amd64.
# - Noble using Clang 19: Release and Unity on linux/arm64.
if os["distro_name"] == "ubuntu":
skip = True
if os["distro_version"] == "jammy":
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-12"
and build_type == "Debug"
and "-Dunity=OFF" in cmake_args
and architecture["platform"] == "linux/arm64"
):
skip = False
@@ -138,18 +147,21 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-14"
and build_type == "Release"
and "-Dunity=ON" in cmake_args
and architecture["platform"] == "linux/amd64"
):
skip = False
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "clang-18"
and build_type == "Debug"
and "-Dunity=OFF" in cmake_args
and architecture["platform"] == "linux/amd64"
):
skip = False
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "clang-19"
and build_type == "Release"
and "-Dunity=ON" in cmake_args
and architecture["platform"] == "linux/arm64"
):
skip = False
@@ -157,16 +169,20 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
continue
# MacOS:
# - Debug on macos/arm64.
# - Debug and no Unity on macos/arm64.
if os["distro_name"] == "macos" and not (
build_type == "Debug" and architecture["platform"] == "macos/arm64"
build_type == "Debug"
and "-Dunity=OFF" in cmake_args
and architecture["platform"] == "macos/arm64"
):
continue
# Windows:
# - Release on windows/amd64.
# - Release and Unity on windows/amd64.
if os["distro_name"] == "windows" and not (
build_type == "Release" and architecture["platform"] == "windows/amd64"
build_type == "Release"
and "-Dunity=ON" in cmake_args
and architecture["platform"] == "windows/amd64"
):
continue
@@ -193,17 +209,18 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
):
continue
# Enable code coverage for Debian Bookworm using GCC 15 in Debug on
# linux/amd64
# Enable code coverage for Debian Bookworm using GCC 15 in Debug and no
# Unity on linux/amd64
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-15"
and build_type == "Debug"
and "-Dunity=OFF" in cmake_args
and architecture["platform"] == "linux/amd64"
):
cmake_args = f"-Dcoverage=ON -Dcoverage_format=xml -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_C_FLAGS=-O0 -DCMAKE_CXX_FLAGS=-O0 {cmake_args}"
# Generate a unique name for the configuration, e.g. macos-arm64-debug
# or debian-bookworm-gcc-12-amd64-release.
# or debian-bookworm-gcc-12-amd64-release-unity.
config_name = os["distro_name"]
if (n := os["distro_version"]) != "":
config_name += f"-{n}"
@@ -217,6 +234,8 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
config_name += f"-{build_type.lower()}"
if "-Dcoverage=ON" in cmake_args:
config_name += "-coverage"
if "-Dunity=ON" in cmake_args:
config_name += "-unity"
# Add the configuration to the list, with the most unique fields first,
# so that they are easier to identify in the GitHub Actions UI, as long

View File

@@ -208,5 +208,5 @@
}
],
"build_type": ["Debug", "Release"],
"cmake_args": [""]
"cmake_args": ["-Dunity=OFF", "-Dunity=ON"]
}

View File

@@ -15,5 +15,8 @@
}
],
"build_type": ["Debug", "Release"],
"cmake_args": ["-DCMAKE_POLICY_VERSION_MINIMUM=3.5"]
"cmake_args": [
"-Dunity=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5",
"-Dunity=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5"
]
}

View File

@@ -15,5 +15,5 @@
}
],
"build_type": ["Debug", "Release"],
"cmake_args": [""]
"cmake_args": ["-Dunity=OFF", "-Dunity=ON"]
}

View File

@@ -31,8 +31,6 @@ jobs:
run: .github/scripts/rename/namespace.sh .
- name: Check config name
run: .github/scripts/rename/config.sh .
- name: Check include guards
run: .github/scripts/rename/include.sh .
- name: Check for differences
env:
MESSAGE: |

View File

@@ -368,36 +368,6 @@ The workaround for this error is to add two lines to your profile:
tools.build:cxxflags=['-DBOOST_ASIO_DISABLE_CONCEPTS']
```
### Set Up Ccache
To speed up repeated compilations, we recommend that you install
[ccache](https://ccache.dev), a tool that wraps your compiler so that it can
cache build objects locally.
#### Linux
You can install it using the package manager, e.g. `sudo apt install ccache`
(Ubuntu) or `sudo dnf install ccache` (RHEL).
#### macOS
You can install it using Homebrew, i.e. `brew install ccache`.
#### Windows
You can install it using Chocolatey, i.e. `choco install ccache`. If you already
have Ccache installed, then `choco upgrade ccache` will update it to the latest
version. However, if you see an error such as:
```
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(617,5): error MSB6006: "cl.exe" exited with code 3.
```
then please install a specific version of Ccache that we know works, via: `choco
install ccache --version 4.11.3 --allow-downgrade`.
### Build and Test
1. Create a build directory and move into it.
@@ -575,10 +545,16 @@ See [Sanitizers docs](./docs/build/sanitizers.md) for more details.
| `assert` | OFF | Enable assertions. |
| `coverage` | OFF | Prepare the coverage report. |
| `tests` | OFF | Build tests. |
| `unity` | OFF | Configure a unity build. |
| `xrpld` | OFF | Build the xrpld application, and not just the libxrpl library. |
| `werr` | OFF | Treat compilation warnings as errors |
| `wextra` | OFF | Enable additional compilation warnings |
[Unity builds][5] may be faster for the first build
(at the cost of much more memory) since they concatenate sources into fewer
translation units. Non-unity builds may be faster for incremental builds,
and can be helpful for detecting `#include` omissions.
## Troubleshooting
### Conan
@@ -645,6 +621,7 @@ If you want to experiment with a new package, follow these steps:
[1]: https://github.com/conan-io/conan-center-index/issues/13168
[2]: https://en.cppreference.com/w/cpp/compiler_support/20
[3]: https://docs.conan.io/en/latest/getting_started.html
[5]: https://en.wikipedia.org/wiki/Unity_build
[6]: https://github.com/boostorg/beast/issues/2648
[7]: https://github.com/boostorg/beast/issues/2661
[gcovr]: https://gcovr.com/en/stable/getting-started.html

View File

@@ -9,5 +9,8 @@ function (xrpl_add_test name)
isolate_headers(${target} "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests/${name}" PRIVATE)
# Make sure the test isn't optimized away in unity builds
set_target_properties(${target} PROPERTIES UNITY_BUILD_MODE GROUP UNITY_BUILD_BATCH_SIZE 0) # Adjust as needed
add_test(NAME ${target} COMMAND ${target})
endfunction ()

View File

@@ -4,7 +4,12 @@
include(target_protobuf_sources)
# Protocol buffers cannot participate in a unity build,
# because all the generated sources
# define a bunch of `static const` variables with the same names,
# so we just build them as a separate library.
add_library(xrpl.libpb)
set_target_properties(xrpl.libpb PROPERTIES UNITY_BUILD OFF)
target_protobuf_sources(xrpl.libpb xrpl/proto LANGUAGE cpp IMPORT_DIRS include/xrpl/proto
PROTOS include/xrpl/proto/xrpl.proto)
@@ -155,4 +160,12 @@ if (xrpld)
# antithesis_instrumentation.h, which is not exported as INTERFACE
target_include_directories(xrpld PRIVATE ${CMAKE_SOURCE_DIR}/external/antithesis-sdk)
endif ()
# any files that don't play well with unity should be added here
if (tests)
set_source_files_properties(
# these two seem to produce conflicts in beast teardown template methods
src/test/rpc/ValidatorRPC_test.cpp src/test/ledger/Invariants_test.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION
TRUE)
endif ()
endif ()

View File

@@ -30,6 +30,14 @@ if (tests)
endif ()
endif ()
option(unity "Creates a build using UNITY support in cmake." OFF)
if (unity)
if (NOT is_ci)
set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
endif ()
set(CMAKE_UNITY_BUILD ON CACHE BOOL "Do a unity build")
endif ()
if (is_clang AND is_linux)
option(voidstar "Enable Antithesis instrumentation." OFF)
endif ()

View File

@@ -23,6 +23,7 @@ class Xrpl(ConanFile):
"shared": [True, False],
"static": [True, False],
"tests": [True, False],
"unity": [True, False],
"xrpld": [True, False],
}
@@ -54,6 +55,7 @@ class Xrpl(ConanFile):
"shared": False,
"static": True,
"tests": False,
"unity": False,
"xrpld": False,
"date/*:header_only": True,
"ed25519/*:shared": False,
@@ -166,6 +168,7 @@ class Xrpl(ConanFile):
tc.variables["rocksdb"] = self.options.rocksdb
tc.variables["BUILD_SHARED_LIBS"] = self.options.shared
tc.variables["static"] = self.options.static
tc.variables["unity"] = self.options.unity
tc.variables["xrpld"] = self.options.xrpld
tc.generate()

View File

@@ -1,139 +0,0 @@
#!/usr/bin/env python3
"""
Script to replace include guards with #pragma once
Handles guards starting with XRPL_, BEAST_, or TEST_
"""
import sys
from pathlib import Path
def convert_file(file_path, prefixes=None):
"""
Convert a file from include guards to #pragma once
Args:
file_path: Path to the file to convert
prefixes: List of prefixes to match (e.g., ['XRPL_', 'BEAST_', 'TEST_'])
If None, defaults to ['XRPL_', 'BEAST_', 'TEST_']
Returns True if the file was modified, False otherwise
"""
if prefixes is None:
prefixes = ["XRPL_", "BEAST_", "TEST_"]
try:
with open(file_path, "r", encoding="utf-8") as f:
lines = f.readlines()
except Exception as e:
print(f"Error reading {file_path}: {e}", file=sys.stderr)
return False
if len(lines) < 3:
print(f"Skipping {file_path}: too few lines", file=sys.stderr)
return False
# Find the #ifndef with any of the specified prefixes
ifndef_idx = -1
define_idx = -1
found_prefix = None
for i, line in enumerate(lines):
stripped = line.strip()
for prefix in prefixes:
if stripped.startswith(f"#ifndef {prefix}"):
ifndef_idx = i
found_prefix = prefix
# The #define should be the next line
if i + 1 < len(lines) and lines[i + 1].strip().startswith(
f"#define {prefix}"
):
define_idx = i + 1
break
if ifndef_idx != -1:
break
if ifndef_idx == -1 or define_idx == -1:
print(
f"No include guard with prefixes {prefixes} found in {file_path}",
file=sys.stderr,
)
return False
# Find the last #endif line
endif_idx = -1
for i in range(len(lines) - 1, -1, -1):
stripped = lines[i].strip()
if stripped.startswith("#endif"):
endif_idx = i
break
if endif_idx == -1:
print(f"No closing #endif found in {file_path}", file=sys.stderr)
return False
# Build the new content
new_lines = []
# Add everything before the #ifndef
new_lines.extend(lines[:ifndef_idx])
# Add #pragma once with exactly one empty line after it
new_lines.append("#pragma once\n")
new_lines.append("\n")
# Add everything between #define and #endif, but skip leading empty lines
content_lines = lines[define_idx + 1 : endif_idx]
# Skip leading empty lines
start_idx = 0
while start_idx < len(content_lines) and content_lines[start_idx].strip() == "":
start_idx += 1
new_lines.extend(content_lines[start_idx:])
# Add everything after #endif (usually just empty lines, but include it)
new_lines.extend(lines[endif_idx + 1 :])
# Remove trailing empty lines at the end, then ensure exactly one newline at end
while new_lines and new_lines[-1].strip() == "":
new_lines.pop()
if new_lines and not new_lines[-1].endswith("\n"):
new_lines[-1] += "\n"
else:
new_lines.append("\n")
# Write the file
try:
with open(file_path, "w", encoding="utf-8") as f:
f.writelines(new_lines)
print(f"Converted: {file_path}")
return True
except Exception as e:
print(f"Error writing {file_path}: {e}", file=sys.stderr)
return False
def main():
if len(sys.argv) < 2:
print("Usage: python convert_include_guards.py <file1> [file2 ...]")
sys.exit(1)
files = sys.argv[1:]
success_count = 0
fail_count = 0
for file_path in files:
if convert_file(file_path):
success_count += 1
else:
fail_count += 1
print(
f"\nSummary: {success_count} files converted, {fail_count} files failed/unchanged"
)
return 0 if fail_count == 0 else 1
if __name__ == "__main__":
sys.exit(main())

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_ARCHIVE_H_INCLUDED
#define XRPL_BASICS_ARCHIVE_H_INCLUDED
#include <boost/filesystem.hpp>
@@ -15,3 +16,5 @@ void
extractTarLz4(boost::filesystem::path const& src, boost::filesystem::path const& dst);
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_BASICCONFIG_H_INCLUDED
#define XRPL_BASICS_BASICCONFIG_H_INCLUDED
#include <xrpl/basics/contract.h>
@@ -368,3 +369,5 @@ get_if_exists<bool>(Section const& section, std::string const& name, bool& v)
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_BLOB_H_INCLUDED
#define XRPL_BASICS_BLOB_H_INCLUDED
#include <vector>
@@ -10,3 +11,5 @@ namespace xrpl {
using Blob = std::vector<unsigned char>;
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_BUFFER_H_INCLUDED
#define XRPL_BASICS_BUFFER_H_INCLUDED
#include <xrpl/basics/Slice.h>
#include <xrpl/beast/utility/instrumentation.h>
@@ -212,3 +213,5 @@ operator!=(Buffer const& lhs, Buffer const& rhs) noexcept
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_BYTEUTILITIES_H_INCLUDED
#define XRPL_BASICS_BYTEUTILITIES_H_INCLUDED
namespace xrpl {
@@ -19,3 +20,5 @@ megabytes(T value) noexcept
static_assert(kilobytes(2) == 2048, "kilobytes(2) == 2048");
static_assert(megabytes(3) == 3145728, "megabytes(3) == 3145728");
} // namespace xrpl
#endif

View File

@@ -0,0 +1,138 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2024 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_BASICS_CANPROCESS_H_INCLUDED
#define RIPPLE_BASICS_CANPROCESS_H_INCLUDED
#include <functional>
#include <mutex>
#include <set>
/** RAII class to check if an Item is already being processed on another thread,
* as indicated by it's presence in a Collection.
*
* If the Item is not in the Collection, it will be added under lock in the
* ctor, and removed under lock in the dtor. The object will be considered
* "usable" and evaluate to `true`.
*
* If the Item is in the Collection, no changes will be made to the collection,
* and the CanProcess object will be considered "unusable".
*
* It's up to the caller to decide what "usable" and "unusable" mean. (e.g.
* Process or skip a block of code, or set a flag.)
*
* The current use is to avoid lock contention that would be involved in
* processing something associated with the Item.
*
* Examples:
*
* void IncomingLedgers::acquireAsync(LedgerHash const& hash, ...)
* {
* if (CanProcess check{acquiresMutex_, pendingAcquires_, hash})
* {
* acquire(hash, ...);
* }
* }
*
* bool
* NetworkOPsImp::recvValidation(
* std::shared_ptr<STValidation> const& val,
* std::string const& source)
* {
* CanProcess check(
* validationsMutex_, pendingValidations_, val->getLedgerHash());
* BypassAccept bypassAccept =
* check ? BypassAccept::no : BypassAccept::yes;
* handleNewValidation(app_, val, source, bypassAccept, m_journal);
* }
*
*/
class CanProcess
{
public:
template <class Mutex, class Collection, class Item>
CanProcess(Mutex& mtx, Collection& collection, Item const& item) : cleanup_(insert(mtx, collection, item))
{
}
~CanProcess()
{
if (cleanup_)
cleanup_();
}
CanProcess(CanProcess const&) = delete;
CanProcess&
operator=(CanProcess const&) = delete;
explicit
operator bool() const
{
return static_cast<bool>(cleanup_);
}
private:
template <bool useIterator, class Mutex, class Collection, class Item>
std::function<void()>
doInsert(Mutex& mtx, Collection& collection, Item const& item)
{
std::unique_lock<Mutex> lock(mtx);
// TODO: Use structured binding once LLVM 16 is the minimum supported
// version. See also: https://github.com/llvm/llvm-project/issues/48582
// https://github.com/llvm/llvm-project/commit/127bf44385424891eb04cff8e52d3f157fc2cb7c
auto const insertResult = collection.insert(item);
auto const it = insertResult.first;
if (!insertResult.second)
return {};
if constexpr (useIterator)
return [&, it]() {
std::unique_lock<Mutex> lock(mtx);
collection.erase(it);
};
else
return [&]() {
std::unique_lock<Mutex> lock(mtx);
collection.erase(item);
};
}
// Generic insert() function doesn't use iterators because they may get
// invalidated
template <class Mutex, class Collection, class Item>
std::function<void()>
insert(Mutex& mtx, Collection& collection, Item const& item)
{
return doInsert<false>(mtx, collection, item);
}
// Specialize insert() for std::set, which does not invalidate iterators for
// insert and erase
template <class Mutex, class Item>
std::function<void()>
insert(Mutex& mtx, std::set<Item>& collection, Item const& item)
{
return doInsert<true>(mtx, collection, item);
}
// If set, then the item is "usable"
std::function<void()> cleanup_;
};
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_COMPRESSIONALGORITHMS_H_INCLUDED
#define XRPL_COMPRESSIONALGORITHMS_H_INCLUDED
#include <xrpl/basics/contract.h>
@@ -132,3 +133,5 @@ lz4Decompress(InputStream& in, std::size_t inSize, std::uint8_t* decompressed, s
} // namespace compression_algorithms
} // namespace xrpl
#endif // XRPL_COMPRESSIONALGORITHMS_H_INCLUDED

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_COUNTEDOBJECT_H_INCLUDED
#define XRPL_BASICS_COUNTEDOBJECT_H_INCLUDED
#include <xrpl/beast/type_name.h>
@@ -133,3 +134,5 @@ public:
};
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_DECAYINGSAMPLE_H_INCLUDED
#define XRPL_BASICS_DECAYINGSAMPLE_H_INCLUDED
#include <chrono>
#include <cmath>
@@ -129,3 +130,5 @@ private:
};
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_EXPECTED_H_INCLUDED
#define XRPL_BASICS_EXPECTED_H_INCLUDED
#include <xrpl/basics/contract.h>
@@ -228,3 +229,5 @@ public:
};
} // namespace xrpl
#endif // XRPL_BASICS_EXPECTED_H_INCLUDED

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_FILEUTILITIES_H_INCLUDED
#define XRPL_BASICS_FILEUTILITIES_H_INCLUDED
#include <boost/filesystem.hpp>
#include <boost/system/error_code.hpp>
@@ -17,3 +18,5 @@ void
writeFileContents(boost::system::error_code& ec, boost::filesystem::path const& destPath, std::string const& contents);
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_INTRUSIVEPOINTER_H_INCLUDED
#define XRPL_BASICS_INTRUSIVEPOINTER_H_INCLUDED
#include <concepts>
#include <cstdint>
@@ -484,3 +485,4 @@ dynamic_pointer_cast(TT const& v)
}
} // namespace intr_ptr
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_INTRUSIVEPOINTER_IPP_INCLUDED
#define XRPL_BASICS_INTRUSIVEPOINTER_IPP_INCLUDED
#include <xrpl/basics/IntrusivePointer.h>
#include <xrpl/basics/IntrusiveRefCounts.h>
@@ -702,3 +703,4 @@ SharedWeakUnion<T>::unsafeReleaseNoStore()
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_INTRUSIVEREFCOUNTS_H_INCLUDED
#define XRPL_BASICS_INTRUSIVEREFCOUNTS_H_INCLUDED
#include <xrpl/beast/utility/instrumentation.h>
@@ -460,3 +461,4 @@ partialDestructorFinished(T** o)
//------------------------------------------------------------------------------
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_KEYCACHE_H
#define XRPL_BASICS_KEYCACHE_H
#include <xrpl/basics/TaggedCache.h>
#include <xrpl/basics/base_uint.h>
@@ -8,3 +9,5 @@ namespace xrpl {
using KeyCache = TaggedCache<uint256, int, true>;
} // namespace xrpl
#endif // XRPL_BASICS_KEYCACHE_H

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_LOCALVALUE_H_INCLUDED
#define XRPL_BASICS_LOCALVALUE_H_INCLUDED
#include <boost/thread/tss.hpp>
@@ -106,3 +107,5 @@ LocalValue<T>::operator*()
lvs->values.emplace(this, std::make_unique<detail::LocalValues::Value<T>>(t_)).first->second->get());
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_LOG_H_INCLUDED
#define XRPL_BASICS_LOG_H_INCLUDED
#include <xrpl/basics/UnorderedContainers.h>
#include <xrpl/beast/utility/Journal.h>
@@ -257,3 +258,5 @@ beast::Journal
debugLog();
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_MATHUTILITIES_H_INCLUDED
#define XRPL_BASICS_MATHUTILITIES_H_INCLUDED
#include <algorithm>
#include <cassert>
@@ -44,3 +45,5 @@ static_assert(calculatePercent(50'000'001, 100'000'000) == 51);
static_assert(calculatePercent(99'999'999, 100'000'000) == 100);
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_NUMBER_H_INCLUDED
#define XRPL_BASICS_NUMBER_H_INCLUDED
#include <xrpl/beast/utility/instrumentation.h>
@@ -818,3 +819,5 @@ public:
};
} // namespace xrpl
#endif // XRPL_BASICS_NUMBER_H_INCLUDED

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_RANGESET_H_INCLUDED
#define XRPL_BASICS_RANGESET_H_INCLUDED
#include <xrpl/beast/core/LexicalCast.h>
@@ -172,3 +173,5 @@ prevMissing(RangeSet<T> const& rs, T t, T minVal = 0)
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_RESOLVER_H_INCLUDED
#define XRPL_BASICS_RESOLVER_H_INCLUDED
#include <xrpl/beast/net/IPEndpoint.h>
@@ -44,3 +45,5 @@ public:
};
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_RESOLVERASIO_H_INCLUDED
#define XRPL_BASICS_RESOLVERASIO_H_INCLUDED
#include <xrpl/basics/Resolver.h>
#include <xrpl/beast/utility/Journal.h>
@@ -17,3 +18,5 @@ public:
};
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_SHAMAP_HASH_H_INCLUDED
#define XRPL_BASICS_SHAMAP_HASH_H_INCLUDED
#include <xrpl/basics/base_uint.h>
#include <xrpl/basics/partitioned_unordered_map.h>
@@ -97,3 +98,5 @@ extract(SHAMapHash const& key)
}
} // namespace xrpl
#endif // XRPL_BASICS_SHAMAP_HASH_H_INCLUDED

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_SHAREDWEAKCACHEPOINTER_H_INCLUDED
#define XRPL_BASICS_SHAREDWEAKCACHEPOINTER_H_INCLUDED
#include <memory>
#include <variant>
@@ -112,3 +113,4 @@ private:
std::variant<std::shared_ptr<T>, std::weak_ptr<T>> combo_;
};
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_SHAREDWEAKCACHEPOINTER_IPP_INCLUDED
#define XRPL_BASICS_SHAREDWEAKCACHEPOINTER_IPP_INCLUDED
#include <xrpl/basics/SharedWeakCachePointer.h>
@@ -163,3 +164,4 @@ SharedWeakCachePointer<T>::convertToWeak()
return false;
}
} // namespace xrpl
#endif

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2022, Nikolaos D. Bougalis <nikb@bougalis.net>
#pragma once
#ifndef XRPL_BASICS_SLABALLOCATOR_H_INCLUDED
#define XRPL_BASICS_SLABALLOCATOR_H_INCLUDED
#include <xrpl/basics/ByteUtilities.h>
#include <xrpl/beast/type_name.h>
@@ -385,3 +386,5 @@ public:
};
} // namespace xrpl
#endif // XRPL_BASICS_SLABALLOCATOR_H_INCLUDED

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_SLICE_H_INCLUDED
#define XRPL_BASICS_SLICE_H_INCLUDED
#include <xrpl/basics/contract.h>
#include <xrpl/basics/strHex.h>
@@ -230,3 +231,5 @@ makeSlice(std::basic_string<char, Traits, Alloc> const& s)
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_STRINGUTILITIES_H_INCLUDED
#define XRPL_BASICS_STRINGUTILITIES_H_INCLUDED
#include <xrpl/basics/Blob.h>
#include <xrpl/basics/strHex.h>
@@ -131,3 +132,5 @@ bool
isProperlyFormedTomlDomain(std::string_view domain);
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_TAGGEDCACHE_H_INCLUDED
#define XRPL_BASICS_TAGGEDCACHE_H_INCLUDED
#include <xrpl/basics/IntrusivePointer.h>
#include <xrpl/basics/Log.h>
@@ -297,3 +298,5 @@ private:
};
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_TAGGEDCACHE_IPP_INCLUDED
#define XRPL_BASICS_TAGGEDCACHE_IPP_INCLUDED
#include <xrpl/basics/IntrusivePointer.ipp>
#include <xrpl/basics/TaggedCache.h>
@@ -783,3 +784,5 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_TOSTRING_H_INCLUDED
#define XRPL_BASICS_TOSTRING_H_INCLUDED
#include <string>
#include <type_traits>
@@ -43,3 +44,5 @@ to_string(char const* s)
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
#define XRPL_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
#include <xrpl/basics/hardened_hash.h>
#include <xrpl/basics/partitioned_unordered_map.h>
@@ -98,3 +99,5 @@ template <
using hardened_hash_multiset = std::unordered_multiset<Value, Hash, Pred, Allocator>;
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_UPTIMETIMER_H_INCLUDED
#define XRPL_BASICS_UPTIMETIMER_H_INCLUDED
#include <atomic>
#include <chrono>
@@ -45,3 +46,5 @@ private:
};
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_ALGORITHM_H_INCLUDED
#define XRPL_ALGORITHM_H_INCLUDED
#include <utility>
@@ -89,3 +90,5 @@ remove_if_intersect_or_match(FwdIter1 first1, FwdIter1 last1, InputIter2 first2,
}
} // namespace xrpl
#endif

View File

@@ -32,7 +32,8 @@
*/
#pragma once
#ifndef XRPL_BASICS_BASE64_H_INCLUDED
#define XRPL_BASICS_BASE64_H_INCLUDED
#include <cstdint>
#include <string>
@@ -52,3 +53,5 @@ std::string
base64_decode(std::string_view data);
} // namespace xrpl
#endif

View File

@@ -3,7 +3,8 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#ifndef XRPL_BASICS_BASE_UINT_H_INCLUDED
#define XRPL_BASICS_BASE_UINT_H_INCLUDED
#include <xrpl/basics/Expected.h>
#include <xrpl/basics/Slice.h>
@@ -643,3 +644,5 @@ struct is_uniquely_represented<xrpl::base_uint<Bits, Tag>> : public std::true_ty
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_CHRONO_H_INCLUDED
#define XRPL_BASICS_CHRONO_H_INCLUDED
#include <xrpl/beast/clock/abstract_clock.h>
#include <xrpl/beast/clock/basic_seconds_clock.h>
@@ -98,3 +99,5 @@ stopwatch()
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_COMPARATORS_H_INCLUDED
#define XRPL_BASICS_COMPARATORS_H_INCLUDED
#include <functional>
@@ -52,3 +53,5 @@ using equal_to = std::equal_to<T>;
#endif
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_CONTRACT_H_INCLUDED
#define XRPL_BASICS_CONTRACT_H_INCLUDED
#include <xrpl/beast/type_name.h>
@@ -47,3 +48,5 @@ Throw(Args&&... args)
LogicError(std::string const& how) noexcept;
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_HARDENED_HASH_H_INCLUDED
#define XRPL_BASICS_HARDENED_HASH_H_INCLUDED
#include <xrpl/beast/hash/hash_append.h>
#include <xrpl/beast/hash/xxhasher.h>
@@ -92,3 +93,5 @@ public:
};
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef JOIN_H_INCLUDED
#define JOIN_H_INCLUDED
#include <string>
@@ -79,3 +80,5 @@ public:
};
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_MAKE_SSLCONTEXT_H_INCLUDED
#define XRPL_BASICS_MAKE_SSLCONTEXT_H_INCLUDED
#include <boost/asio/ssl/context.hpp>
@@ -19,3 +20,5 @@ make_SSLContextAuthed(
std::string const& cipherList);
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_MULDIV_H_INCLUDED
#define XRPL_BASICS_MULDIV_H_INCLUDED
#include <cstdint>
#include <limits>
@@ -21,3 +22,5 @@ std::optional<std::uint64_t>
mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div);
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H
#define XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H
#include <xrpl/beast/hash/uhash.h>
#include <xrpl/beast/utility/instrumentation.h>
@@ -392,3 +393,5 @@ private:
};
} // namespace xrpl
#endif // XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_RANDOM_H_INCLUDED
#define XRPL_BASICS_RANDOM_H_INCLUDED
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/beast/xor_shift_engine.h>
@@ -173,3 +174,5 @@ rand_bool()
/** @} */
} // namespace xrpl
#endif // XRPL_BASICS_RANDOM_H_INCLUDED

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_UNITY_ROCKSDB_H_INCLUDED
#define XRPL_UNITY_ROCKSDB_H_INCLUDED
#if XRPL_ROCKSDB_AVAILABLE
// #include <rocksdb2/port/port_posix.h>
@@ -27,3 +28,5 @@
#include <rocksdb/write_batch.h>
#endif
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_SAFE_CAST_H_INCLUDED
#define XRPL_BASICS_SAFE_CAST_H_INCLUDED
#include <type_traits>
@@ -68,3 +69,5 @@ unsafe_cast(Src s) noexcept
}
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_SCOPE_H_INCLUDED
#define XRPL_BASICS_SCOPE_H_INCLUDED
#include <xrpl/beast/utility/instrumentation.h>
@@ -219,3 +220,5 @@ template <class Mutex>
scope_unlock(std::unique_lock<Mutex>&) -> scope_unlock<Mutex>;
} // namespace xrpl
#endif

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2022, Nikolaos D. Bougalis <nikb@bougalis.net>
#pragma once
#ifndef XRPL_BASICS_SPINLOCK_H_INCLUDED
#define XRPL_BASICS_SPINLOCK_H_INCLUDED
#include <xrpl/beast/utility/instrumentation.h>
@@ -200,3 +201,5 @@ public:
/** @} */
} // namespace xrpl
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef XRPL_BASICS_STRHEX_H_INCLUDED
#define XRPL_BASICS_STRHEX_H_INCLUDED
#include <boost/algorithm/hex.hpp>
#include <boost/endian/conversion.hpp>
@@ -26,3 +27,5 @@ strHex(T const& from)
}
} // namespace xrpl
#endif

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2014, Nikolaos D. Bougalis <nikb@bougalis.net>
#pragma once
#ifndef BEAST_UTILITY_TAGGED_INTEGER_H_INCLUDED
#define BEAST_UTILITY_TAGGED_INTEGER_H_INCLUDED
#include <xrpl/beast/hash/hash_append.h>
@@ -201,3 +202,4 @@ struct is_contiguously_hashable<xrpl::tagged_integer<Int, Tag>, HashAlgorithm>
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_ASIO_IO_LATENCY_PROBE_H_INCLUDED
#define BEAST_ASIO_IO_LATENCY_PROBE_H_INCLUDED
#include <xrpl/beast/utility/instrumentation.h>
@@ -225,3 +226,5 @@ private:
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED
#define BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED
namespace beast {
@@ -88,3 +89,5 @@ get_abstract_clock()
}
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CHRONO_BASIC_SECONDS_CLOCK_H_INCLUDED
#define BEAST_CHRONO_BASIC_SECONDS_CLOCK_H_INCLUDED
#include <chrono>
@@ -32,3 +33,5 @@ public:
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED
#define BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED
#include <xrpl/beast/clock/abstract_clock.h>
#include <xrpl/beast/utility/instrumentation.h>
@@ -74,3 +75,5 @@ public:
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_AGED_CONTAINER_H_INCLUDED
#include <type_traits>
@@ -11,3 +12,5 @@ struct is_aged_container : std::false_type
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_CONTAINER_UTILITY_H_INCLUDED
#define BEAST_CONTAINER_AGED_CONTAINER_UTILITY_H_INCLUDED
#include <xrpl/beast/container/aged_container.h>
@@ -23,3 +24,5 @@ expire(AgedContainer& c, std::chrono::duration<Rep, Period> const& age)
}
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_MAP_H_INCLUDED
#define BEAST_CONTAINER_AGED_MAP_H_INCLUDED
#include <xrpl/beast/container/detail/aged_ordered_container.h>
@@ -17,3 +18,5 @@ template <
using aged_map = detail::aged_ordered_container<false, true, Key, T, Clock, Compare, Allocator>;
}
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_MULTIMAP_H_INCLUDED
#define BEAST_CONTAINER_AGED_MULTIMAP_H_INCLUDED
#include <xrpl/beast/container/detail/aged_ordered_container.h>
@@ -17,3 +18,5 @@ template <
using aged_multimap = detail::aged_ordered_container<true, true, Key, T, Clock, Compare, Allocator>;
}
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_MULTISET_H_INCLUDED
#define BEAST_CONTAINER_AGED_MULTISET_H_INCLUDED
#include <xrpl/beast/container/detail/aged_ordered_container.h>
@@ -16,3 +17,5 @@ template <
using aged_multiset = detail::aged_ordered_container<true, false, Key, void, Clock, Compare, Allocator>;
}
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_SET_H_INCLUDED
#define BEAST_CONTAINER_AGED_SET_H_INCLUDED
#include <xrpl/beast/container/detail/aged_ordered_container.h>
@@ -16,3 +17,5 @@ template <
using aged_set = detail::aged_ordered_container<false, false, Key, void, Clock, Compare, Allocator>;
}
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_UNORDERED_MAP_H_INCLUDED
#define BEAST_CONTAINER_AGED_UNORDERED_MAP_H_INCLUDED
#include <xrpl/beast/container/detail/aged_unordered_container.h>
@@ -18,3 +19,5 @@ template <
using aged_unordered_map = detail::aged_unordered_container<false, true, Key, T, Clock, Hash, KeyEqual, Allocator>;
}
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_UNORDERED_MULTIMAP_H_INCLUDED
#define BEAST_CONTAINER_AGED_UNORDERED_MULTIMAP_H_INCLUDED
#include <xrpl/beast/container/detail/aged_unordered_container.h>
@@ -18,3 +19,5 @@ template <
using aged_unordered_multimap = detail::aged_unordered_container<true, true, Key, T, Clock, Hash, KeyEqual, Allocator>;
}
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_UNORDERED_MULTISET_H_INCLUDED
#define BEAST_CONTAINER_AGED_UNORDERED_MULTISET_H_INCLUDED
#include <xrpl/beast/container/detail/aged_unordered_container.h>
@@ -18,3 +19,5 @@ using aged_unordered_multiset =
detail::aged_unordered_container<true, false, Key, void, Clock, Hash, KeyEqual, Allocator>;
}
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_AGED_UNORDERED_SET_H_INCLUDED
#define BEAST_CONTAINER_AGED_UNORDERED_SET_H_INCLUDED
#include <xrpl/beast/container/detail/aged_unordered_container.h>
@@ -17,3 +18,5 @@ template <
using aged_unordered_set = detail::aged_unordered_container<false, false, Key, void, Clock, Hash, KeyEqual, Allocator>;
}
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
namespace beast {
namespace detail {
@@ -32,3 +33,5 @@ struct aged_associative_container_extract_t<false>
} // namespace detail
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_DETAIL_AGED_CONTAINER_ITERATOR_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_AGED_CONTAINER_ITERATOR_H_INCLUDED
#include <iterator>
#include <type_traits>
@@ -145,3 +146,5 @@ private:
} // namespace detail
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED
#include <xrpl/beast/clock/abstract_clock.h>
#include <xrpl/beast/container/aged_container.h>
@@ -1686,3 +1687,5 @@ expire(
}
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_CONTAINER_DETAIL_AGED_UNORDERED_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_AGED_UNORDERED_CONTAINER_H_INCLUDED
#include <xrpl/beast/clock/abstract_clock.h>
#include <xrpl/beast/container/aged_container.h>
@@ -2225,3 +2226,5 @@ expire(
}
} // namespace beast
#endif

View File

@@ -4,7 +4,8 @@
// Official repository: https://github.com/boostorg/beast
//
#pragma once
#ifndef BEAST_CONTAINER_DETAIL_EMPTY_BASE_OPTIMIZATION_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_EMPTY_BASE_OPTIMIZATION_H_INCLUDED
#include <boost/type_traits/is_final.hpp>
@@ -88,3 +89,5 @@ public:
} // namespace detail
} // namespace beast
#endif

View File

@@ -2,7 +2,8 @@
// Copyright (c) 2013 - Raw Material Software Ltd.
// Please visit http://www.juce.com
#pragma once
#ifndef BEAST_CORE_CURRENT_THREAD_NAME_H_INCLUDED
#define BEAST_CORE_CURRENT_THREAD_NAME_H_INCLUDED
#include <boost/predef.h>
@@ -52,3 +53,5 @@ std::string
getCurrentThreadName();
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_MODULE_CORE_TEXT_LEXICALCAST_H_INCLUDED
#define BEAST_MODULE_CORE_TEXT_LEXICALCAST_H_INCLUDED
#include <xrpl/beast/utility/instrumentation.h>
@@ -207,3 +208,5 @@ lexicalCast(In in, Out defaultValue = Out())
}
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INTRUSIVE_LIST_H_INCLUDED
#define BEAST_INTRUSIVE_LIST_H_INCLUDED
#include <iterator>
@@ -573,3 +574,5 @@ private:
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INTRUSIVE_LOCKFREESTACK_H_INCLUDED
#define BEAST_INTRUSIVE_LOCKFREESTACK_H_INCLUDED
#include <atomic>
#include <iterator>
@@ -267,3 +268,5 @@ private:
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_MODULE_CORE_DIAGNOSTIC_SEMANTICVERSION_H_INCLUDED
#define BEAST_MODULE_CORE_DIAGNOSTIC_SEMANTICVERSION_H_INCLUDED
#include <string>
#include <vector>
@@ -94,3 +95,5 @@ operator<(SemanticVersion const& lhs, SemanticVersion const& rhs)
}
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_HASH_HASH_APPEND_H_INCLUDED
#define BEAST_HASH_HASH_APPEND_H_INCLUDED
#include <boost/container/flat_set.hpp>
#include <boost/endian/conversion.hpp>
@@ -439,3 +440,5 @@ hash_append(HashAlgorithm& h, std::error_code const& ec)
}
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_HASH_UHASH_H_INCLUDED
#define BEAST_HASH_UHASH_H_INCLUDED
#include <xrpl/beast/hash/hash_append.h>
#include <xrpl/beast/hash/xxhasher.h>
@@ -24,3 +25,5 @@ struct uhash
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_HASH_XXHASHER_H_INCLUDED
#define BEAST_HASH_XXHASHER_H_INCLUDED
#include <boost/endian/conversion.hpp>
@@ -151,3 +152,5 @@ public:
};
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_COLLECTOR_H_INCLUDED
#define BEAST_INSIGHT_COLLECTOR_H_INCLUDED
#include <xrpl/beast/insight/Counter.h>
#include <xrpl/beast/insight/Event.h>
@@ -119,3 +120,5 @@ public:
} // namespace insight
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_COUNTER_H_INCLUDED
#define BEAST_INSIGHT_COUNTER_H_INCLUDED
#include <xrpl/beast/insight/CounterImpl.h>
@@ -93,3 +94,5 @@ private:
} // namespace insight
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED
#define BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED
#include <cstdint>
#include <memory>
@@ -20,3 +21,5 @@ public:
} // namespace insight
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_EVENT_H_INCLUDED
#define BEAST_INSIGHT_EVENT_H_INCLUDED
#include <xrpl/beast/insight/EventImpl.h>
@@ -60,3 +61,5 @@ private:
} // namespace insight
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_EVENTIMPL_H_INCLUDED
#define BEAST_INSIGHT_EVENTIMPL_H_INCLUDED
#include <chrono>
#include <memory>
@@ -20,3 +21,5 @@ public:
} // namespace insight
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_GAUGE_H_INCLUDED
#define BEAST_INSIGHT_GAUGE_H_INCLUDED
#include <xrpl/beast/insight/GaugeImpl.h>
@@ -123,3 +124,5 @@ private:
} // namespace insight
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_GAUGEIMPL_H_INCLUDED
#define BEAST_INSIGHT_GAUGEIMPL_H_INCLUDED
#include <cstdint>
#include <memory>
@@ -23,3 +24,5 @@ public:
} // namespace insight
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_GROUP_H_INCLUDED
#define BEAST_INSIGHT_GROUP_H_INCLUDED
#include <xrpl/beast/insight/Collector.h>
@@ -21,3 +22,5 @@ public:
} // namespace insight
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_GROUPS_H_INCLUDED
#define BEAST_INSIGHT_GROUPS_H_INCLUDED
#include <xrpl/beast/insight/Collector.h>
#include <xrpl/beast/insight/Group.h>
@@ -34,3 +35,5 @@ make_Groups(Collector::ptr const& collector);
} // namespace insight
} // namespace beast
#endif

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef BEAST_INSIGHT_HOOK_H_INCLUDED
#define BEAST_INSIGHT_HOOK_H_INCLUDED
#include <xrpl/beast/insight/HookImpl.h>
@@ -39,3 +40,5 @@ private:
} // namespace insight
} // namespace beast
#endif

Some files were not shown because too many files have changed in this diff Show More