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