Skip to content

Commit

Permalink
Deprecate C++ TimeColumn::from_sequence_points in favor of `TimeColum…
Browse files Browse the repository at this point in the history
…n::from_sequence`
  • Loading branch information
Wumpf committed Jan 31, 2025
1 parent 7f709f0 commit 197e009
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/snippets/all/archetypes/image_send_columns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main() {
// Send all images at once.
rec.send_columns(
"images",
rerun::TimeColumn::from_sequence_points("step", std::move(times)),
rerun::TimeColumn::from_sequence("step", std::move(times)),
rerun::Image().with_many_buffer(std::move(image_data)).columns()
);
}
2 changes: 1 addition & 1 deletion docs/snippets/all/archetypes/scalar_send_columns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int main() {
// Serialize to columns and send.
rec.send_columns(
"scalars",
rerun::TimeColumn::from_sequence_points("step", std::move(times)),
rerun::TimeColumn::from_sequence("step", std::move(times)),
rerun::Scalar().with_many_scalar(std::move(scalar_data)).columns()
);
}
2 changes: 1 addition & 1 deletion rerun_cpp/src/rerun/archetypes/scalar.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions rerun_cpp/src/rerun/time_column.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ namespace rerun {
/// Make sure the sorting status is correctly specified.
/// \param sorting_status The sorting status of the sequence points.
/// Already sorted time points may perform better.
///
/// \deprecated Use `from_sequence` instead.
[[deprecated("Use `from_sequence` instead.")]]
static TimeColumn from_sequence_points(
std::string timeline_name, Collection<int64_t> sequence_points,
SortingStatus sorting_status = SortingStatus::Unknown
Expand All @@ -80,6 +83,24 @@ namespace rerun {
);
}

/// Creates a time column from an array of sequence points.
///
/// \param timeline_name The name of the timeline this column belongs to.
/// \param sequence_points The sequence points.
/// Make sure the sorting status is correctly specified.
/// \param sorting_status The sorting status of the sequence points.
/// Already sorted time points may perform better.
static TimeColumn from_sequence(
std::string timeline_name, Collection<int64_t> sequence_points,
SortingStatus sorting_status = SortingStatus::Unknown
) {
return TimeColumn(
Timeline(std::move(timeline_name), TimeType::Sequence),
std::move(sequence_points),
sorting_status
);
}

/// Creates a time column from an array of nanoseconds.
///
/// \param timeline_name The name of the timeline this column belongs to.
Expand Down

0 comments on commit 197e009

Please sign in to comment.