Line data Source code
1 : /****************************************************************************/ 2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo 3 : // Copyright (C) 2013-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 MSTransportableDevice_FCD.h 15 : /// @author Daniel Krajzewicz 16 : /// @author Jakob Erdmann 17 : /// @date 11.06.2013 18 : /// 19 : // A device which records floating car data 20 : /****************************************************************************/ 21 : #pragma once 22 : #include <config.h> 23 : 24 : #include "MSTransportableDevice.h" 25 : #include <utils/common/SUMOTime.h> 26 : 27 : 28 : // =========================================================================== 29 : // class declarations 30 : // =========================================================================== 31 : class MSTransportable; 32 : 33 : 34 : // =========================================================================== 35 : // class definitions 36 : // =========================================================================== 37 : /** 38 : * @class MSTransportableDevice_FCD 39 : * @brief A device which collects info on the vehicle trip (mainly on departure and arrival) 40 : * 41 : * Each device collects departure time, lane and speed and the same for arrival. 42 : * 43 : * @see MSTransportableDevice 44 : */ 45 : class MSTransportableDevice_FCD : public MSTransportableDevice { 46 : public: 47 : /** @brief Inserts MSTransportableDevice_FCD-options 48 : * @param[filled] oc The options container to add the options to 49 : */ 50 : static void insertOptions(OptionsCont& oc); 51 : 52 : 53 : /** @brief Build devices for the given vehicle, if needed 54 : * 55 : * The options are read and evaluated whether a FCD-device shall be built 56 : * for the given vehicle. 57 : * 58 : * The built device is stored in the given vector. 59 : * 60 : * @param[in] v The vehicle for which a device may be built 61 : * @param[filled] into The vector to store the built device in 62 : */ 63 : static void buildDevices(MSTransportable& t, std::vector<MSTransportableDevice*>& into); 64 : 65 : public: 66 : /// @brief Destructor. 67 : ~MSTransportableDevice_FCD(); 68 : 69 1512 : bool notifyEnter(SUMOTrafficObject& /*veh*/, MSMoveReminder::Notification /*reason*/, const MSLane* /*enteredLane*/) { 70 1512 : return false; 71 : } 72 : 73 0 : void saveState(OutputDevice& /* out */) const { 74 0 : } 75 : 76 : /// @brief return the name for this type of device 77 0 : const std::string deviceName() const { 78 0 : return "fcd"; 79 : } 80 : 81 : /// @brief resets the edge filter 82 : static void cleanup(); 83 : 84 : private: 85 : /** @brief Constructor 86 : * 87 : * @param[in] holder The vehicle that holds this device 88 : * @param[in] id The ID of the device 89 : */ 90 : MSTransportableDevice_FCD(MSTransportable& holder, const std::string& id); 91 : 92 : private: 93 : /// @brief Invalidated copy constructor. 94 : MSTransportableDevice_FCD(const MSTransportableDevice_FCD&); 95 : 96 : /// @brief Invalidated assignment operator. 97 : MSTransportableDevice_FCD& operator=(const MSTransportableDevice_FCD&); 98 : 99 : 100 : };