![]() |
VR-Forces 4.3 Class Documentation
|
DtPreprocessor is a trait which allows a derived class to specify extra processing to be performed prior to tick(), typically in parallel. More...

Public Member Functions | |
| virtual void | preprocess ()=0 |
| Pre-compute costly values in advance of tick using parallel threads. | |
DtPreprocessor is a trait which allows a derived class to specify extra processing to be performed prior to tick(), typically in parallel.
Use case 1: using preprocess in a DtSimComponent. DtSimComponent::init adds 'this' to the entity's DtSequentialPreprocessorContainer. When an entity is preprocessed, it preprocesses its DtSimComponents sequentially in a single thread. This preserves single thread semantics between DtSimComponents in the same DtVrfObject, and between DtSimComponents and anything exclusively accessed in the DtVrfObject (such as DtVrfObject member variables). Don't override ::preprocess() in a DtSimComponent descendant, instead override the ::parallelTick method. DtSimComponent::preprocess() check whether it's time to tick before calling ::parallelTick. Be careful to watch thread semantics when accessing data 'outside' the containing entity.
Use case 2: preprocess in DtVrfObject. DtVrfObjMgr adds DtVrfObjects to a DtParallelPreprocessorContainer. During DtVrfObjMgr::tick all DtVrfObjects::preprocess are called in parallel with each other.
|
pure virtual |
Pre-compute costly values in advance of tick using parallel threads.
Implemented in DtVrfObject, DtSimComponent, and DtEngineeringObjectSensor.
Referenced by DtParallelPreprocessorContainer::preprocess(), and DtSequentialPreprocessorContainer::preprocess().