A Discrete-Event Network Simulator
API
mobility-building-info.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Marco Miozzo <marco.miozzo@cttc.es>
18  *
19  */
20 #ifndef MOBILITY_BUILDING_INFO_H
21 #define MOBILITY_BUILDING_INFO_H
22 
23 #include <ns3/box.h>
24 #include <ns3/building.h>
25 #include <ns3/constant-velocity-helper.h>
26 #include <ns3/mobility-model.h>
27 #include <ns3/object.h>
28 #include <ns3/ptr.h>
29 #include <ns3/simple-ref-count.h>
30 
31 #include <map>
32 
33 namespace ns3
34 {
35 
45 {
46  public:
52  static TypeId GetTypeId();
54 
61 
67  bool IsIndoor();
68 
80  void SetIndoor(Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
81 
93  void SetIndoor(uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
94 
98  void SetOutdoor();
99 
105  uint8_t GetFloorNumber();
106 
112  uint8_t GetRoomNumberX();
113 
119  uint8_t GetRoomNumberY();
120 
135 
136  protected:
137  // inherited from Object
138  void DoInitialize() override;
139 
140  private:
142  bool m_indoor;
143  uint8_t m_nFloor;
144  uint8_t m_roomX;
146  uint8_t m_roomY;
148  Vector
150 };
151 
152 } // namespace ns3
153 
154 #endif // MOBILITY_BUILDING_INFO_H
mobility buildings information (to be used by mobility models)
uint8_t GetFloorNumber()
Get the floor number at which the MobilityBuildingInfo instance is located.
bool IsIndoor()
Is indoor method.
Ptr< Building > GetBuilding()
Get the building in which the MobilityBuildingInfo instance is located.
uint8_t m_roomX
The room number along x-axis at which the MobilityBuildingInfo instance is located.
Ptr< Building > m_myBuilding
Building.
uint8_t m_roomY
The room number along y-axis at which the MobilityBuildingInfo instance is located.
static TypeId GetTypeId()
Get the type ID.
bool m_indoor
Node position (indoor/outdoor) ?
void DoInitialize() override
Initialize() implementation.
uint8_t GetRoomNumberX()
Get the room number along x-axis at which the MobilityBuildingInfo instance is located.
uint8_t GetRoomNumberY()
Get the room number along y-axis at which the MobilityBuildingInfo instance is located.
void SetIndoor(Ptr< Building > building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
Mark this MobilityBuildingInfo instance as indoor.
uint8_t m_nFloor
The floor number at which the MobilityBuildingInfo instance is located.
void SetOutdoor()
Mark this MobilityBuildingInfo instance as outdoor.
void MakeConsistent(Ptr< MobilityModel > mm)
Make the given mobility model consistent, by determining whether its position falls inside any of the...
Vector m_cachedPosition
The node position cached after making its mobility model consistent.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.