NVIDIA Holoscan SDK v3.8.0

Program Listing for File data_logger.hpp

Return to documentation for file (include/holoscan/core/data_logger.hpp)

Copy
Copied!
            

/* * SPDX-FileCopyrightText: Copyright (c) 2025 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 HOLOSCAN_CORE_DATA_LOGGER_HPP #define HOLOSCAN_CORE_DATA_LOGGER_HPP #include <any> #include <cstdint> #include <memory> #include <optional> #include <string> #include "./io_spec.hpp" // Forward declaration to avoid including <cuda_runtime.h> extern "C" { typedef struct CUstream_st* cudaStream_t; } namespace holoscan { class MetadataDictionary; // forward declaration class Tensor; // forward declaration class TensorMap; // forward declaration class DataLogger { public: DataLogger() = default; virtual ~DataLogger() = default; virtual bool log_data(const std::any& data, const std::string& unique_id, int64_t acquisition_timestamp = -1, const std::shared_ptr<MetadataDictionary>& metadata = nullptr, IOSpec::IOType io_type = IOSpec::IOType::kOutput, std::optional<cudaStream_t> stream = std::nullopt) = 0; virtual bool log_tensor_data(const std::shared_ptr<Tensor>& tensor, const std::string& unique_id, int64_t acquisition_timestamp = -1, const std::shared_ptr<MetadataDictionary>& metadata = nullptr, IOSpec::IOType io_type = IOSpec::IOType::kOutput, std::optional<cudaStream_t> stream = std::nullopt) = 0; virtual bool log_tensormap_data(const TensorMap& tensor_map, const std::string& unique_id, int64_t acquisition_timestamp = -1, const std::shared_ptr<MetadataDictionary>& metadata = nullptr, IOSpec::IOType io_type = IOSpec::IOType::kOutput, std::optional<cudaStream_t> stream = std::nullopt) = 0; virtual bool log_backend_specific( [[maybe_unused]] const std::any& data, [[maybe_unused]] const std::string& unique_id, [[maybe_unused]] int64_t acquisition_timestamp = -1, [[maybe_unused]] const std::shared_ptr<MetadataDictionary>& metadata = nullptr, [[maybe_unused]] IOSpec::IOType io_type = IOSpec::IOType::kOutput, [[maybe_unused]] std::optional<cudaStream_t> stream = std::nullopt) { // Default implementation: backend-specific logging is not supported return false; } virtual bool should_log_output() const = 0; virtual bool should_log_input() const = 0; virtual void shutdown() { // Default implementation: no shutdown needed } }; } // namespace holoscan #endif/* HOLOSCAN_CORE_DATA_LOGGER_HPP */

© Copyright 2022-2025, NVIDIA. Last updated on Nov 6, 2025