Helpers#

#include "navground/core/common.h"
class TrackChanges#

An helper class that track changes.

Changes are tracked by a bit mask, where the bit index corresponds to different fields that may change. The class is mainly used for tracking changes in a Behavior to enable caching when the relevant part of the state has not changed.

Subclassed by navground::core::Behavior, navground::core::GeometricState

Public Functions

inline TrackChanges()#

Constructs a new instance.

inline bool changed(unsigned mask = 0xFFFFFFFF) const#

Query if there was a change.

Parameters:

mask[in] The bit mask of the indices we are interested in.

Returns:

True if there is a recorded change in one of the indices.

inline void reset_changes()#

Reset the bit mask.

inline void change(unsigned mask)#

Notify a change.

Parameters:

mask[in] A bit mask where indices that have changed are set to 1.