![]() |
VR-Forces Developer's Guide
|
This class represents a RAII (Resource Acquisition Is Initialization) handle returned by DtModelDefinitionManager::acquireLease().
While a lease is held, the associated DtModelDefinition will not be deleted. The filename and a pre-built DtModelLoadParams are captured atomically (under the manager's mutex) at acquisition time. Background threads must use modelLoadParams() on the lease rather than calling definition()->findParameter() directly, to avoid racing with main-thread writes to myParameters.
Leases are move-only; copying is disabled.
Public Member Functions | |
| DtModelDefinitionLease () | |
| ~DtModelDefinitionLease () | |
| DtModelDefinitionLease (DtModelDefinitionLease &&other) noexcept | |
| DtModelDefinitionLease & | operator= (DtModelDefinitionLease &&other) noexcept |
| DtModelDefinitionLease (const DtModelDefinitionLease &)=delete | |
| DtModelDefinitionLease & | operator= (const DtModelDefinitionLease &)=delete |
| bool | isValid () const |
| DtModelDefinition * | definition () const |
| const std::string & | filename () const |
| const DtModelLoadParams & | modelLoadParams () const |
| void | release () |
| boost::recursive_mutex & | modelLoadingMutex () const |
Protected Member Functions | |
| DtModelDefinitionLease (DtModelDefinition *def, const std::string &modelName, const std::string &filename, const DtModelLoadParams &modelLoadParams, boost::recursive_mutex *modelLoadingMutex, DtModelDefinitionManager *manager) | |
Protected Attributes | |
| DtModelDefinition * | myDefinition |
| std::string | myModelName |
| std::string | myFilename |
| DtModelLoadParams | myModelLoadParams |
| DtModelDefinitionManager * | myManager |
| boost::recursive_mutex * | myModelLoadingMutex |
Friends | |
| class | DtModelDefinitionManager |
| makVrv::DtModelDefinitionLease::DtModelDefinitionLease | ( | ) |
| makVrv::DtModelDefinitionLease::~DtModelDefinitionLease | ( | ) |
|
noexcept |
|
delete |
|
protected |
|
noexcept |
|
delete |
| bool makVrv::DtModelDefinitionLease::isValid | ( | ) | const |
| DtModelDefinition* makVrv::DtModelDefinitionLease::definition | ( | ) | const |
| const std::string& makVrv::DtModelDefinitionLease::filename | ( | ) | const |
| const DtModelLoadParams& makVrv::DtModelDefinitionLease::modelLoadParams | ( | ) | const |
Returns the pre-built DtModelLoadParams captured at acquisition time. Safe to call from a background thread.
| void makVrv::DtModelDefinitionLease::release | ( | ) |
| boost::recursive_mutex& makVrv::DtModelDefinitionLease::modelLoadingMutex | ( | ) | const |
Returns the correct recursive mutex for serializing background loads of this definition. Uses the filename-keyed mutex when a filename is present, otherwise falls back to the definition's own mutex.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |