2015-07-10 06:01:56 -07:00
|
|
|
/**
|
2019-03-31 13:56:13 -07:00
|
|
|
* @file local_version_holder.h
|
2015-07-10 06:01:56 -07:00
|
|
|
*
|
|
|
|
* @date Mar 19, 2014
|
2017-01-03 03:05:22 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2017
|
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
|
|
|
|
*
|
2019-01-15 18:51:09 -08:00
|
|
|
* @return true if 'globalVersion' has changed since last time we've invoked this method
|
2018-02-03 09:40:17 -08:00
|
|
|
*/
|
2019-01-15 18:51:09 -08:00
|
|
|
bool isOld(int globalVersion);
|
2015-07-10 06:01:56 -07:00
|
|
|
int getVersion();
|
|
|
|
|
|
|
|
private:
|
2019-04-15 18:02:25 -07:00
|
|
|
/**
|
|
|
|
* we want local version to be 'old' on instantiation
|
|
|
|
*/
|
|
|
|
int localVersion = -1;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* LOCALVERSIONHOLDER_H_ */
|