1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
|
2 /* |
|
3 * Copyright (c) 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 RANDOM_RECTANGLE_TOPOLOGY_H |
|
22 #define RANDOM_RECTANGLE_TOPOLOGY_H |
|
23 |
|
24 #include "ns3/ptr.h" |
|
25 #include "ns3/object.h" |
|
26 #include "ns3/component-manager.h" |
|
27 |
|
28 namespace ns3 { |
|
29 |
|
30 class Random2dPosition; |
|
31 |
|
32 class RandomRectangleTopology |
|
33 { |
|
34 public: |
|
35 RandomRectangleTopology (); |
|
36 RandomRectangleTopology (Ptr<Random2dPosition> positionModel, |
|
37 ClassId mobilityModel); |
|
38 |
|
39 ~RandomRectangleTopology (); |
|
40 |
|
41 void SetMobilityModel (ClassId classId); |
|
42 void SetPositionModel (Ptr<Random2dPosition> positionModel); |
|
43 |
|
44 void LayoutOne (Ptr<Object> object); |
|
45 |
|
46 template <typename T> |
|
47 void Layout (const T &begin, const T &end); |
|
48 private: |
|
49 Ptr<Random2dPosition> m_positionModel; |
|
50 ClassId m_mobilityModel; |
|
51 }; |
|
52 |
|
53 } // namespace ns3 |
|
54 |
|
55 namespace ns3 { |
|
56 |
|
57 template <typename T> |
|
58 void |
|
59 RandomRectangleTopology::Layout (const T &begin, const T &end) |
|
60 { |
|
61 for (T i = begin; i != end; i++) |
|
62 { |
|
63 LayoutOne (*i); |
|
64 } |
|
65 } |
|
66 |
|
67 |
|
68 } // namespace ns3 |
|
69 |
|
70 #endif /* RANDOM_RECTANGLE_TOPOLOGY_H */ |
|