Dispatcher: Move several fixed initial values to header.

This commit is contained in:
Peter Johnson
2015-08-19 21:16:44 -07:00
parent c41341c7e3
commit c6bed1f464
2 changed files with 5 additions and 10 deletions

View File

@@ -31,12 +31,7 @@ void Dispatcher::StartClient(const char* server_name, unsigned int port) {
}
DispatcherBase::DispatcherBase(Storage& storage, Notifier& notifier)
: m_storage(storage),
m_notifier(notifier),
m_server(false),
m_do_flush(false),
m_reconnect_proto_rev(0x0300),
m_do_reconnect(true) {
: m_storage(storage), m_notifier(notifier) {
m_active = false;
m_update_rate = 100;
}

View File

@@ -73,7 +73,7 @@ class DispatcherBase {
Storage& m_storage;
Notifier& m_notifier;
bool m_server;
bool m_server = false;
std::string m_persist_filename;
std::thread m_dispatch_thread;
std::thread m_clientserver_thread;
@@ -93,12 +93,12 @@ class DispatcherBase {
std::mutex m_flush_mutex;
std::condition_variable m_flush_cv;
std::chrono::steady_clock::time_point m_last_flush;
bool m_do_flush;
bool m_do_flush = false;
// Condition variable for client reconnect (uses user mutex)
std::condition_variable m_reconnect_cv;
unsigned int m_reconnect_proto_rev;
bool m_do_reconnect;
unsigned int m_reconnect_proto_rev = 0x0300;
bool m_do_reconnect = true;
};
class Dispatcher : public DispatcherBase {