Skip to content

Commit

Permalink
resolve the rest of the conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry8192 committed Jan 29, 2025
1 parent 122f1cf commit f4a0207
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 21 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ boost_${CLP_FFI_JS_BOOST_ARCHIVE_VERSION_PART}.tar.gz"
URL_MD5 "53aeccc3167909ee770e34469f8dd592"
)
message(STATUS "Fetching Boost.")
FetchContent_MakeAvailable(Boost)
set(FETCHCONTENT_QUIET OFF)
FetchContent_Declare(
Boost
URL "${CMAKE_FIND_PACKAGE_REDIRECTS_DIR/boost_1_85_0.tar.gz}"
)
message("Boost sources successfully fetched into ${boost_SOURCE_DIR}")

set(CMAKE_EXECUTABLE_SUFFIX ".js" CACHE STRING "Binary type to be generated by Emscripten.")
Expand Down
4 changes: 2 additions & 2 deletions src/clp_ffi_js/ir/StreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ EMSCRIPTEN_BINDINGS(ClpStreamReader) {
.function("deserializeStream", &clp_ffi_js::ir::StreamReader::deserialize_stream)
.function("decodeRange", &clp_ffi_js::ir::StreamReader::decode_range)
.function(
"getLogEventIdxByTimestamp",
&clp_ffi_js::ir::StreamReader::get_log_event_idx_by_timestamp
"getLogEventIdxWithNearestTimestamp",
&clp_ffi_js::ir::StreamReader::get_log_event_idx_with_nearest_timestamp
);
}
} // namespace
Expand Down
20 changes: 10 additions & 10 deletions src/clp_ffi_js/ir/StreamReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ class StreamReader {
[[nodiscard]] virtual auto decode_range(size_t begin_idx, size_t end_idx, bool use_filter) const
-> DecodedResultsTsType = 0;
/**
* Finds the index of the last log event that matches or next to the given timestamp.
*
* @param timestamp The timestamp to search for, in milliseconds since the Unix epoch.
* @return The last index of the log event whose timestamp is smaller than or equal to the
* `timestamp`.
* @return `0` if all log event timestamps are larger than the target.
* Finds the log event with the timestamp that's nearest to the `target_ts`.
* @param target_ts
* @return The index of the log event with:
* - the largest timestamp less than or equal to `target_ts`,
* - or the index `0` if all timestamps are greater than `target_ts`.
* @return null if no log event exists in the stream.
*/
[[nodiscard]] virtual auto get_log_event_idx_by_timestamp(clp::ir::epoch_time_ms_t timestamp
[[nodiscard]] virtual auto get_log_event_idx_with_nearest_timestamp(
clp::ir::epoch_time_ms_t target_ts
) -> LogEventIdxTsType = 0;

protected:
Expand Down Expand Up @@ -187,15 +187,15 @@ class StreamReader {
) -> void;

/**
* Templated implementation of `get_log_event_idx_by_timestamp`.
* Templated implementation of `get_log_event_idx_with_nearest_timestamp`.
*
* @tparam LogEvent
* @param log_events
* @param timestamp
* @return the best matched log event index.
*/
template <typename LogEvent>
auto generic_get_log_event_idx_by_timestamp(
auto generic_get_log_event_idx_with_nearest_timestamp(
LogEvents<LogEvent> const& log_events,
clp::ir::epoch_time_ms_t timestamp
) -> LogEventIdxTsType;
Expand Down Expand Up @@ -287,7 +287,7 @@ auto StreamReader::generic_filter_log_events(
}

template <typename LogEvent>
auto StreamReader::generic_get_log_event_idx_by_timestamp(
auto StreamReader::generic_get_log_event_idx_with_nearest_timestamp(
LogEvents<LogEvent> const& log_events,
clp::ir::epoch_time_ms_t timestamp
) -> LogEventIdxTsType {
Expand Down
6 changes: 3 additions & 3 deletions src/clp_ffi_js/ir/StructuredIrStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ auto StructuredIrStreamReader::decode_range(size_t begin_idx, size_t end_idx, bo
);
}

auto StructuredIrStreamReader::get_log_event_idx_by_timestamp(
clp::ir::epoch_time_ms_t const timestamp
auto StructuredIrStreamReader::get_log_event_idx_with_nearest_timestamp(
clp::ir::epoch_time_ms_t const target_ts
) -> LogEventIdxTsType {
return generic_get_log_event_idx_by_timestamp(*m_deserialized_log_events, timestamp);
return generic_get_log_event_idx_with_nearest_timestamp(*m_deserialized_log_events, target_ts);
}

StructuredIrStreamReader::StructuredIrStreamReader(
Expand Down
2 changes: 1 addition & 1 deletion src/clp_ffi_js/ir/StructuredIrStreamReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class StructuredIrStreamReader : public StreamReader {
[[nodiscard]] auto decode_range(size_t begin_idx, size_t end_idx, bool use_filter) const
-> DecodedResultsTsType override;

[[nodiscard]] auto get_log_event_idx_by_timestamp(clp::ir::epoch_time_ms_t timestamp
[[nodiscard]] auto get_log_event_idx_with_nearest_timestamp(clp::ir::epoch_time_ms_t target_ts
) -> LogEventIdxTsType override;

private:
Expand Down
6 changes: 3 additions & 3 deletions src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ auto UnstructuredIrStreamReader::decode_range(size_t begin_idx, size_t end_idx,
);
}

auto UnstructuredIrStreamReader::get_log_event_idx_by_timestamp(
clp::ir::epoch_time_ms_t const timestamp
auto UnstructuredIrStreamReader::get_log_event_idx_with_nearest_timestamp(
clp::ir::epoch_time_ms_t const target_ts
) -> LogEventIdxTsType {
return generic_get_log_event_idx_by_timestamp(m_encoded_log_events, timestamp);
return generic_get_log_event_idx_with_nearest_timestamp(m_encoded_log_events, target_ts);
}

UnstructuredIrStreamReader::UnstructuredIrStreamReader(
Expand Down
2 changes: 1 addition & 1 deletion src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class UnstructuredIrStreamReader : public StreamReader {
[[nodiscard]] auto decode_range(size_t begin_idx, size_t end_idx, bool use_filter) const
-> DecodedResultsTsType override;

[[nodiscard]] auto get_log_event_idx_by_timestamp(clp::ir::epoch_time_ms_t timestamp
[[nodiscard]] auto get_log_event_idx_with_nearest_timestamp(clp::ir::epoch_time_ms_t target_ts
) -> LogEventIdxTsType override;

private:
Expand Down

0 comments on commit f4a0207

Please sign in to comment.