LCOV - code coverage report
Current view: top level - src/libtraci - ParkingArea.cpp (source / functions) Coverage Total Hit
Test: lcov.info Lines: 95.7 % 23 22
Test Date: 2024-11-21 15:56:26 Functions: 59.1 % 22 13

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2017-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    ParkingArea.cpp
      15              : /// @author  Angelo Banse
      16              : /// @author  Mirko Barthauer
      17              : /// @date    10.11.2020
      18              : ///
      19              : // C++ TraCI client API implementation
      20              : /****************************************************************************/
      21              : #include <config.h>
      22              : 
      23              : #define LIBTRACI 1
      24              : #include <libsumo/TraCIConstants.h>
      25              : #include <libsumo/ParkingArea.h>
      26              : #include "Connection.h"
      27              : #include "Domain.h"
      28              : 
      29              : 
      30              : namespace libtraci {
      31              : 
      32              : typedef Domain<libsumo::CMD_GET_PARKINGAREA_VARIABLE, libsumo::CMD_SET_PARKINGAREA_VARIABLE> Dom;
      33              : 
      34              : 
      35              : // ===========================================================================
      36              : // static member definitions
      37              : // ===========================================================================
      38              : std::vector<std::string>
      39           40 : ParkingArea::getIDList() {
      40           79 :     return Dom::getStringVector(libsumo::TRACI_ID_LIST, "");
      41              : }
      42              : 
      43              : int
      44            1 : ParkingArea::getIDCount() {
      45            2 :     return Dom::getInt(libsumo::ID_COUNT, "");
      46              : }
      47              : 
      48              : 
      49              : std::string
      50            2 : ParkingArea::getLaneID(const std::string& stopID) {
      51            2 :     return Dom::getString(libsumo::VAR_LANE_ID, stopID);
      52              : }
      53              : 
      54              : double
      55            2 : ParkingArea::getStartPos(const std::string& stopID) {
      56            2 :     return Dom::getDouble(libsumo::VAR_POSITION, stopID);
      57              : }
      58              : 
      59              : double
      60            2 : ParkingArea::getEndPos(const std::string& stopID) {
      61            2 :     return Dom::getDouble(libsumo::VAR_LANEPOSITION, stopID);
      62              : }
      63              : 
      64              : std::string
      65            2 : ParkingArea::getName(const std::string& stopID) {
      66            2 :     return Dom::getString(libsumo::VAR_NAME, stopID);
      67              : }
      68              : 
      69              : int
      70           20 : ParkingArea::getVehicleCount(const std::string& stopID) {
      71           20 :     return Dom::getInt(libsumo::VAR_STOP_STARTING_VEHICLES_NUMBER, stopID);
      72              : }
      73              : 
      74              : std::vector<std::string>
      75           20 : ParkingArea::getVehicleIDs(const std::string& stopID) {
      76           20 :     return Dom::getStringVector(libsumo::VAR_STOP_STARTING_VEHICLES_IDS, stopID);
      77              : }
      78              : 
      79              : std::vector<std::string>
      80            4 : ParkingArea::getAcceptedBadges(const std::string& stopID) {
      81            4 :     return Dom::getStringVector(libsumo::VAR_ACCESS_BADGE, stopID);
      82              : }
      83              : 
      84              : void
      85            2 : ParkingArea::setAcceptedBadges(const std::string& stopID, const std::vector<std::string>& badges) {
      86            2 :     Dom::setStringVector(libsumo::VAR_ACCESS_BADGE, stopID, badges);
      87            2 : }
      88              : 
      89          102 : LIBTRACI_SUBSCRIPTION_IMPLEMENTATION(ParkingArea, PARKINGAREA)
      90            0 : LIBTRACI_PARAMETER_IMPLEMENTATION(ParkingArea, PARKINGAREA)
      91              : 
      92              : 
      93              : }
      94              : 
      95              : 
      96              : /****************************************************************************/
        

Generated by: LCOV version 2.0-1