LCOV - code coverage report
Current view: top level - src/utils/gui/events - GUIEvent.h (source / functions) Coverage Total Hit
Test: lcov.info Lines: 75.0 % 4 3
Test Date: 2024-11-22 15:46:21 Functions: 0.0 % 2 0

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
       4              : // This program and the accompanying materials are made available under the
       5              : // terms of the Eclipse Public License 2.0 which is available at
       6              : // https://www.eclipse.org/legal/epl-2.0/
       7              : // This Source Code may also be made available under the following Secondary
       8              : // Licenses when the conditions for such availability set forth in the Eclipse
       9              : // Public License 2.0 are satisfied: GNU General Public License, version 2
      10              : // or later which is available at
      11              : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
      12              : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
      13              : /****************************************************************************/
      14              : /// @file    GUIEvent.h
      15              : /// @author  Daniel Krajzewicz
      16              : /// @date    Sept 2002
      17              : ///
      18              : // Definition of an own event class
      19              : /****************************************************************************/
      20              : #pragma once
      21              : #include <config.h>
      22              : 
      23              : #include <utils/foxtools/MFXThreadEvent.h>
      24              : #include <utils/foxtools/MFXBaseObject.h>
      25              : #include <utils/foxtools/fxheader.h>
      26              : 
      27              : 
      28              : /**
      29              :  * As events are distinguished by their number, here is the enumeration
      30              :  * of our custom events
      31              :  */
      32              : enum class GUIEventType {
      33              :     /// @brief send when a simulation has been loaded
      34              :     SIMULATION_LOADED,
      35              : 
      36              :     /// @brief send when a simulation step has been performed
      37              :     SIMULATION_STEP,
      38              : 
      39              :     /// @brief send when a message occured
      40              :     MESSAGE_OCCURRED,
      41              : 
      42              :     /// @brief send when a warning occured
      43              :     WARNING_OCCURRED,
      44              : 
      45              :     /// @brief send when a error occured
      46              :     ERROR_OCCURRED,
      47              : 
      48              :     /// @brief send when a debug occured
      49              :     DEBUG_OCCURRED,
      50              : 
      51              :     /// @brief send when a gldebug occured
      52              :     GLDEBUG_OCCURRED,
      53              : 
      54              :     /// @brief send when a status change occured
      55              :     STATUS_OCCURRED,
      56              : 
      57              :     /**@brief Send when a new should be opened (via TraCI) */
      58              :     ADD_VIEW,
      59              : 
      60              :     /**@brief Send when a view should be closed (via TraCI) */
      61              :     CLOSE_VIEW,
      62              : 
      63              :     /**@brief Send when the simulation is over;
      64              :      * @note The reason and the time step are stored within the event
      65              :     */
      66              :     SIMULATION_ENDED,
      67              : 
      68              :     /// @brief send when a tool produces output
      69              :     OUTPUT_OCCURRED,
      70              : 
      71              :     /// @brief send when a tool finishes
      72              :     TOOL_ENDED,
      73              : 
      74              :     /// @brief End of events list; use this to define new
      75              :     END
      76              : };
      77              : 
      78              : 
      79              : // ===========================================================================
      80              : // class definitions
      81              : // ===========================================================================
      82              : /**
      83              :  * GUIEvent
      84              :  *
      85              :  */
      86              : class GUIEvent {
      87              : public:
      88              :     /// @brief returns the event type
      89              :     GUIEventType getOwnType() const {
      90      5982741 :         return myType;
      91              :     }
      92              : 
      93              :     /// @brief destructor
      94            0 :     virtual ~GUIEvent() { }
      95              : 
      96              : protected:
      97              :     /// @brief constructor
      98      5919992 :     GUIEvent(GUIEventType ownType) :
      99      5919992 :         myType(ownType) { }
     100              : 
     101              :     /// @brief the type of the event
     102              :     GUIEventType myType;
     103              : };
        

Generated by: LCOV version 2.0-1