• <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>
  • Compute Graph Framework SDK Reference  5.10
    All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    ChannelFactory.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) 2020-2022 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_ICHANNELFACTORY_HPP_
    32#define DW_FRAMEWORK_ICHANNELFACTORY_HPP_
    33
    36#include <dw/core/health/HealthSignals.h>
    37#include <nvscisync.h>
    38
    39namespace dw
    40{
    41namespace framework
    42{
    43
    44using ChannelPacketConstructor = dw::core::Function<std::unique_ptr<IChannelPacket>(GenericData dataSpecimen, dwContextHandle_t context)>;
    45using ChannelPacketConstructorSignature = std::pair<ChannelPacketTypeID, ChannelType>;
    46using ChannelPacketConstructorRegistration = std::pair<ChannelPacketConstructorSignature, ChannelPacketConstructor>;
    47
    48class ChannelFactoryImpl;
    49
    51{
    52 CONNECTED,
    54 ERROR,
    55 READY
    56};
    57
    59{
    61 uint32_t uid;
    62 void* opaque;
    64 dwErrorSignal errorSignal;
    65};
    66 class ChannelFactory
    70{
    71public:
    93
    99 ChannelFactory(dwContextHandle_t ctx = DW_NULL_HANDLE);
    100 virtual ~ChannelFactory() = default;
    101
    108 std::shared_ptr<ChannelObject> makeChannel(const char* channelParams);
    109
    110 // Get the packet factory so registered packet constructors can be accessed directly
    112
    113 // Get the nvscisync module used by underlying NvSciStream channels. This NvSciSyncModule is owned
    114 // internally by channels and shall not be freed by application.
    115 NvSciSyncModule getNvSciSyncModule();
    116
    127
    136
    137 using OnDispatchDataReady = dw::core::Function<void(void* opaque, ChannelObject::PacketPool::OnDataReady)>;
    139
    150 bool getEvent(ChannelEvent& event, dwTime_t timeout);
    151
    152private:
    153 std::shared_ptr<ChannelFactoryImpl> m_pimpl;
    154};
    155
    156} // namespace framework
    157} // namespace dw
    158
    159#endif // DW_FRAMEWORK_ICHANNELFACTORY_HPP_
    NvSciSyncModule getNvSciSyncModule()
    virtual ~ChannelFactory()=default
    ChannelFactory(dwContextHandle_t ctx=DW_NULL_HANDLE)
    Construct a new Channel Factory object.
    std::shared_ptr< ChannelObject > makeChannel(const char *channelParams)
    static void unregisterPacketConstructor(const ChannelPacketConstructorSignature &signature)
    dw::core::Function< void(void *opaque, ChannelObject::PacketPool::OnDataReady)> OnDispatchDataReady
    void setOnDispatchDataReady(OnDispatchDataReady dispatchDataReady)
    static void registerPacketConstructor(const ChannelPacketConstructorSignature &signature, const ChannelPacketConstructor &constructor)
    bool getEvent(ChannelEvent &event, dwTime_t timeout)
    ChannelPacketFactoryPtr getPacketFactory()
    dw::core::Function< void()> OnDataReady
    Definition: Channel.hpp:134
    std::pair< ChannelPacketTypeID, ChannelType > ChannelPacketConstructorSignature
    std::shared_ptr< IChannelPacketFactory > ChannelPacketFactoryPtr
    dwErrorSignal errorSignal
    The error signal. Only valid for type=ERROR.
    void * opaque
    The opaque pointer set for the channel tthat is ready. Only valid for type=READY.
    @ DISCONNECTED
    Channel became disconnected.
    @ CONNECTED
    Channel became connected.
    @ ERROR
    Channel encountered error.
    dw::core::Function< std::unique_ptr< IChannelPacket >(GenericData dataSpecimen, dwContextHandle_t context)> ChannelPacketConstructor
    std::pair< ChannelPacketConstructorSignature, ChannelPacketConstructor > ChannelPacketConstructorRegistration
    uint32_t uid
    unique identifier of the channel
    ChannelObject::PacketPool::OnDataReady onDataReady
    The callback set for the channel that is ready. Only valid for type=READY.
    ChannelEventType type
    The type of the event.
    Definition: Buffer.hpp:40
    人人超碰97caoporen国产