• <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>
  • Compute Graph Framework SDK Reference  5.22
    All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    Channel.hpp
    Go to the documentation of this file.
    1
    2//
    3// Notice
    4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
    5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
    6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
    7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
    8//
    9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
    10// information or for any infringement of patents or other rights of third parties that may
    11// result from its use. No license is granted by implication or otherwise under any patent
    12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
    13// expressly authorized by NVIDIA. Details are subject to change without notice.
    14// This code supersedes and replaces all information previously supplied.
    15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
    16// components in life support devices or systems without express written approval of
    17// NVIDIA CORPORATION & AFFILIATES.
    18//
    19// SPDX-FileCopyrightText: Copyright (c) 2018-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
    20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
    21//
    22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
    23// property and proprietary rights in and to this material, related
    24// documentation and any modifications thereto. Any use, reproduction,
    25// disclosure or distribution of this material and related documentation
    26// without an express license agreement from NVIDIA CORPORATION or
    27// its affiliates is strictly prohibited.
    28//
    30
    31#ifndef DW_FRAMEWORK_CHANNEL_HPP_
    32#define DW_FRAMEWORK_CHANNEL_HPP_
    33
    34#include "ChannelParameters.hpp"
    35#include "IChannelPacket.hpp"
    36
    37#include <dw/core/context/Context.h>
    38#include <dwshared/dwfoundation/dw/core/language/Function.hpp>
    39#include <dwshared/dwfoundation/dw/core/container/BaseString.hpp>
    40#include <dw/core/health/HealthSignals.h>
    41
    42#include <memory>
    43#include <mutex>
    44#include <string>
    45
    46namespace dw
    47{
    48namespace framework
    49{
    50
    52// coverity[autosar_cpp14_a0_1_1_violation]
    53// coverity[autosar_cpp14_m0_1_4_violation]
    54static constexpr dwTime_t CHN_WAIT_TIMEOUT_US{50'000'000};
    55
    60{
    61public:
    62 virtual ~ChannelObject() = default;
    63
    68 {
    69 public:
    78 virtual void getSyncObjs(dw::core::span<NvSciSyncObj>& syncObjs) = 0;
    79 };
    80
    84 class SyncWaiter : public SyncClient
    85 {
    86 public:
    97 virtual void getWaitFences(void* data, dw::core::span<NvSciSyncFence>& waitFences) = 0;
    98 };
    99
    104 {
    105 public:
    114 virtual void setSignalFences(void* data, dw::core::span<const NvSciSyncFence> postFences) = 0;
    115 };
    116
    120 // coverity[autosar_cpp14_m3_4_1_violation] RFD Pending: TID-2586
    122 {
    123 public:
    125
    127
    137 virtual dwStatus wait(dwTime_t timeout) = 0;
    138
    142 virtual dw::core::VectorFixed<GenericData> getAllBuffers() = 0;
    143 };
    144
    148 class Producer : public PacketPool
    149 {
    150 public:
    157 // coverity[autosar_cpp14_a2_10_5_violation]
    158 virtual dwStatus get(GenericData* data) = 0;
    168 virtual dwStatus send(void* data) = 0;
    169
    178 virtual dwStatus release(void* data) = 0;
    179
    180 virtual dwTime_t getCurrentTime() = 0;
    181 };
    182
    186 class Consumer : public PacketPool
    187 {
    188 public:
    199 virtual dwStatus recv(GenericData* data) = 0;
    210 virtual dwStatus release(void* data) = 0;
    211 };
    212
    223 virtual Producer* getProducer(const GenericDataReference& ref) = 0;
    224
    234 virtual Consumer* getConsumer(const GenericDataReference& ref) = 0;
    235
    240 virtual bool hasClients() const = 0;
    241
    246 virtual bool isConnected() const = 0;
    247
    258 virtual dwStatus connect(dwTime_t timeout) = 0;
    259
    263 virtual const ChannelParams& getParams() const = 0;
    264
    265 virtual ChannelParams& getParams() = 0;
    266
    272 virtual void disconnectEndpoint(const char* nvsciipcEndpoint) = 0;
    273
    279 virtual void connectEndpoint(const char* nvsciipcEndpoint) = 0;
    280};
    281
    283{
    284 CONNECTED,
    286 ERROR,
    287 READY,
    289};
    290
    291// coverity[autosar_cpp14_a0_1_6_violation]
    293{
    295 uint32_t uid;
    296 uint32_t connectGroupID;
    297 void* opaque;
    299};
    300
    301// coverity[autosar_cpp14_a0_1_6_violation]
    303{
    304 dwErrorSignal errorSignal;
    305 dw::core::FixedString<64U> nvsciipcEndpoint;
    306};
    307
    308} // namespace framework
    309} // namespace dw
    310
    311#endif // DW_FRAMEWORK_CHANNEL_HPP_
    virtual dwStatus recv(GenericData *data)=0
    virtual dwStatus release(void *data)=0
    virtual dwStatus wait(dwTime_t timeout)=0
    virtual dw::core::VectorFixed< GenericData > getAllBuffers()=0
    virtual dwStatus get(GenericData *data)=0
    virtual dwStatus release(void *data)=0
    virtual dwStatus send(void *data)=0
    virtual void getSyncObjs(dw::core::span< NvSciSyncObj > &syncObjs)=0
    virtual void setSignalFences(void *data, dw::core::span< const NvSciSyncFence > postFences)=0
    virtual void getWaitFences(void *data, dw::core::span< NvSciSyncFence > &waitFences)=0
    virtual ChannelParams & getParams()=0
    virtual const ChannelParams & getParams() const =0
    virtual Consumer * getConsumer(const GenericDataReference &ref)=0
    virtual ~ChannelObject()=default
    virtual bool isConnected() const =0
    virtual dwStatus connect(dwTime_t timeout)=0
    virtual void connectEndpoint(const char *nvsciipcEndpoint)=0
    virtual void disconnectEndpoint(const char *nvsciipcEndpoint)=0
    virtual bool hasClients() const =0
    virtual Producer * getProducer(const GenericDataReference &ref)=0
    dw::core::FixedString< 64U > nvsciipcEndpoint
    The endpoint, if relevant, or empty string.
    Definition: Channel.hpp:305
    uint32_t connectGroupID
    connect group identifier of the event, relevant only for group connected event
    Definition: Channel.hpp:296
    void * opaque
    The opaque pointer set for the channel tthat is ready. Only valid for type=READY.
    Definition: Channel.hpp:297
    @ GROUP_CONNECTED
    Channel group connected.
    @ DISCONNECTED
    Channel became or is disconnected.
    @ CONNECTED
    Channel became connected.
    @ ERROR
    Channel encountered error.
    dw::framework::OnDataReady onDataReady
    The callback set for the channel that is ready. Only valid for type=READY.
    Definition: Channel.hpp:298
    dw::core::Function< void()> OnDataReady
    dwErrorSignal errorSignal
    The error signal.
    Definition: Channel.hpp:304
    uint32_t uid
    unique identifier of the channel
    Definition: Channel.hpp:295
    static constexpr dwTime_t CHN_WAIT_TIMEOUT_US
    Definition: Channel.hpp:54
    ChannelEventType type
    The type of the event.
    Definition: Channel.hpp:294
    Definition: Buffer.hpp:41
    人人超碰97caoporen国产