27 #include <ns3/uinteger.h> 29 #include <ns3/assert.h> 43 .AddConstructor<Building> ()
44 .SetGroupName (
"Buildings")
45 .AddAttribute (
"NRoomsX",
"The number of rooms in the X axis.",
48 MakeUintegerChecker<uint32_t> ())
49 .AddAttribute (
"NRoomsY",
"The number of rooms in the Y axis.",
52 MakeUintegerChecker<uint32_t> ())
53 .AddAttribute (
"NFloors",
"The number of floors of this building.",
56 MakeUintegerChecker<uint32_t> ())
57 .AddAttribute (
"Id",
"The id (unique integer) of this Building.",
60 MakeUintegerChecker<uint32_t> ())
61 .AddAttribute (
"Boundaries",
"The boundaries of this Building as a value of type ns3::Box",
65 .AddAttribute (
"Type",
66 "The type of building",
72 .AddAttribute (
"ExternalWallsType",
73 "The type of material of which the external walls are made",
91 NS_FATAL_ERROR (std::endl <<
"this function is not supported any more:" << std::endl
92 <<
" Building::Building (double xMin, double xMax, double yMin, " << std::endl
93 <<
" double yMax, double zMin, double zMax)\n" << std::endl
94 <<
"so you can't do any more stuff like:" << std::endl
95 <<
"Ptr<Building> b = CreateObject<Building> (" 101 << zMax <<
")\n" << std::endl
102 <<
"Please use instead something like this:" << std::endl
103 <<
" Ptr<Building> b = CreateObject<Building> ();" << std::endl
104 <<
" b->SetBoundaries (Box (" 110 << zMax <<
"));" << std::endl <<std::endl);
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
double zMin
The z coordinate of the down bound of the box.
void SetNRoomsY(uint16_t nroomy)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint16_t GetFloor(Vector position) const
BuildingType_t GetBuildingType() const
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint16_t GetRoomY(Vector position) const
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
double xMax
The x coordinate of the right bound of the box.
uint16_t m_floors
number of floors, must be greater than 0, and 1 means only one floor (i.e., groundfloor) ...
virtual void DoDispose()
Destructor implementation.
double yMax
The y coordinate of the top bound of the box.
Hold variables of type enum.
BuildingType_t m_buildingType
Hold an unsigned integer type.
void SetNFloors(uint16_t nfloors)
Ptr< const AttributeChecker > MakeBoxChecker(void)
AttributeValue implementation for Box.
double yMin
The y coordinate of the bottom bound of the box.
void SetExtWallsType(Building::ExtWallsType_t t)
static TypeId GetTypeId(void)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeBoxAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Box GetBoundaries() const
double zMax
The z coordinate of the up bound of the box.
ExtWallsType_t m_externalWalls
uint16_t GetNRoomsY() const
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
static uint32_t Add(Ptr< Building > building)
uint16_t GetRoomX(Vector position) const
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
Make an EnumChecker pre-configured with a set of allowed values by name.
uint16_t GetNFloors() const
Building()
Create a zero-sized building located at coordinates (0.0,0.0,0.0) and with 1 floors and 1 room...
ExtWallsType_t GetExtWallsType() const
void SetNRoomsX(uint16_t nroomx)
virtual ~Building()
Destructor.
A base class which provides memory management and object aggregation.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
bool IsInside(const Vector &position) const
void SetBoundaries(Box box)
Set the boundaries of the building.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint32_t GetId(void) const
uint16_t GetNRoomsX() const
double xMin
The x coordinate of the left bound of the box.
bool IsInside(Vector position) const
void SetBuildingType(Building::BuildingType_t t)