SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSDevice_BTsender.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // A BT sender
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
34 #include <microsim/MSNet.h>
35 #include <microsim/MSLane.h>
36 #include <microsim/MSEdge.h>
37 #include <microsim/MSVehicle.h>
38 #include "MSDevice_Tripinfo.h"
39 #include "MSDevice_BTsender.h"
40 
41 #ifdef CHECK_MEMORY_LEAKS
42 #include <foreign/nvwa/debug_new.h>
43 #endif // CHECK_MEMORY_LEAKS
44 
45 
46 // ===========================================================================
47 // method definitions
48 // ===========================================================================
49 // ---------------------------------------------------------------------------
50 // static initialisation methods
51 // ---------------------------------------------------------------------------
52 void
54  oc.addOptionSubTopic("Communication");
55  insertDefaultAssignmentOptions("btsender", "Communication", oc);
56 }
57 
58 
59 void
60 MSDevice_BTsender::buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into) {
62  if (equippedByDefaultAssignmentOptions(oc, "btsender", v)) {
63  MSDevice_BTsender* device = new MSDevice_BTsender(v, "btsender_" + v.getID());
64  into.push_back(device);
65  }
66 }
67 
68 
69 // ---------------------------------------------------------------------------
70 // MSDevice_BTsender-methods
71 // ---------------------------------------------------------------------------
72 MSDevice_BTsender::MSDevice_BTsender(SUMOVehicle& holder, const std::string& id)
73  : MSDevice(holder, id), myReportRoute(false) {
74 }
75 
76 
78 }
79 
80 
81 void
83  if (myReportRoute) {
85  os.openTag("found");
86  os.writeAttr("id", myHolder.getID());
87  os.writeAttr("route", myHolder.getRoute().getEdges());
88  os.closeTag();
89  }
90 }
91 
92 
93 
94 /****************************************************************************/
95