src/node/ns2-mobility-file-topology.h
changeset 1632 b1a532cc4e9f
parent 1586 a77fe06e9b6d
equal deleted inserted replaced
1631:1dcfeb3c0fea 1632:b1a532cc4e9f
    16  * along with this program; if not, write to the Free Software
    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
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    18  *
    18  *
    19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
    19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
    20  */
    20  */
    21 #ifndef NS2_MOBILE_FILE_TOPOLOGY_H
    21 #ifndef NS2_MOBILITY_FILE_TOPOLOGY_H
    22 #define NS2_MOBILE_FILE_TOPOLOGY_H
    22 #define NS2_MOBILITY_FILE_TOPOLOGY_H
    23 
    23 
    24 #include <string>
    24 #include <string>
    25 #include <stdint.h>
    25 #include <stdint.h>
    26 #include "ns3/ptr.h"
    26 #include "ns3/ptr.h"
    27 #include "ns3/object.h"
    27 #include "ns3/object.h"
    28 #include "static-speed-mobility-model.h"
    28 #include "static-speed-mobility-model.h"
    29 
    29 
    30 namespace ns3 {
    30 namespace ns3 {
    31 
    31 
    32 class Ns2MobileFileTopology
    32 /**
       
    33  * \brief a topology object which can read ns2's movement files
       
    34  *        generated by the CMU setdest tool.
       
    35  */
       
    36 class Ns2MobilityFileTopology
    33 {
    37 {
    34 public:
    38 public:
    35   Ns2MobileFileTopology (std::string filename);
    39   /**
       
    40    * \param filename filename of file which contains the
       
    41    *        ns2 movement trace.
       
    42    */
       
    43   Ns2MobilityFileTopology (std::string filename);
    36 
    44 
       
    45   /**
       
    46    * Read the ns2 trace file and configure the movement
       
    47    * patterns of all nodes contained in the global ns3::NodeList
       
    48    * whose nodeId is matches the nodeId of the nodes in the trace
       
    49    * file.
       
    50    */
    37   void Layout (void) const;
    51   void Layout (void) const;
       
    52 
       
    53   /**
       
    54    * \param begin an iterator which points to the start of the input
       
    55    *        object array.
       
    56    * \param end an iterator which points to the end of the input
       
    57    *        object array.
       
    58    *
       
    59    * Read the ns2 trace file and configure the movement
       
    60    * patterns of all input objects. Each input object
       
    61    * is identified by a unique node id which reflects
       
    62    * the index of the object in the input array.
       
    63    */
    38   template <typename T>
    64   template <typename T>
    39   void Layout (T begin, T end) const;
    65   void Layout (T begin, T end) const;
    40 private:
    66 private:
    41   class ObjectStore
    67   class ObjectStore
    42   {
    68   {
    54 
    80 
    55 namespace ns3 {
    81 namespace ns3 {
    56 
    82 
    57 template <typename T>
    83 template <typename T>
    58 void 
    84 void 
    59 Ns2MobileFileTopology::Layout (T begin, T end) const
    85 Ns2MobilityFileTopology::Layout (T begin, T end) const
    60 {
    86 {
    61   class MyObjectStore : public ObjectStore
    87   class MyObjectStore : public ObjectStore
    62   {
    88   {
    63   public:
    89   public:
    64     MyObjectStore (T begin, T end)
    90     MyObjectStore (T begin, T end)
    82 }
   108 }
    83 
   109 
    84 
   110 
    85 } // namespace ns3
   111 } // namespace ns3
    86 
   112 
    87 #endif /* NS2_MOBILE_FILE_TOPOLOGY_H */
   113 #endif /* NS2_MOBILITY_FILE_TOPOLOGY_H */