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.
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 () |
abiDataLoader * | ptr () const |
abiDataLoader * | operator-> () const |
operator bool () const | |
operator ShrdPtr< abiDataLoader > () | |
abiRefT< abiDataLoader > * | release () |
void | reset (abiRefT< abiDataLoader > *abiref=nullptr) |
abiRefT< abiDataLoader > * | abiRef () const |
|
inherited |
|
inline |
Definition at line 52 of file dataloader.hpp.
|
default |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 76 of file dataprocess.hpp.
|
inlineinherited |
Definition at line 94 of file dataprocess.hpp.
|
inlineinherited |
Definition at line 101 of file dataprocess.hpp.
|
inline |
Definition at line 57 of file dataloader.hpp.
References ds3d::cppString(), DS_ASSERT, ds3d::kOutput, and ds3d::GuardDataT< abiDataLoader >::ptr().
Referenced by ds3d::gst::NvDs3D_CreateDataLoaderSrc().
|
inlinevirtualinherited |
Definition at line 55 of file dataprocess.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Definition at line 63 of file dataloader.hpp.
References DS_ASSERT, ds3d::GuardDataT< abiDataLoader >::ptr(), ds3d::abiDataLoader::readData_i(), and ds3d::GuardRef< ref, >::reset().
|
inline |
Definition at line 72 of file dataloader.hpp.
References ds3d::GuardRef< abiCB >::abiRef(), DS_ASSERT, ds3d::GuardDataT< abiDataLoader >::ptr(), ds3d::abiDataLoader::readDataAsync_i(), and ds3d::GuardCB< abiCB >::setFn().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 62 of file dataprocess.hpp.
|
inlineinherited |
Definition at line 44 of file dataprocess.hpp.
|
inlineinherited |
Definition at line 70 of file dataprocess.hpp.
|
inlineinherited |
Definition at line 88 of file dataprocess.hpp.
|
inlineinherited |
Definition at line 82 of file dataprocess.hpp.