Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ set(SOURCE_FILES_unitTest
src/clp/ffi/ir_stream/protocol_constants.hpp
src/clp/ffi/ir_stream/Serializer.cpp
src/clp/ffi/ir_stream/Serializer.hpp
src/clp/ffi/ir_stream/search/ProjectionResolutionCallbackReq.hpp
src/clp/ffi/ir_stream/utils.cpp
src/clp/ffi/ir_stream/utils.hpp
src/clp/ffi/KeyValuePairLogEvent.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#ifndef CLP_FFI_IR_STREAM_SEARCH_PROJECTIONRESOLUTIONCALLBACKREQ_HPP
#define CLP_FFI_IR_STREAM_SEARCH_PROJECTIONRESOLUTIONCALLBACKREQ_HPP

#include <string_view>
#include <type_traits>

#include <outcome/single-header/outcome.hpp>

#include "../../SchemaTree.hpp"

namespace clp::ffi::ir_stream::search {
/**
* Concept that defines the callback function signature for projection resolution.
* @tparam ProjectionResolutionCallbackType
*
* Callback parameters:
* - `bool is_auto_generated`: Whether the schema tree node is auto-generated.
* - `SchemaTree::Node::id_t schema_tree_node_id`: The ID of the resolved schema tree node.
* - `std::string_view key_path`: The key path of the resolved projection.
*
* Callback return values:
* - A void result on success.
* - A user-defined error code indicating the failure.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirkrodrigues Do u have any suggestions on how to document such a signature?

*/
Comment thread
LinZhihao-723 marked this conversation as resolved.
Resolved
template <typename ProjectionResolutionCallbackType>
concept ProjectionResolutionCallbackReq = std::is_invocable_r_v<

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about NewSchemaTreeProjectionNodeCallbackReq?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, we decided to use NewProjectedSchemaTreeNodeCallbackReq.

outcome_v2::std_result<void>,
ProjectionResolutionCallbackType,
bool,
SchemaTree::Node::id_t,
std::string_view>;
} // namespace clp::ffi::ir_stream::search

#endif // CLP_FFI_IR_STREAM_SEARCH_PROJECTIONRESOLUTIONCALLBACKREQ_HPP