7#include "collection.hpp"
38 std::shared_ptr<arrow::Array>
array;
69 Timeline(std::move(timeline_name), TimeType::Sequence),
70 std::move(sequence_points),
106 template <
typename TRep,
typename TPeriod>
108 std::string timeline_name,
109 const Collection<std::chrono::duration<TRep, TPeriod>>& chrono_times,
112 std::vector<int64_t> times(chrono_times.size());
113 for (
size_t i = 0; i < chrono_times.size(); i++) {
115 std::chrono::duration_cast<std::chrono::nanoseconds>(chrono_times[i]).count();
118 Timeline(std::move(timeline_name), TimeType::Time),
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:91
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
SortingStatus
Describes whether an array is known to be sorted or not.
Definition time_column.hpp:19
@ Sorted
The array is known to be sorted.
@ Unsorted
The array is known to be unsorted.
@ Unknown
It's not known whether the array is sorted or not.
Arrow-encoded data for a column of time points.
Definition time_column.hpp:33
Timeline timeline
The timeline this column belongs to.
Definition time_column.hpp:35
TimeColumn(Timeline timeline, Collection< int64_t > times, SortingStatus sorting_status=SortingStatus::Unknown)
Creates a time column from an array of time points.
static TimeColumn from_seconds(std::string timeline_name, Collection< double > times_in_seconds, SortingStatus sorting_status=SortingStatus::Unknown)
Creates a time column from an array of seconds.
std::shared_ptr< arrow::Array > array
Time points as a primitive array of i64.
Definition time_column.hpp:38
static TimeColumn from_times(std::string timeline_name, const Collection< std::chrono::duration< TRep, TPeriod > > &chrono_times, SortingStatus sorting_status=SortingStatus::Unknown)
Creates a time column from an array of arbitrary std::chrono durations.
Definition time_column.hpp:107
static TimeColumn from_nanoseconds(std::string timeline_name, Collection< int64_t > times_in_nanoseconds, SortingStatus sorting_status=SortingStatus::Unknown)
Creates a time column from an array of nanoseconds.
Error to_c_ffi_struct(rr_time_column &out_column) const
To rerun C API component batch.
static TimeColumn from_sequence_points(std::string timeline_name, Collection< int64_t > sequence_points, SortingStatus sorting_status=SortingStatus::Unknown)
Creates a time column from an array of sequence points.
Definition time_column.hpp:64
SortingStatus sorting_status
The sorting order of the times array.
Definition time_column.hpp:41
Definition of a timeline.
Definition timeline.hpp:17