3#include "collection.hpp"
4#include "component_batch.hpp"
5#include "indicator_component.hpp"
18 template <
typename T2>
19 struct NoAsComponentsFor : std::false_type {};
23 NoAsComponentsFor<T>::value,
24 "AsComponents is not implemented for this type. "
25 "It is implemented for all built-in archetypes as well as invidiual & collections of `rerun::ComponentBatch`."
26 "You can add your own implementation by specializing AsComponents<T> for your type T."
30 static Result<Collection<ComponentBatch>> as_batches(
const T& archetype);
38 struct AsComponents<Collection<ComponentBatch>> {
39 static Result<Collection<ComponentBatch>> as_batches(Collection<ComponentBatch> components
47 struct AsComponents<ComponentBatch> {
48 static Result<Collection<ComponentBatch>> as_batches(ComponentBatch components) {
55 struct AsComponents<Result<Collection<ComponentBatch>>> {
56 static Result<Collection<ComponentBatch>> as_batches(
57 Result<Collection<ComponentBatch>> components
59 RR_RETURN_NOT_OK(components.error);
60 return components.value;
66 struct AsComponents<Collection<Result<ComponentBatch>>> {
67 static Result<Collection<ComponentBatch>> as_batches(
68 Collection<Result<ComponentBatch>> components
70 std::vector<ComponentBatch> result;
71 result.reserve(components.size());
72 for (
auto& component : components) {
73 RR_RETURN_NOT_OK(component.error);
74 result.push_back(std::move(component.value));
82 struct AsComponents<Result<ComponentBatch>> {
83 static Result<Collection<ComponentBatch>> as_batches(Result<ComponentBatch> components) {
84 RR_RETURN_NOT_OK(components.error);
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Collection< TElement > take_ownership(std::vector< TElement > data)
Takes ownership of a temporary std::vector, moving it into the collection.
Definition collection.hpp:482