WPILibC++ 2024.3.2
|
Functions | |
bool | nt::HasSchema (NT_Inst inst, std::string_view name) |
Returns whether there is a data schema already registered with the given name. More... | |
void | nt::AddSchema (NT_Inst inst, std::string_view name, std::string_view type, std::span< const uint8_t > schema) |
Registers a data schema. More... | |
void | nt::AddSchema (NT_Inst inst, std::string_view name, std::string_view type, std::string_view schema) |
Registers a data schema. More... | |
void nt::AddSchema | ( | NT_Inst | inst, |
std::string_view | name, | ||
std::string_view | type, | ||
std::span< const uint8_t > | schema | ||
) |
Registers a data schema.
Data schemas provide information for how a certain data type string can be decoded. The type string of a data schema indicates the type of the schema itself (e.g. "protobuf" for protobuf schemas, "struct" for struct schemas, etc). In NetworkTables, schemas are published just like normal topics, with the name being generated from the provided name: "/.schema/<name>". Duplicate calls to this function with the same name are silently ignored.
inst | instance |
name | Name (the string passed as the data type for topics using this schema) |
type | Type of schema (e.g. "protobuf", "struct", etc) |
schema | Schema data |
|
inline |
Registers a data schema.
Data schemas provide information for how a certain data type string can be decoded. The type string of a data schema indicates the type of the schema itself (e.g. "protobuf" for protobuf schemas, "struct" for struct schemas, etc). In NetworkTables, schemas are published just like normal topics, with the name being generated from the provided name: "/.schema/<name>". Duplicate calls to this function with the same name are silently ignored.
inst | instance |
name | Name (the string passed as the data type for topics using this schema) |
type | Type of schema (e.g. "protobuf", "struct", etc) |
schema | Schema data |
bool nt::HasSchema | ( | NT_Inst | inst, |
std::string_view | name | ||
) |
Returns whether there is a data schema already registered with the given name.
This does NOT perform a check as to whether the schema has already been published by another node on the network.
inst | instance |
name | Name (the string passed as the data type for topics using this schema) |