SOFA API  c4ac86de
Open source framework for multi-physics simuation
sofa::core::DataTracker Struct Reference

#include <DataTracker.h>

Detailed Description

Tracking Data mechanism to be able to check when selected Data changed since their last clean.

The Data must be added to tracking system by calling "trackData". Then it can be checked if it changed with "hasChanged" since its last "clean".

Use datatrackers to check if your data have changed! Do not use BaseData's "isDirty()" method, as it has a completely different purpose: BaseData::isDirty() checks whether or not the data is up-to-date with its parent values while DataTracker::hasChanged(myData) checks whether the data has been modified since it has last been checked

Protected Attributes

DataTrackers m_dataTrackers
 

Public Member Functions

void trackData (const objectmodel::BaseData &data)
 
bool hasChanged (const objectmodel::BaseData &data)
 
bool hasChanged ()
 Did one of the tracked data change since the last call to clean()? More...
 
void clean (const objectmodel::BaseData &data)
 
void clean ()
 comparison point is cleaned for all tracked Data More...
 
const std::map< const objectmodel::BaseData *, int > & getMapTrackedData ()
 Provide the map of tracked Data. More...
 

Attribute details

DataTrackers sofa::core::DataTracker::m_dataTrackers
protected

Function details

void sofa::core::DataTracker::clean ( const objectmodel::BaseData data)

comparison point is cleaned for the specified tracked Data

Warning
data must be a tracked Data
See also
trackData
void sofa::core::DataTracker::clean ( )

comparison point is cleaned for all tracked Data

const std::map<const objectmodel::BaseData*,int>& sofa::core::DataTracker::getMapTrackedData ( )
inline

Provide the map of tracked Data.

bool sofa::core::DataTracker::hasChanged ( const objectmodel::BaseData data)

Did the data change since its last access?

Warning
data must be a tracked Data
See also
trackData
bool sofa::core::DataTracker::hasChanged ( )

Did one of the tracked data change since the last call to clean()?

void sofa::core::DataTracker::trackData ( const objectmodel::BaseData data)

select a Data to track to be able to check if it was dirtied since the previous clean.

See also
isTrackedDataDirty