mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
Merge pull request #435 from Ygrik2003/Refactoring-cmake
Refactoring cmake
This commit is contained in:
parent
a8eda192af
commit
6c3d2d0907
13 changed files with 210 additions and 185 deletions
|
|
@ -1,15 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "typedefs.hpp"
|
||||
#include "delegates.hpp"
|
||||
#include "typedefs.hpp"
|
||||
|
||||
namespace util {
|
||||
template<class...Types>
|
||||
template <class... Types>
|
||||
class HandlersList {
|
||||
int nextid = 1;
|
||||
std::unordered_map<int, std::function<bool(Types...)>> handlers;
|
||||
|
|
@ -35,7 +35,7 @@ namespace util {
|
|||
int id = nextid++;
|
||||
handlers[id] = std::move(handler);
|
||||
order.push_back(id);
|
||||
return observer_handler(new int(id), [this](int* id) { //-V508
|
||||
return observer_handler(new int(id), [this](int* id) { //-V508
|
||||
std::lock_guard lock(mutex);
|
||||
handlers.erase(*id);
|
||||
order.erase(
|
||||
|
|
@ -45,7 +45,7 @@ namespace util {
|
|||
});
|
||||
}
|
||||
|
||||
void notify(Types...args) {
|
||||
void notify(Types... args) {
|
||||
std::vector<int> orderCopy;
|
||||
decltype(handlers) handlersCopy;
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue