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::DtDefinitionCachePayload Class Reference

Accumulates definition cache entries produced by a background load.

A background thread calls add() to record (name, data) pairs that would otherwise be written directly to DtModelDefinition via setCachedData(). The payload is then transferred to the main thread, where commitTo() writes each entry into the definition. This ensures setCachedData() is always called on the main thread, eliminating the need to hold the per-filename loading mutex across the cache write.

Ownership: this object owns all data pointers added to it until commitTo() is called. If the object is destroyed before commitTo(), all remaining data pointers are deleted to prevent leaks.

Public Member Functions

 DtDefinitionCachePayload (const std::string &definitionName)
 
 ~DtDefinitionCachePayload ()
 
 DtDefinitionCachePayload (const DtDefinitionCachePayload &)=delete
 
DtDefinitionCachePayload & operator= (const DtDefinitionCachePayload &)=delete
 
void add (const std::string &name, DtVirtualBaseClass *data)
 
void commitTo (DtModelDefinition &definition)
 
const std::string & definitionName () const
 
bool empty () const
 

Private Attributes

std::string myDefinitionName
 
std::vector< std::pair
< std::string,
DtVirtualBaseClass * > > 
myEntries
 

Constructor & Destructor Documentation

makVrv::DtDefinitionCachePayload::DtDefinitionCachePayload ( const std::string &  definitionName)
explicit

CTOR.

Parameters
definitionNameThe name of the DtModelDefinition that owns this payload. Used by the main thread to look up the definition before calling commitTo().
makVrv::DtDefinitionCachePayload::~DtDefinitionCachePayload ( )

DTOR. Deletes any data pointers that were not committed.

makVrv::DtDefinitionCachePayload::DtDefinitionCachePayload ( const DtDefinitionCachePayload &  )
delete

Member Function Documentation

DtDefinitionCachePayload& makVrv::DtDefinitionCachePayload::operator= ( const DtDefinitionCachePayload &  )
delete
void makVrv::DtDefinitionCachePayload::add ( const std::string &  name,
DtVirtualBaseClass *  data 
)

Adds a (name, data) pair to the payload. Ownership of data is transferred to this object. Passing a null data pointer is valid and records an explicit clear.

void makVrv::DtDefinitionCachePayload::commitTo ( DtModelDefinition &  definition)

Commits all entries to the given definition via setCachedData(), then clears the internal list. Safe to call only on the main thread.

const std::string& makVrv::DtDefinitionCachePayload::definitionName ( ) const

Returns the definition name supplied at construction.

bool makVrv::DtDefinitionCachePayload::empty ( ) const

Returns true if no entries have been added.

Member Data Documentation

std::string makVrv::DtDefinitionCachePayload::myDefinitionName
private
std::vector<std::pair<std::string, DtVirtualBaseClass*> > makVrv::DtDefinitionCachePayload::myEntries
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)