Class ChannelSet¶
Defined in File data_provider.hpp
Class Documentation¶
-
class ChannelSet¶
A helper for building topic and schema metadata for a StreamedSource.
Handles schema extraction from Foxglove schema types, schema ID assignment, and deduplication. If multiple channels share the same schema, only one schema entry will be created.
foxglove::data_provider::ChannelSet channels; channels.insert<foxglove::schemas::Vector3>("/topic1"); channels.insert<foxglove::schemas::Vector3>("/topic2"); // reuses schema ID foxglove::data_provider::StreamedSource source; source.topics = std::move(channels.topics); source.schemas = std::move(channels.schemas);
Public Functions
-
template<typename T>
inline void insert(const std::string &topic)¶ Insert a channel for schema type
Ton the given topic.Tmust have a staticschema()method returningfoxglove::Schema(all generated types infoxglove::schemassatisfy this). The message encoding is assumed to be “protobuf”.- Template Parameters:
T – A Foxglove schema type (e.g.
foxglove::schemas::Vector3).- Parameters:
topic – The topic name for this channel.
- Throws:
std::overflow_error – if more than 65535 distinct schemas are added.
-
template<typename T>