src/mobility/static-speed-mobility-model.h
changeset 968 70d02500c9d5
child 1460 0c9be520ba9f
equal deleted inserted replaced
967:19ad9623162c 968:70d02500c9d5
       
     1 /* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2006, 2007 INRIA
       
     4  * All rights reserved.
       
     5  *
       
     6  * This program is free software; you can redistribute it and/or modify
       
     7  * it under the terms of the GNU General Public License version 2 as
       
     8  * published by the Free Software Foundation;
       
     9  *
       
    10  * This program is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    13  * GNU General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License
       
    16  * along with this program; if not, write to the Free Software
       
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    18  *
       
    19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
       
    20  */
       
    21 #ifndef STATIC_SPEED_MOBILITY_MODEL_H
       
    22 #define STATIC_SPEED_MOBILITY_MODEL_H
       
    23 
       
    24 #include <stdint.h>
       
    25 #include "mobility-model.h"
       
    26 #include "ns3/nstime.h"
       
    27 #include "ns3/component-manager.h"
       
    28 #include "static-speed-helper.h"
       
    29 #include "speed.h"
       
    30 
       
    31 namespace ns3 {
       
    32 
       
    33 /**
       
    34  * \brief a position model for which the current speed does not
       
    35  *        change once it has been set and until it is set again 
       
    36  *        explicitely to a new value.
       
    37  */
       
    38 class StaticSpeedMobilityModel : public MobilityModel 
       
    39 {
       
    40 public:
       
    41   static const InterfaceId iid;
       
    42   static const ClassId cid;
       
    43   /**
       
    44    * Create position located at coordinates (0,0,0) with
       
    45    * speed (0,0,0).
       
    46    */
       
    47   StaticSpeedMobilityModel ();
       
    48   /**
       
    49    * Create a position located at coordinates (x,y,z) with
       
    50    * speed (0,0,0).
       
    51    */
       
    52   StaticSpeedMobilityModel (const Position &position);
       
    53   /**
       
    54    *
       
    55    * Create a position located at coordinates (x,y,z) with
       
    56    * speed (dx,dy,dz).
       
    57    * Unit is meters and meters/s
       
    58    */
       
    59   StaticSpeedMobilityModel (const Position &position,
       
    60                             const Speed &speed);
       
    61   virtual ~StaticSpeedMobilityModel ();
       
    62 
       
    63   /**
       
    64    * \param speed the new speed to set.
       
    65    *
       
    66    * Set the current speed now to (dx,dy,dz)
       
    67    * Unit is meters/s
       
    68    */
       
    69   void SetSpeed (const Speed speed);
       
    70 private:
       
    71   virtual Position DoGet (void) const;
       
    72   virtual void DoSet (const Position &position);
       
    73   virtual Speed DoGetSpeed (void) const;
       
    74   void Update (void) const;
       
    75   StaticSpeedHelper m_helper;
       
    76 };
       
    77 
       
    78 }; // namespace ns3
       
    79 
       
    80 #endif /* STATIC_SPEED_POSITION */