MonitorConnectRecord: make members private

Change-Id: I485ed48bca0e5c2c0be15f44f553fc48651c59c9
This commit is contained in:
Miklos Vajna 2019-01-09 08:45:46 +01:00
parent 6435ef2895
commit 8244726d39
2 changed files with 13 additions and 5 deletions

View file

@ -451,10 +451,10 @@ void Admin::pollingThread()
if (_pendingConnects.size())
{
MonitorConnectRecord rec = _pendingConnects[0];
if (rec._when < now)
if (rec.getWhen() < now)
{
_pendingConnects.erase(_pendingConnects.begin());
connectToMonitorSync(rec._uri);
connectToMonitorSync(rec.getUri());
}
}
@ -688,8 +688,8 @@ void Admin::scheduleMonitorConnect(const std::string &uri, std::chrono::steady_c
assertCorrectThread();
MonitorConnectRecord todo;
todo._when = when;
todo._uri = uri;
todo.setWhen(when);
todo.setUri(uri);
_pendingConnects.push_back(todo);
}

View file

@ -155,7 +155,15 @@ private:
size_t _totalSysMemKb;
size_t _totalAvailMemKb;
struct MonitorConnectRecord {
struct MonitorConnectRecord
{
void setWhen(std::chrono::steady_clock::time_point when) { _when = when; }
std::chrono::steady_clock::time_point getWhen() const { return _when; }
void setUri(const std::string& uri) { _uri = uri; }
std::string getUri() const { return _uri; }
protected:
std::chrono::steady_clock::time_point _when;
std::string _uri;
};