Commit 1c7b8ddd authored by Locatelli's avatar Locatelli

Add plotyVersion in server property

parent ebd95529
......@@ -19,6 +19,7 @@
#include "ServerProperties.h"
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/lexical_cast.hpp>
#include <common/output/OutputStream.h>
#include <common/base/FileUtilities.h>
#include <common/base/Convert.h>
......@@ -195,6 +196,10 @@ std::string const & ServerProperties::getNomadDataPath() const {
return _nomadDataPath;
}
uint32 const & ServerProperties::getPlotyVersion() const {
return _plotyVersion;
}
void ServerProperties::init(std::string const & configPath) {
// Test for endianness.
......@@ -321,6 +326,19 @@ void ServerProperties::init(std::string const & configPath) {
cout << "set the default value " <<_nomadDataPath << " to the property '" << propertyName << "'" << endl;
}
// Mock mode.
propertyName = "plotyVersion";
if (_propertyMap.find(propertyName)) {
try {
_plotyVersion = boost::lexical_cast<uint32>(_propertyMap.get(propertyName));
}
catch(...) {
_plotyVersion = 1;
}
} else {
_plotyVersion = 1;
}
// Set the config path.
setConfigPath(configPath);
}
......
......@@ -111,6 +111,11 @@ public:
*/
std::string const & getNomadDataPath() const;
/**
* Gets the mock mode.
*/
uint32 const & getPlotyVersion() const;
/**
* Gets the number of properties.
*/
......@@ -215,6 +220,7 @@ private:
std::string _nomadNotifications;
std::string _nomadDataPath;
std::string _propertyPath;
uint32 _plotyVersion;
HashMap<std::string, std::string> _propertyMap;
HashMap<std::string, std::string> _dynamicPropertyMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment