.. _program_listing_file_foxglove_include_foxglove_channel.hpp: Program Listing for File channel.hpp ==================================== |exhale_lsh| :ref:`Return to documentation for file ` (``foxglove/include/foxglove/channel.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include #include #include #include #include #include #include struct foxglove_channel; struct foxglove_channel_descriptor; namespace foxglove { class ChannelDescriptor { const foxglove_channel_descriptor* channel_descriptor_; public: explicit ChannelDescriptor(const foxglove_channel_descriptor* channel_descriptor); [[nodiscard]] const std::string_view topic() const noexcept; [[nodiscard]] const std::string_view message_encoding() const noexcept; [[nodiscard]] const std::optional> metadata() const noexcept; [[nodiscard]] const std::optional schema() const noexcept; }; using SinkChannelFilterFn = std::function; class RawChannel final { public: static FoxgloveResult create( const std::string_view& topic, const std::string_view& message_encoding, std::optional schema = std::nullopt, const Context& context = Context(), std::optional> metadata = std::nullopt ); FoxgloveError log( const std::byte* data, size_t data_len, std::optional log_time = std::nullopt, std::optional sink_id = std::nullopt ) noexcept; void close() noexcept; [[nodiscard]] uint64_t id() const noexcept; [[nodiscard]] std::string_view topic() const noexcept; [[nodiscard]] std::string_view message_encoding() const noexcept; [[nodiscard]] bool has_sinks() const noexcept; [[nodiscard]] std::optional schema() const noexcept; std::optional> metadata() const noexcept; RawChannel(const RawChannel&) = delete; RawChannel& operator=(const RawChannel&) = delete; RawChannel(RawChannel&& other) noexcept = default; RawChannel& operator=(RawChannel&& other) noexcept = default; ~RawChannel() = default; private: explicit RawChannel(const foxglove_channel* channel); schemas::ChannelUniquePtr impl_; }; } // namespace foxglove