Skip to content

Commit a6de9e0

Browse files
authored
feat: Update IR unit handler signature to align with the latest FFI core change (fixes #139). (#140)
1 parent 8e525ba commit a6de9e0

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

src/clp

Submodule clp updated 79 files

src/clp_ffi_py/ir/native/PyDeserializer.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "PyDeserializer.hpp"
44

5+
#include <memory>
56
#include <new>
67
#include <string>
78
#include <system_error>
@@ -253,8 +254,10 @@ auto PyDeserializer::init(
253254

254255
PyDeserializer::IrUnitHandler::SchemaTreeNodeInsertionHandle
255256
trivial_schema_tree_node_insertion_handle
256-
= []([[maybe_unused]] bool, [[maybe_unused]] clp::ffi::SchemaTree::NodeLocator
257-
) -> IRErrorCode { return IRErrorCode::IRErrorCode_Success; };
257+
= []([[maybe_unused]] bool,
258+
[[maybe_unused]] clp::ffi::SchemaTree::NodeLocator,
259+
[[maybe_unused]] std::shared_ptr<clp::ffi::SchemaTree const> const&)
260+
-> IRErrorCode { return IRErrorCode::IRErrorCode_Success; };
258261

259262
PyDeserializer::IrUnitHandler::EndOfStreamHandle end_of_stream_handle
260263
= [this]() -> IRErrorCode { return this->handle_end_of_stream(); };

src/clp_ffi_py/ir/native/PyDeserializer.hpp

+15-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <wrapped_facade_headers/Python.hpp> // Must be included before any other header files
55

66
#include <functional>
7+
#include <memory>
78
#include <utility>
89

910
#include <clp/ffi/ir_stream/decoding_methods.hpp>
@@ -129,10 +130,15 @@ class PyDeserializer {
129130
= std::function<clp::ffi::ir_stream::IRErrorCode(clp::ffi::KeyValuePairLogEvent&&)>;
130131
using UtcOffsetChangeHandle
131132
= std::function<clp::ffi::ir_stream::IRErrorCode(clp::UtcOffset, clp::UtcOffset)>;
133+
// clang-format off
134+
// NOTE: clang-format 19.1.7 fails to correctly format the following lines within the
135+
// 100-char ColumnLimit.
132136
using SchemaTreeNodeInsertionHandle = std::function<clp::ffi::ir_stream::IRErrorCode(
133-
bool is_auto_generated,
134-
clp::ffi::SchemaTree::NodeLocator
137+
bool,
138+
clp::ffi::SchemaTree::NodeLocator,
139+
std::shared_ptr<clp::ffi::SchemaTree const> const&
135140
)>;
141+
// clang-format on
136142
using EndOfStreamHandle = std::function<clp::ffi::ir_stream::IRErrorCode()>;
137143

138144
// Constructor
@@ -172,9 +178,14 @@ class PyDeserializer {
172178

173179
[[nodiscard]] auto handle_schema_tree_node_insertion(
174180
bool is_auto_generated,
175-
clp::ffi::SchemaTree::NodeLocator schema_tree_node_locator
181+
clp::ffi::SchemaTree::NodeLocator schema_tree_node_locator,
182+
[[maybe_unused]] std::shared_ptr<clp::ffi::SchemaTree const> const& schema_tree
176183
) -> clp::ffi::ir_stream::IRErrorCode {
177-
return m_schema_tree_node_insertion_handle(is_auto_generated, schema_tree_node_locator);
184+
return m_schema_tree_node_insertion_handle(
185+
is_auto_generated,
186+
schema_tree_node_locator,
187+
schema_tree
188+
);
178189
}
179190

180191
[[nodiscard]] auto handle_end_of_stream() -> clp::ffi::ir_stream::IRErrorCode {

src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "PyKeyValuePairLogEvent.hpp"
44

55
#include <cstddef>
6+
#include <memory>
67
#include <new>
78
#include <optional>
89
#include <span>
@@ -62,7 +63,8 @@ class IrUnitHandler {
6263

6364
[[nodiscard]] static auto handle_schema_tree_node_insertion(
6465
[[maybe_unused]] bool is_auto_generated,
65-
[[maybe_unused]] clp::ffi::SchemaTree::NodeLocator schema_tree_node_locator
66+
[[maybe_unused]] clp::ffi::SchemaTree::NodeLocator schema_tree_node_locator,
67+
[[maybe_unused]] std::shared_ptr<clp::ffi::SchemaTree const> const& schema_tree
6668
) -> IRErrorCode {
6769
return IRErrorCode::IRErrorCode_Success;
6870
}

0 commit comments

Comments
 (0)