/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. * * Copyright 2021 Dominik Meyer * This file is part of the EventManager distribution hosted at https://gitea.federationhq.de/byterazor/EventManager.git */ /** @file */ #include #include EventManager::Event::Event(std::uint32_t type) : type_(type), responseId_(0), isResponse_(false), emitter_(nullptr) { std::random_device rd; std::mt19937 rng(rd()); std::uniform_int_distribution dist(1,std::numeric_limits::max()); id_ = dist(rng); } EventManager::Event::Event(std::uint32_t type, const EventManager::Event &event) : Event(type) { responseId_=event.id(); isResponse_=true; } EventManager::Event::Event(std::uint32_t type, const std::shared_ptr event) : Event(type) { responseId_=event->id(); isResponse_=true; }