fome-fw/firmware/util/containers/local_version_holder.h

36 lines
704 B
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file local_version_holder.h
2015-07-10 06:01:56 -07:00
*
* @date Mar 19, 2014
2020-01-13 18:57:43 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
#ifndef LOCALVERSIONHOLDER_H_
#define LOCALVERSIONHOLDER_H_
#include "stdbool.h"
2018-02-03 09:40:17 -08:00
/**
* this
*/
2015-07-10 06:01:56 -07:00
class LocalVersionHolder {
public:
2018-02-03 09:40:17 -08:00
/**
* Calling this method changes the internal state of the class - each consumer interested in tracking
* changes should have it's own instance of this class
*
* @return true if 'globalVersion' has changed since last time we've invoked this method
2018-02-03 09:40:17 -08:00
*/
bool isOld(int globalVersion);
2019-06-07 00:50:04 -07:00
int getVersion() const;
2015-07-10 06:01:56 -07:00
private:
/**
* we want local version to be 'old' on instantiation
*/
int localVersion = -1;
2015-07-10 06:01:56 -07:00
};
#endif /* LOCALVERSIONHOLDER_H_ */