Path: blob/main/src/utils/foxtools/MFXSingleEventThread.h
169678 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2004-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file MFXSingleEventThread.h14/// @author unknown_author15/// @author Daniel Krajzewicz16/// @author Michael Behrisch17/// @date 2004-03-1918///19//20/****************************************************************************/2122#pragma once23#include <config.h>2425#include "fxheader.h"26#include <FXThread.h>27#include "fxexdefs.h"2829class MFXInterThreadEventClient;3031class MFXSingleEventThread : public FXObject, public FXThread {32/// @brief FOX declaration33FXDECLARE(MFXSingleEventThread)3435public:36enum {37ID_THREAD_EVENT38};3940/// @brief constructor41MFXSingleEventThread(FXApp* a, MFXInterThreadEventClient* client);4243virtual ~MFXSingleEventThread();4445void signal();4647void signal(FXuint seltype);4849virtual FXint run() {50return 0;51}5253static void sleep(long ms);5455long onThreadSignal(FXObject*, FXSelector, void*);5657long onThreadEvent(FXObject*, FXSelector, void*);5859protected:60/// @brief FOX need this61MFXSingleEventThread() { }6263/// @brief pointer to APP64FXApp* myApp = nullptr;6566/// @brief thread client67MFXInterThreadEventClient* myClient = nullptr;6869private:70/// @brief event71FXEX::MFXThreadEventHandle event;7273/// @brief invalidate copy constructor74MFXSingleEventThread(const MFXSingleEventThread&) = delete;7576/// @brief invalidate assignment constructor77MFXSingleEventThread& operator=(const MFXSingleEventThread&) = delete;78};798081