NVIDIA DeepStream SDK API Reference
9.0 Release
9.0/sources/includes/ds3d/common/impl/impl_dataloader.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4
*
5
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6
* property and proprietary rights in and to this material, related
7
* documentation and any modifications thereto. Any use, reproduction,
8
* disclosure or distribution of this material and related documentation
9
* without an express license agreement from NVIDIA CORPORATION or
10
* its affiliates is strictly prohibited.
11
*/
12
13
14
#ifndef _DS3D_COMMON_IMPL_BASE_IDATALOADER__H
15
#define _DS3D_COMMON_IMPL_BASE_IDATALOADER__H
16
17
#include "ds3d/common/hpp/datamap.hpp"
18
#include "ds3d/common/impl/impl_dataprocess.h"
19
20
namespace
ds3d
{
namespace
impl {
21
36
class
BaseImplDataLoader :
public
BaseImplDataProcessor<abiDataLoader> {
37
public
:
38
BaseImplDataLoader
() {}
39
~BaseImplDataLoader
()
override
=
default
;
40
41
ErrCode
readData_i
(
abiRefDataMap
*& datamap)
final
42
{
43
DS_ASSERT
(!datamap);
44
DS3D_FAILED_RETURN
(
45
getStateSafe
() ==
State::kRunning
,
ErrCode::kState
,
"dataloader is not started"
);
46
GuardDataMap
data;
47
ErrCode
code =
readDataImpl
(data);
48
datamap = data.
release
();
49
return
code;
50
}
51
ErrCode
readDataAsync_i
(
const
abiOnDataCB
* dataReadyCb)
final
52
{
53
DS3D_FAILED_RETURN
(
54
getStateSafe
() ==
State::kRunning
,
ErrCode::kState
,
"dataloader is not started"
);
55
56
GuardCB<abiOnDataCB>
guardCb(dataReadyCb ? dataReadyCb->refCopy() :
nullptr
);
57
OnGuardDataCBImpl
readyCB = [guardCb = std::move(guardCb),
this
](
58
ErrCode
code,
GuardDataMap
data) {
59
guardCb(code, data.abiRef());
60
};
61
return
readDataAsyncImpl
(std::move(readyCB));
62
}
63
64
protected
:
65
// cplusplus virtual interface, user need to derive from
66
virtual
ErrCode
readDataImpl
(
GuardDataMap
& datamap) = 0;
67
virtual
ErrCode
readDataAsyncImpl
(
OnGuardDataCBImpl
dataReadCB) = 0;
68
};
69
70
class
SyncImplDataLoader :
public
BaseImplDataLoader {
71
protected
:
72
SyncImplDataLoader
() =
default
;
73
ErrCode
readDataAsyncImpl
(
OnGuardDataCBImpl
dataReadCB)
final
{
return
ErrCode::kUnsupported
; }
74
ErrCode
flushImpl
()
override
{
return
ErrCode::kGood
; }
75
};
76
77
}}
// namespace ds3d::impl
78
79
#endif // _DS3D_COMMON_IMPL_BASE_IDATALOADER__H
ds3d::impl::SyncImplDataLoader::readDataAsyncImpl
ErrCode readDataAsyncImpl(OnGuardDataCBImpl dataReadCB) final
Definition:
9.0/sources/includes/ds3d/common/impl/impl_dataloader.h:73
ds3d::impl::BaseImplDataLoader::readDataImpl
virtual ErrCode readDataImpl(GuardDataMap &datamap)=0
ds3d::ErrCode::kUnsupported
@ kUnsupported
DS3D_FAILED_RETURN
#define DS3D_FAILED_RETURN(condition, ret, fmt,...)
Definition:
sources/includes/ds3d/common/defines.h:64
ds3d::impl::BaseImplDataLoader::readDataAsyncImpl
virtual ErrCode readDataAsyncImpl(OnGuardDataCBImpl dataReadCB)=0
ds3d::impl::BaseImplDataLoader::~BaseImplDataLoader
~BaseImplDataLoader() override=default
ds3d::ErrCode::kGood
@ kGood
ds3d::impl::BaseImplDataProcessor< abiDataLoader >::OnGuardDataCBImpl
std::function< void(ErrCode, GuardDataMap)> OnGuardDataCBImpl
Definition:
sources/includes/ds3d/common/impl/impl_dataprocess.h:29
ds3d::abiRefT< abiDataMap >
ds3d::impl::BaseImplDataLoader::BaseImplDataLoader
BaseImplDataLoader()
Definition:
9.0/sources/includes/ds3d/common/impl/impl_dataloader.h:38
DS_ASSERT
#define DS_ASSERT(...)
Definition:
sources/includes/ds3d/common/defines.h:31
ds3d::ErrCode
ErrCode
Definition:
sources/includes/ds3d/common/common.h:43
ds3d::impl::SyncImplDataLoader::SyncImplDataLoader
SyncImplDataLoader()=default
ds3d::impl::BaseImplDataProcessor< abiDataLoader >::getStateSafe
State getStateSafe() const
Definition:
sources/includes/ds3d/common/impl/impl_dataprocess.h:112
ds3d::GuardRef::release
ref * release()
Definition:
sources/includes/ds3d/common/hpp/obj.hpp:253
ds3d::impl::SyncImplDataLoader::flushImpl
ErrCode flushImpl() override
Definition:
9.0/sources/includes/ds3d/common/impl/impl_dataloader.h:74
ds3d::GuardDataMap
Definition:
sources/includes/ds3d/common/hpp/datamap.hpp:21
ds3d::impl::BaseImplDataLoader::readDataAsync_i
ErrCode readDataAsync_i(const abiOnDataCB *dataReadyCb) final
Definition:
9.0/sources/includes/ds3d/common/impl/impl_dataloader.h:51
ds3d::State::kRunning
@ kRunning
ds3d::impl::BaseImplDataLoader::readData_i
ErrCode readData_i(abiRefDataMap *&datamap) final
Definition:
9.0/sources/includes/ds3d/common/impl/impl_dataloader.h:41
ds3d
Definition:
sources/includes/ds3d/common/abi_dataprocess.h:21
ds3d::abiCallBackT
Definition:
sources/includes/ds3d/common/abi_obj.h:71
ds3d::ErrCode::kState
@ kState
ds3d::GuardCB
Definition:
sources/includes/ds3d/common/hpp/obj.hpp:285
Privacy Policy
|
Manage My Privacy
|
Do Not Sell or Share My Data
|
Terms of Service
|
Accessibility
|
Corporate Policies
|
Product Security
|
Contact
© 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
NVIDIA Confidential | Subject to Change | For test and development only.
Fri Mar 20 2026 14:36:59 | PR-09318-R32