2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file LocalVersionHolder.cpp
|
|
|
|
*
|
|
|
|
* @date Mar 19, 2014
|
2018-01-20 17:55:31 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2018
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "LocalVersionHolder.h"
|
|
|
|
|
|
|
|
LocalVersionHolder::LocalVersionHolder() {
|
|
|
|
/**
|
|
|
|
* we want local version to be 'old' on instantiation
|
|
|
|
*/
|
|
|
|
localVersion = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int LocalVersionHolder::getVersion() {
|
|
|
|
return localVersion;
|
|
|
|
}
|
|
|
|
|
2019-01-15 18:51:09 -08:00
|
|
|
bool LocalVersionHolder::isOld(int globalVersion) {
|
|
|
|
if (globalVersion > localVersion) {
|
|
|
|
localVersion = globalVersion;
|
2015-07-10 06:01:56 -07:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|