Skip to content

Commit

Permalink
change version
Browse files Browse the repository at this point in the history
  • Loading branch information
davemarco committed Nov 11, 2024
1 parent a199924 commit d00d0a2
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ project(
LANGUAGES
C
CXX
VERSION 0.3.0
VERSION 0.4.0
)

# Enable exporting compile commands
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clp-ffi-js",
"version": "0.3.0",
"version": "0.4.0",
"description": "clp-ffi-js is a JavaScript FFI library for CLP.",
"author": "YScope Inc. <[email protected]>",
"license": "Apache-2.0",
Expand Down
5 changes: 1 addition & 4 deletions src/clp_ffi_js/ir/LogEventWithFilterData.hpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
#ifndef CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP
#define CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP


#include <concepts>
#include <utility>

#include <clp/ffi/KeyValuePairLogEvent.hpp>
#include <clp/ir/LogEvent.hpp>
#include <clp/ir/types.hpp>

#include <clp/ffi/KeyValuePairLogEvent.hpp>
#include <clp_ffi_js/constants.hpp>

namespace clp_ffi_js::ir {
using clp::ir::four_byte_encoded_variable_t;
using UnstructuredLogEvent = clp::ir::LogEvent<four_byte_encoded_variable_t>;
using StructuredLogEvent = clp::ffi::KeyValuePairLogEvent;


/**
* A templated class that extends a log event type with processed versions of some of its fields,
* specifically the fields that are used for filtering in the `StreamReader` classes and their
Expand Down Expand Up @@ -64,4 +62,3 @@ class LogEventWithFilterData {
} // namespace clp_ffi_js::ir

#endif // CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP

4 changes: 3 additions & 1 deletion src/clp_ffi_js/ir/StreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ EMSCRIPTEN_BINDINGS(ClpStreamReader) {
// JS types used as inputs
emscripten::register_type<clp_ffi_js::ir::DataArrayTsType>("Uint8Array");
emscripten::register_type<clp_ffi_js::ir::LogLevelFilterTsType>("number[] | null");
emscripten::register_type<clp_ffi_js::ir::ReaderOptions>("{logLevelKey: string, timestampKey: string} | null");
emscripten::register_type<clp_ffi_js::ir::ReaderOptions>(
"{logLevelKey: string, timestampKey: string} | null"
);

// JS types used as outputs
emscripten::enum_<clp_ffi_js::ir::StreamType>("IrStreamType")
Expand Down
7 changes: 5 additions & 2 deletions src/clp_ffi_js/ir/StructuredIrStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ auto StructuredIrStreamReader::get_filtered_log_event_map() const -> FilteredLog
}

void StructuredIrStreamReader::filter_log_events(LogLevelFilterTsType const& log_level_filter) {
filter_deserialized_events(m_filtered_log_event_map, log_level_filter, *m_deserialized_log_events);
filter_deserialized_events(
m_filtered_log_event_map,
log_level_filter,
*m_deserialized_log_events
);
}

auto StructuredIrStreamReader::deserialize_stream() -> size_t {
Expand Down Expand Up @@ -128,7 +132,6 @@ auto StructuredIrStreamReader::deserialize_stream() -> size_t {

auto StructuredIrStreamReader::decode_range(size_t begin_idx, size_t end_idx, bool use_filter) const
-> DecodedResultsTsType {

if (use_filter && false == m_filtered_log_event_map.has_value()) {
return DecodedResultsTsType{emscripten::val::null()};
}
Expand Down
5 changes: 3 additions & 2 deletions src/clp_ffi_js/ir/StructuredIrUnitHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class StructuredIrUnitHandler {
}

/**
* Saves the node's ID if it corresponds to events' authoritative log level or timestamp kv-pair.
* Saves the node's ID if it corresponds to events' authoritative log level or timestamp
* kv-pair.
* @param schema_tree_node_locator
* @return IRErrorCode::IRErrorCode_Success
*/
Expand All @@ -81,8 +82,8 @@ class StructuredIrUnitHandler {
[[nodiscard]] static auto handle_end_of_stream() -> clp::ffi::ir_stream::IRErrorCode {
return clp::ffi::ir_stream::IRErrorCode::IRErrorCode_Success;
}
private:

private:
// Methods
/**
* @param id_value_pairs
Expand Down
13 changes: 6 additions & 7 deletions src/clp_ffi_js/ir/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
namespace clp_ffi_js::ir {

/**
* Generates a filtered collection from all log events.
*
* @param log_level_filter Array of selected log levels.
* @param filtered_log_event_map A reference to `FilteredLogEventsMap` that stores filtered result.
* @param log_events
*/
* Generates a filtered collection from all log events.
*
* @param log_level_filter Array of selected log levels.
* @param filtered_log_event_map A reference to `FilteredLogEventsMap` that stores filtered result.
* @param log_events
*/
template <typename LogEvents>
auto filter_deserialized_events(
FilteredLogEventsMap& filtered_log_event_map,
Expand Down Expand Up @@ -50,5 +50,4 @@ auto filter_deserialized_events(
}
} // namespace clp_ffi_js::ir


#endif // CLP_FFI_JS_IR_UTILS_HPP

0 comments on commit d00d0a2

Please sign in to comment.