1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2007-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    MSTransportableDevice.h
11 /// @author  Michael Behrisch
12 /// @author  Daniel Krajzewicz
13 /// @author  Jakob Erdmann
14 /// @date    Tue, 04 Dec 2007
15 /// @version $Id$
16 ///
17 // Abstract in-person device
18 /****************************************************************************/
19 #ifndef MSTransportableDevice_h
20 #define MSTransportableDevice_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
29 #include <vector>
30 #include <map>
31 #include <set>
32 #include <random>
33 #include "MSDevice.h"
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class MSTransportable;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
45 /**
46  * @class MSTransportableDevice
47  * @brief Abstract in-person device
48  *
49  * The MSTransportableDevice-interface brings the following interfaces to a vehicle that
50  *  may be overwritten by real devices:
51  * @arg Retrieval of the person that holds the device
52  */
53 class MSTransportableDevice : public MSDevice {
54 public:
55     /** @brief Constructor
56      *
57      * @param[in] holder The person that holds this device
58      * @param[in] id The ID of the device
59      */
MSTransportableDevice(MSTransportable & holder,const std::string & id)60     MSTransportableDevice(MSTransportable& holder, const std::string& id) :
61         MSDevice(id), myHolder(holder) {
62     }
63 
64 
65     /// @brief Destructor
~MSTransportableDevice()66     virtual ~MSTransportableDevice() { }
67 
68 
69     /** @brief Returns the person that holds this device
70      *
71      * @return The person that holds this device
72      */
getHolder()73     MSTransportable& getHolder() const {
74         return myHolder;
75     }
76 
77 protected:
78     /// @brief The person that stores the device
79     MSTransportable& myHolder;
80 
81 private:
82     /// @brief Invalidated copy constructor.
83     MSTransportableDevice(const MSTransportableDevice&);
84 
85     /// @brief Invalidated assignment operator.
86     MSTransportableDevice& operator=(const MSTransportableDevice&);
87 
88 };
89 
90 
91 #endif
92 
93 /****************************************************************************/
94