Program Listing for File holoscan_component_payloads.hpp
↰ Return to documentation for file (include/holoscan/pubsub/common/holoscan_component_payloads.hpp)
/*
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef PUBSUB_COMMON_INCLUDE_PUBSUB_HOLOSCAN_COMPONENT_PAYLOADS_HPP
#define PUBSUB_COMMON_INCLUDE_PUBSUB_HOLOSCAN_COMPONENT_PAYLOADS_HPP
#include <cstdint>
#include <string>
#include <vector>
#include <holoscan/core/errors.hpp>
#include <holoscan/core/expected.hpp>
#include <holoscan/core/message.hpp>
#include <holoscan/core/messagelabel.hpp>
#include <holoscan/core/metadata.hpp>
namespace holoscan {
struct EncodedMessagePayload {
std::string codec_name;
std::vector<uint8_t> payload;
};
expected<EncodedMessagePayload, RuntimeError> encode_message_payload(const Message& message);
expected<Message, RuntimeError> decode_message_payload(const std::string& codec_name,
const std::vector<uint8_t>& payload);
expected<std::vector<uint8_t>, RuntimeError> encode_metadata_dictionary_payload(
const MetadataDictionary& metadata);
expected<MetadataDictionary, RuntimeError> decode_metadata_dictionary_payload(
const std::vector<uint8_t>& payload);
expected<std::vector<uint8_t>, RuntimeError> encode_message_label_payload(
const MessageLabel& label);
expected<MessageLabel, RuntimeError> decode_message_label_payload(
const std::vector<uint8_t>& payload);
} // namespace holoscan
#endif/* PUBSUB_COMMON_INCLUDE_PUBSUB_HOLOSCAN_COMPONENT_PAYLOADS_HPP */