MSDevice Class Reference

#include <MSDevice.h>

Inheritance diagram for MSDevice:

MSDevice_HBEFA MSDevice_Routing

Detailed Description

Abstract in-vehicle device.

The MSDevice-interface brings the following interfaces to a vehicle that may be overwritten by real devices:

The "methods called on vehicle movement / state change" are called for each device within the corresponding vehicle methods. MSDevice brings already an empty (nothing doing) implementation of these.

Definition at line 61 of file MSDevice.h.


Public Member Functions

MSVehiclegetHolder () const throw ()
 Returns the vehicle that holds this device.
const std::string & getID () throw ()
 Returns the id of this device.
 MSDevice (MSVehicle &holder, const std::string &id) throw ()
 Constructor.
virtual void tripInfoOutput (OutputDevice &os) const throw (IOError)
 Called on writing tripinfo output.
virtual ~MSDevice () throw ()
 Destructor.
Methods called on vehicle movement / state change
virtual void enterLaneAtEmit (MSLane *enteredLane, const MSVehicle::State &state)
 Update of members if vehicle enters a new lane in the emit step.
virtual void enterLaneAtLaneChange (MSLane *enteredLane)
 Update of members if vehicle enters a new lane in the laneChange step.
virtual void enterLaneAtMove (MSLane *enteredLane, SUMOReal driven)
 Update if vehicle enters a new lane in the move step.
virtual void leaveLane ()
 Update of members if vehicle leaves a new lane in the lane change step.
virtual void leaveLaneAtMove (SUMOReal driven)
 Update of members if vehicle leaves a new lane in the move step.
virtual void onRemovalFromNet ()
 Called when the vehicle leaves the lane.
virtual void onTryEmit ()
 Called when the vehicle tries to get into the net.

Protected Attributes

MSVehiclemyHolder
 The vehicle that stores the device.

Private Member Functions

 MSDevice (const MSDevice &)
 Invalidated copy constructor.
MSDeviceoperator= (const MSDevice &)
 Invalidated assignment operator.

Private Attributes

std::string myID
 The built device id.

Constructor & Destructor Documentation

MSDevice::MSDevice ( MSVehicle holder,
const std::string &  id 
) throw () [inline]

Constructor.

Parameters:
[in] holder The vehicle that holds this device
[in] id The ID of the device

Definition at line 68 of file MSDevice.h.

00069             : myHolder(holder), myID(id) {
00070     }

virtual MSDevice::~MSDevice (  )  throw () [inline, virtual]

Destructor.

Definition at line 74 of file MSDevice.h.

00074 { }

MSDevice::MSDevice ( const MSDevice  )  [private]

Invalidated copy constructor.


Member Function Documentation

virtual void MSDevice::enterLaneAtEmit ( MSLane enteredLane,
const MSVehicle::State state 
) [inline, virtual]

Update of members if vehicle enters a new lane in the emit step.

Parameters:
[in] enteredLane The lane the vehicle enters
[in] state The vehicle's state during the emission

Reimplemented in MSDevice_HBEFA, and MSDevice_Routing.

Definition at line 114 of file MSDevice.h.

00114 { }

virtual void MSDevice::enterLaneAtLaneChange ( MSLane enteredLane  )  [inline, virtual]

Update of members if vehicle enters a new lane in the laneChange step.

Parameters:
[in] enteredLane The lane the vehicle enters

Definition at line 121 of file MSDevice.h.

00121 { }

virtual void MSDevice::enterLaneAtMove ( MSLane enteredLane,
SUMOReal  driven 
) [inline, virtual]

Update if vehicle enters a new lane in the move step.

Parameters:
[in] enteredLane The lane the vehicle enters
[in] driven The distance driven by the vehicle within this time step

Definition at line 106 of file MSDevice.h.

00106 { }

MSVehicle& MSDevice::getHolder (  )  const throw () [inline]

Returns the vehicle that holds this device.

Returns:
The vehicle that holds this device

Definition at line 81 of file MSDevice.h.

References myHolder.

Referenced by MSDevice_HBEFA::wrappedComputeCommandExecute().

00081                                          {
00082         return myHolder;
00083     }

const std::string& MSDevice::getID (  )  throw () [inline]

Returns the id of this device.

Returns:
The device's ID

Definition at line 89 of file MSDevice.h.

References myID.

00089                                      {
00090         return myID;
00091     }

virtual void MSDevice::leaveLane (  )  [inline, virtual]

Update of members if vehicle leaves a new lane in the lane change step.

Definition at line 132 of file MSDevice.h.

00132 { }

virtual void MSDevice::leaveLaneAtMove ( SUMOReal  driven  )  [inline, virtual]

Update of members if vehicle leaves a new lane in the move step.

Parameters:
[in] driven The distance driven by the vehicle within this time step

Definition at line 128 of file MSDevice.h.

00128 { }

virtual void MSDevice::onRemovalFromNet (  )  [inline, virtual]

Called when the vehicle leaves the lane.

Definition at line 136 of file MSDevice.h.

00136 { }

virtual void MSDevice::onTryEmit (  )  [inline, virtual]

Called when the vehicle tries to get into the net.

Reimplemented in MSDevice_Routing.

Definition at line 98 of file MSDevice.h.

00098 { }

MSDevice& MSDevice::operator= ( const MSDevice  )  [private]

Invalidated assignment operator.

virtual void MSDevice::tripInfoOutput ( OutputDevice os  )  const throw (IOError) [inline, virtual]

Called on writing tripinfo output.

The device may write some statistics into the tripinfo output. It is assumed that the written information is a valid xml-snipplet, which will be embedded within the vehicle's information.

The device should use the openTag / closeTag methods of the OutputDevice for correct indentation.

Parameters:
[in] os The stream to write the information into
Exceptions:
IOError not yet implemented

Reimplemented in MSDevice_HBEFA.

Definition at line 152 of file MSDevice.h.

00152                                                                        {
00153     }


Field Documentation

The vehicle that stores the device.

Definition at line 158 of file MSDevice.h.

Referenced by MSDevice_Routing::enterLaneAtEmit(), getHolder(), MSDevice_Routing::onTryEmit(), and MSDevice_Routing::wrappedRerouteCommandExecute().

std::string MSDevice::myID [private]

The built device id.

Definition at line 163 of file MSDevice.h.

Referenced by getID().


The documentation for this class was generated from the following file:

Generated on Wed May 5 00:06:47 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6