Loading [MathJax]/extensions/tex2jax.js
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
mx::base::changeable< _derivedT > Class Template Reference

template<class _derivedT>
class mx::base::changeable< _derivedT >

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< _derivedT >:

Public Types

typedef uint64_t changeT
 The integer type of the counter.
 

Public Member Functions

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

Member Typedef Documentation

◆ changeT

template<class _derivedT >
typedef uint64_t mx::base::changeable< _derivedT >::changeT

The integer type of the counter.

Definition at line 33 of file changeable.hpp.

Member Function Documentation

◆ change()

template<class _derivedT >
changeT mx::base::changeable< _derivedT >::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 56 of file changeable.hpp.

◆ changed()

template<class _derivedT >
void mx::base::changeable< _derivedT >::changed ( )
inline

Increment the counter.

Call this function anytime the derived class changes something important.

Definition at line 47 of file changeable.hpp.


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