6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/graph_edge.hpp"
11#include "../components/graph_type.hpp"
12#include "../result.hpp"
49 std::optional<ComponentBatch>
edges;
58 static constexpr const char ArchetypeName[] =
"rerun.archetypes.GraphEdges";
92 return std::move(*
this);
101 return std::move(*
this);
112 return std::move(*
this);
124 return detail::partition_batches({&
edges, &
graph_type}, lengths_).value_or_throw();
132 return detail::partition_batches_of_unit_length({&
edges, &
graph_type}).value_or_throw();
140 template <
typename T>
145 struct AsComponents<archetypes::GraphEdges> {
147 static Result<Collection<ComponentBatch>> as_batches(
const archetypes::GraphEdges& archetype
149 return detail::collect_batches({&archetype.edges, &archetype.graph_type});
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:90
GraphType
Component: Specifies if a graph has directed or undirected edges.
Definition graph_type.hpp:24
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: A list of edges in a graph.
Definition graph_edges.hpp:47
GraphEdges with_many_graph_type(const Collection< rerun::components::GraphType > &_graph_type) &&
This method makes it possible to pack multiple graph_type in a single component batch.
Definition graph_edges.hpp:108
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition graph_edges.hpp:131
std::optional< ComponentBatch > graph_type
Specifies if the graph is directed or undirected.
Definition graph_edges.hpp:54
std::optional< ComponentBatch > edges
A list of node tuples.
Definition graph_edges.hpp:49
static GraphEdges clear_fields()
Clear all the fields of a GraphEdges.
static GraphEdges update_fields()
Update only some specific fields of a GraphEdges.
Definition graph_edges.hpp:82
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition graph_edges.hpp:123
static constexpr auto Descriptor_graph_type
ComponentDescriptor for the graph_type field.
Definition graph_edges.hpp:65
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition graph_edges.hpp:58
GraphEdges with_graph_type(const rerun::components::GraphType &_graph_type) &&
Specifies if the graph is directed or undirected.
Definition graph_edges.hpp:98
GraphEdges with_edges(const Collection< rerun::components::GraphEdge > &_edges) &&
A list of node tuples.
Definition graph_edges.hpp:90
static constexpr auto Descriptor_edges
ComponentDescriptor for the edges field.
Definition graph_edges.hpp:61