/**
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
 * CANN Open Software License Agreement Version 2.0 (the "License").
 * Please refer to the License for details. You may not use this file except in compliance with the License.
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
 * See LICENSE in the root of the software repository for the full text of the License.
 */

#ifndef MSPROF_ENGINE_PROF_REPORTER_H
#define MSPROF_ENGINE_PROF_REPORTER_H

#if (defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER))
#define MSVP_PROF_API __declspec(dllexport)
#else
#define MSVP_PROF_API __attribute__((visibility("default")))
#endif

#include "prof_api.h"

/**
 * @file prof_reporter.h
 * @defgroup reporter the reporter group
 * This is the reporter group
 */
namespace Msprof {
namespace Engine {
/**
 * @ingroup reporter
 * @brief class Reporter
 *  the Reporter class .used to send data to profiling
 */
class MSVP_PROF_API Reporter {
public:
    virtual ~Reporter() {}

public:
    /**
     * @ingroup reporter
     * @name  : Report
     * @brief : API of libmsprof, report data to libmsprof, it's a non-blocking function \n
                The data will be firstly appended to cache, if the cache is full, data will be ignored
    * @param data [IN] const ReporterData * the data send to libmsporf
    * @retval PROFILING_SUCCESS 0 (success)
    * @retval PROFILING_FAILED -1 (failed)
    *
    * @par depend:
    * @li libmsprof
    * @li prof_reporter.h
    * @since c60
    * @see Flush
    */
    virtual int32_t Report(const ReporterData *data) = 0;

    /**
     * @ingroup reporter
     * @name  : Flush
     * @brief : API of libmsprof, notify libmsprof send data over, it's a blocking function \n
                The all datas of cache will be write to file or send to host
    * @retval PROFILING_SUCCESS 0 (success)
    * @retval PROFILING_FAILED -1 (failed)
    *
    * @par depend:
    * @li libmsprof
    * @li prof_reporter.h
    * @since c60
    * @see ProfMgrStop
    */
    virtual int32_t Flush() = 0;

    virtual uint32_t GetReportDataMaxLen() const = 0;
};

}  // namespace Engine
}  // namespace Msprof

#endif  // MSPROF_ENGINE_PROF_REPORTER_H