Rerun C++ SDK
Loading...
Searching...
No Matches
text_log_level.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/store/re_types/definitions/rerun/components/text_log_level.fbs".
3
4#pragma once
5
6#include "../component_descriptor.hpp"
7#include "../datatypes/utf8.hpp"
8#include "../rerun_sdk_export.hpp"
9#include "../result.hpp"
10
11#include <cstdint>
12#include <memory>
13#include <string>
14#include <utility>
15
16namespace rerun::components {
17 /// **Component**: The severity level of a text log message.
18 ///
19 /// Recommended to be one of:
20 /// * `"CRITICAL"`
21 /// * `"ERROR"`
22 /// * `"WARN"`
23 /// * `"INFO"`
24 /// * `"DEBUG"`
25 /// * `"TRACE"`
26 struct TextLogLevel {
28
29 public: // START of extensions from text_log_level_ext.cpp:
30 /// Designates catastrophic failures.
31 RERUN_SDK_EXPORT static const TextLogLevel Critical;
32
33 /// Designates very serious errors.
34 RERUN_SDK_EXPORT static const TextLogLevel Error;
35
36 /// Designates hazardous situations.
37 RERUN_SDK_EXPORT static const TextLogLevel Warning;
38
39 /// Designates useful information.
40 RERUN_SDK_EXPORT static const TextLogLevel Info;
41
42 /// Designates lower priority information.
43 RERUN_SDK_EXPORT static const TextLogLevel Debug;
44
45 /// Designates very low priority, often extremely verbose, information.
46 RERUN_SDK_EXPORT static const TextLogLevel Trace;
47
48 /// Construct `TextLogLevel` from a null-terminated UTF8 string.
49 TextLogLevel(const char* str) : value(str) {}
50
51 const char* c_str() const {
52 return value.c_str();
53 }
54
55 // END of extensions from text_log_level_ext.cpp, start of generated code:
56
57 public:
58 TextLogLevel() = default;
59
60 TextLogLevel(rerun::datatypes::Utf8 value_) : value(std::move(value_)) {}
61
62 TextLogLevel& operator=(rerun::datatypes::Utf8 value_) {
63 value = std::move(value_);
64 return *this;
65 }
66
67 TextLogLevel(std::string value_) : value(std::move(value_)) {}
68
69 TextLogLevel& operator=(std::string value_) {
70 value = std::move(value_);
71 return *this;
72 }
73
74 /// Cast to the underlying Utf8 datatype
75 operator rerun::datatypes::Utf8() const {
76 return value;
77 }
78 };
79} // namespace rerun::components
80
81namespace rerun {
82 static_assert(sizeof(rerun::datatypes::Utf8) == sizeof(components::TextLogLevel));
83
84 /// \private
85 template <>
86 struct Loggable<components::TextLogLevel> {
87 static constexpr ComponentDescriptor Descriptor = "rerun.components.TextLogLevel";
88
89 /// Returns the arrow data type this type corresponds to.
90 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
91 return Loggable<rerun::datatypes::Utf8>::arrow_datatype();
92 }
93
94 /// Serializes an array of `rerun::components::TextLogLevel` into an arrow array.
95 static Result<std::shared_ptr<arrow::Array>> to_arrow(
96 const components::TextLogLevel* instances, size_t num_instances
97 ) {
98 if (num_instances == 0) {
99 return Loggable<rerun::datatypes::Utf8>::to_arrow(nullptr, 0);
100 } else if (instances == nullptr) {
101 return rerun::Error(
102 ErrorCode::UnexpectedNullArgument,
103 "Passed array instances is null when num_elements> 0."
104 );
105 } else {
106 return Loggable<rerun::datatypes::Utf8>::to_arrow(&instances->value, num_instances);
107 }
108 }
109 };
110} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:80
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: The severity level of a text log message.
Definition text_log_level.hpp:26
static RERUN_SDK_EXPORT const TextLogLevel Error
Designates very serious errors.
Definition text_log_level.hpp:34
static RERUN_SDK_EXPORT const TextLogLevel Debug
Designates lower priority information.
Definition text_log_level.hpp:43
static RERUN_SDK_EXPORT const TextLogLevel Info
Designates useful information.
Definition text_log_level.hpp:40
static RERUN_SDK_EXPORT const TextLogLevel Trace
Designates very low priority, often extremely verbose, information.
Definition text_log_level.hpp:46
static RERUN_SDK_EXPORT const TextLogLevel Critical
Designates catastrophic failures.
Definition text_log_level.hpp:31
TextLogLevel(const char *str)
Construct TextLogLevel from a null-terminated UTF8 string.
Definition text_log_level.hpp:49
static RERUN_SDK_EXPORT const TextLogLevel Warning
Designates hazardous situations.
Definition text_log_level.hpp:37
Datatype: A string of text, encoded as UTF-8.
Definition utf8.hpp:22