NVIDIA DeepStream SDK API Reference

6.4 Release
ds3d::GuardDataLoader Class Reference

Detailed Description

GuardDataLoader is the safe access entry for abiDataLoader.

Applications can use it to make C-based APIs safer. it would manage abiRefDataLoader automatically. with that, App user do not need to refCopy_i or destroy abiRefDataLoader manually.

For example: abiRefDataLoader* rawRefLoader = creator(); GuardDataLoader guardLoader(rawRefLoader, true); // take the ownership of rawRefLoader guardLoader.setUserData(userdata, [](void*){ ...free... }); guardLoader.setErrorCallback([](ErrCode c, const char* msg){ stderr << msg; }); ErrCode c = guardLoader.start(config, path); DS_ASSERT(isGood(c)); c = guardLoader.start(config, path); // invoke abiDataLoader::start_i(...) GuardDataMap data; c = guardLoader.read(data); // invoke abiDataLoader::read_i(...) DS_ASSERT(isGood(c)); DS_ASSERT(data); ... // access data c = guardLoader.stop(); // invoke abiDataLoader::stop_i(...) guardLoader.reset(); // destroy abiRefDataLoader, when all reference // destroyed, abiDataLoader would be freed.

Definition at line 46 of file dataloader.hpp.

Inheritance diagram for ds3d::GuardDataLoader:
Collaboration diagram for ds3d::GuardDataLoader:

Public Types

using abiRefType = abiRefT< abiDataLoader >
 

Public Member Functions

template<typename... Args>
 GuardDataLoader (Args &&... args)
 
 ~GuardDataLoader ()=default
 
std::string getOutputCaps ()
 
ErrCode readData (GuardDataMap &datamap)
 
ErrCode readDataAsync (abiOnDataCB::CppFunc dataReadyCB)
 
void setUserData (void *data, DelF delF)
 
virtual void * getUserData () const
 
void setErrorCallback (abiErrorCB::CppFunc errCb)
 
ErrCode start (const std::string &content, const std::string &path="")
 
ErrCode flush ()
 
ErrCode stop ()
 
State state () const
 
std::string getCaps (CapsPort port)
 
std::string getInputCaps ()
 
GuardTy cast ()
 
abiDataLoaderptr () const
 
abiDataLoaderoperator-> () const
 
 operator bool () const
 
 operator ShrdPtr< abiDataLoader > ()
 
abiRefT< abiDataLoader > * release ()
 
void reset (abiRefT< abiDataLoader > *abiref=nullptr)
 
abiRefT< abiDataLoader > * abiRef () const
 

Member Typedef Documentation

◆ abiRefType

Definition at line 333 of file obj.hpp.

Constructor & Destructor Documentation

◆ GuardDataLoader()

template<typename... Args>
ds3d::GuardDataLoader::GuardDataLoader ( Args &&...  args)
inline

Definition at line 52 of file dataloader.hpp.

◆ ~GuardDataLoader()

ds3d::GuardDataLoader::~GuardDataLoader ( )
default

Member Function Documentation

◆ abiRef()

abiRefT< abiDataLoader > * ds3d::GuardRef< abiRefT< abiDataLoader > , >::abiRef
inlineinherited

Definition at line 269 of file obj.hpp.

◆ cast()

GuardTy ds3d::GuardDataT< abiDataLoader >::cast
inlineinherited

Definition at line 356 of file obj.hpp.

◆ flush()

ErrCode ds3d::GuardDataProcess< abiDataLoader , >::flush
inlineinherited

Definition at line 76 of file dataprocess.hpp.

◆ getCaps()

std::string ds3d::GuardDataProcess< abiDataLoader , >::getCaps ( CapsPort  port)
inlineinherited

Definition at line 94 of file dataprocess.hpp.

◆ getInputCaps()

std::string ds3d::GuardDataProcess< abiDataLoader , >::getInputCaps
inlineinherited

Definition at line 101 of file dataprocess.hpp.

◆ getOutputCaps()

std::string ds3d::GuardDataLoader::getOutputCaps ( )
inline

◆ getUserData()

virtual void* ds3d::GuardDataProcess< abiDataLoader , >::getUserData
inlinevirtualinherited

Definition at line 55 of file dataprocess.hpp.

◆ operator bool()

ds3d::GuardDataT< abiDataLoader >::operator bool
inlineinherited

Definition at line 370 of file obj.hpp.

◆ operator ShrdPtr< abiDataLoader >()

ds3d::GuardDataT< abiDataLoader >::operator ShrdPtr< abiDataLoader >
inlineinherited

Definition at line 372 of file obj.hpp.

◆ operator->()

abiDataLoader * ds3d::GuardDataT< abiDataLoader >::operator->
inlineinherited

Definition at line 368 of file obj.hpp.

◆ ptr()

abiDataLoader * ds3d::GuardDataT< abiDataLoader >::ptr
inlineinherited

Definition at line 361 of file obj.hpp.

◆ readData()

ErrCode ds3d::GuardDataLoader::readData ( GuardDataMap datamap)
inline

◆ readDataAsync()

◆ release()

abiRefT< abiDataLoader > * ds3d::GuardRef< abiRefT< abiDataLoader > , >::release
inlineinherited

Definition at line 253 of file obj.hpp.

◆ reset()

void ds3d::GuardRef< abiRefT< abiDataLoader > , >::reset ( abiRefT< abiDataLoader > *  abiref = nullptr)
inlineinherited

Definition at line 260 of file obj.hpp.

◆ setErrorCallback()

void ds3d::GuardDataProcess< abiDataLoader , >::setErrorCallback ( abiErrorCB::CppFunc  errCb)
inlineinherited

Definition at line 62 of file dataprocess.hpp.

◆ setUserData()

void ds3d::GuardDataProcess< abiDataLoader , >::setUserData ( void *  data,
DelF  delF 
)
inlineinherited

Definition at line 44 of file dataprocess.hpp.

◆ start()

ErrCode ds3d::GuardDataProcess< abiDataLoader , >::start ( const std::string &  content,
const std::string &  path = "" 
)
inlineinherited

Definition at line 70 of file dataprocess.hpp.

◆ state()

State ds3d::GuardDataProcess< abiDataLoader , >::state
inlineinherited

Definition at line 88 of file dataprocess.hpp.

◆ stop()

ErrCode ds3d::GuardDataProcess< abiDataLoader , >::stop
inlineinherited

Definition at line 82 of file dataprocess.hpp.


The documentation for this class was generated from the following file: