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