mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::base::changeable Class Reference

A simple class to track member data changes.

Maintains a monotonic counter that derived classes increment anytime a member datum is changed. This allows for, say, re-initializing automatically on a subsequent call to a function.

Definition at line 26 of file changeable.hpp.

#include <base/changeable.hpp>

+ Inheritance diagram for mx::base::changeable:

Public Types

typedef uint64_t changeT
 The integer type of the counter. More...
 

Public Member Functions

void changed ()
 Increment the counter. More...
 
changeT change ()
 Get the value of the counter. More...
 

Member Typedef Documentation

◆ changeT

The integer type of the counter.

Definition at line 31 of file changeable.hpp.

Member Function Documentation

◆ change()

changeT mx::base::changeable::change ( )
inline

Get the value of the counter.

Get this at a checkpoint and compare it later to decide if any action should be taken.

Definition at line 53 of file changeable.hpp.

◆ changed()

void mx::base::changeable::changed ( )
inline

Increment the counter.

Call this function anytime the derived class changes something important.

Definition at line 44 of file changeable.hpp.


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