From 8f0130c8f74482a7d54f9bfb8763f4c6d705765c Mon Sep 17 00:00:00 2001 From: alpine Date: Wed, 24 Jun 2020 13:05:48 +0200 Subject: Added client version control. Reverted back to google formatting. --- client/src/util/events.h | 31 ++++++++++++++----------------- client/src/util/io.cpp | 10 +++++----- client/src/util/io.h | 6 +++--- 3 files changed, 22 insertions(+), 25 deletions(-) (limited to 'client/src/util') diff --git a/client/src/util/events.h b/client/src/util/events.h index 04ad251..b8d7781 100644 --- a/client/src/util/events.h +++ b/client/src/util/events.h @@ -1,27 +1,24 @@ #pragma once -template +template class event { - using func_type = std::function; + using func_type = std::function; - std::mutex event_lock; - std::list m_funcs; + std::mutex event_lock; + std::list m_funcs; -public: - void add(const func_type& func) - { - std::lock_guard lock(event_lock); + public: + void add(const func_type& func) { + std::lock_guard lock(event_lock); - m_funcs.push_back(std::move(func)); - } + m_funcs.push_back(std::move(func)); + } - void call(Args... params) - { - std::lock_guard lock(event_lock); + void call(Args... params) { + std::lock_guard lock(event_lock); - for(auto& func : m_funcs) { - if(func) - func(std::forward(params)...); - } + for (auto& func : m_funcs) { + if (func) func(std::forward(params)...); } + } }; \ No newline at end of file diff --git a/client/src/util/io.cpp b/client/src/util/io.cpp index 94f5575..06d2b9a 100644 --- a/client/src/util/io.cpp +++ b/client/src/util/io.cpp @@ -3,10 +3,10 @@ std::shared_ptr io::logger; -void io::init() -{ - spdlog::sink_ptr sink = std::make_shared(); - sink->set_pattern("%^~>%$ %v"); +void io::init() { + spdlog::sink_ptr sink = + std::make_shared(); + sink->set_pattern("%^~>%$ %v"); - logger = std::make_shared("client", sink); + logger = std::make_shared("client", sink); } diff --git a/client/src/util/io.h b/client/src/util/io.h index d5ab3be..8eae321 100644 --- a/client/src/util/io.h +++ b/client/src/util/io.h @@ -1,7 +1,7 @@ #pragma once namespace io { - extern std::shared_ptr logger; +extern std::shared_ptr logger; - void init(); -}; // namespace io +void init(); +}; // namespace io -- cgit v1.2.3