VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
makVrv::DtBackgroundLoadContext Class Reference

Context object passed to DtModel::backgroundLoad().

Encapsulates all threading prerequisites for a background load:

Cache writes: backgroundLoad() implementations must NOT call definition()->setCachedData() directly. Instead, call addToPayload() to accumulate entries. The caller (DtBackgroundLoadAsyncTask or DtBackgroundLoader::executeBackgroundLoad) will commit the payload to the definition on the main thread after backgroundLoad() returns.

DtBackgroundLoadContext is constructed exclusively by DtBackgroundLoadAsyncTask::execute() and DtBackgroundLoader::executeBackgroundLoad(). It is non-copyable and non-movable – it must not outlive the lease it references.

Public Member Functions

 DtBackgroundLoadContext (DtModelDefinitionLease &lease)
 
 ~DtBackgroundLoadContext ()
 
 DtBackgroundLoadContext (const DtBackgroundLoadContext &)=delete
 
DtBackgroundLoadContext & operator= (const DtBackgroundLoadContext &)=delete
 
 DtBackgroundLoadContext (DtBackgroundLoadContext &&)=delete
 
DtBackgroundLoadContext & operator= (DtBackgroundLoadContext &&)=delete
 
DtModelDefinition * definition () const
 
const std::string & filename () const
 
const DtModelLoadParams & modelLoadParams () const
 
void addToPayload (const std::string &name, DtVirtualBaseClass *data)
 
DtDefinitionCachePayload & payload ()
 
DtDefinitionCachePayload * extractPayload ()
 

Private Attributes

DtModelDefinitionLease & myLease
 
DtDefinitionCachePayload * myPayload
 

Constructor & Destructor Documentation

makVrv::DtBackgroundLoadContext::DtBackgroundLoadContext ( DtModelDefinitionLease &  lease)
makVrv::DtBackgroundLoadContext::~DtBackgroundLoadContext ( )

DTOR. Deletes the internal payload if extractPayload() was never called.

makVrv::DtBackgroundLoadContext::DtBackgroundLoadContext ( const DtBackgroundLoadContext &  )
delete
makVrv::DtBackgroundLoadContext::DtBackgroundLoadContext ( DtBackgroundLoadContext &&  )
delete

Member Function Documentation

DtBackgroundLoadContext& makVrv::DtBackgroundLoadContext::operator= ( const DtBackgroundLoadContext &  )
delete
DtBackgroundLoadContext& makVrv::DtBackgroundLoadContext::operator= ( DtBackgroundLoadContext &&  )
delete
DtModelDefinition* makVrv::DtBackgroundLoadContext::definition ( ) const

Returns the leased DtModelDefinition.

const std::string& makVrv::DtBackgroundLoadContext::filename ( ) const

Returns the "filename" parameter value captured at lease acquisition time. Empty if the definition has no filename parameter.

const DtModelLoadParams& makVrv::DtBackgroundLoadContext::modelLoadParams ( ) const

Returns the pre-built DtModelLoadParams captured atomically at lease acquisition time. Safe to call from a background thread.

void makVrv::DtBackgroundLoadContext::addToPayload ( const std::string &  name,
DtVirtualBaseClass *  data 
)

Adds a (name, data) pair to the payload accumulated during backgroundLoad(). Ownership of data is transferred to the payload. The payload is committed to the definition on the main thread by the caller after backgroundLoad() returns.

DtDefinitionCachePayload& makVrv::DtBackgroundLoadContext::payload ( )

Returns a reference to the internal payload for passing directly to functions that accept a DtDefinitionCachePayload*.

DtDefinitionCachePayload* makVrv::DtBackgroundLoadContext::extractPayload ( )

Transfers ownership of the accumulated payload to the caller. Returns nullptr if no entries were added. After this call, the context no longer owns the payload and will not delete it. Called by DtBackgroundLoadAsyncTask::execute() and DtBackgroundLoader::executeBackgroundLoad() after backgroundLoad() returns.

Member Data Documentation

DtModelDefinitionLease& makVrv::DtBackgroundLoadContext::myLease
private
DtDefinitionCachePayload* makVrv::DtBackgroundLoadContext::myPayload
private

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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)