|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
23 #include "ns3/building.h"
24 #include "ns3/double.h"
25 #include "ns3/uinteger.h"
51 static TypeId tid =
TypeId (
"ns3::GridBuildingAllocator")
53 .AddConstructor<GridBuildingAllocator> ()
54 .SetGroupName (
"Buildings")
55 .AddAttribute (
"GridWidth",
"The number of objects laid out on a line.",
58 MakeUintegerChecker<uint32_t> ())
59 .AddAttribute (
"MinX",
"The x coordinate where the grid starts.",
62 MakeDoubleChecker<double> ())
63 .AddAttribute (
"MinY",
"The y coordinate where the grid starts.",
66 MakeDoubleChecker<double> ())
67 .AddAttribute (
"LengthX",
" the length of the wall of each building along the X axis.",
70 MakeDoubleChecker<double> ())
71 .AddAttribute (
"LengthY",
" the length of the wall of each building along the X axis.",
74 MakeDoubleChecker<double> ())
75 .AddAttribute (
"DeltaX",
"The x space between buildings.",
78 MakeDoubleChecker<double> ())
79 .AddAttribute (
"DeltaY",
"The y space between buildings.",
82 MakeDoubleChecker<double> ())
83 .AddAttribute (
"Height",
"The height of the building (roof level)",
86 MakeDoubleChecker<double> ())
87 .AddAttribute (
"LayoutType",
"The type of layout.",
114 Box box (lowerLeft.x, upperRight.x, lowerLeft.y, upperRight.y, 0,
m_height);
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
keep track of a set of building pointers.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
enum GridPositionAllocator::LayoutType m_layoutType
ObjectFactory m_buildingFactory
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Ptr< GridPositionAllocator > m_lowerLeftPositionAllocator
Ptr< GridPositionAllocator > m_upperRightPositionAllocator
Hold a value for an Attribute.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
void PushAttributes() const
static TypeId GetTypeId(void)
@ COLUMN_FIRST
In column-first mode, positions are allocated on the first column until N positions have been allocat...
virtual ~GridBuildingAllocator()
Smart pointer class similar to boost::intrusive_ptr.
A base class which provides memory management and object aggregation.
@ ROW_FIRST
In row-first mode, positions are allocated on the first row until N positions have been allocated.
BuildingContainer Create(uint32_t n) const
Create a set of buildings allocated on a grid.
void Add(BuildingContainer other)
Append the contents of another BuildingContainer to the end of this container.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetBuildingAttribute(std::string n, const AttributeValue &v)
Set an attribute to be used for each new building to be created.
AttributeValue implementation for Box.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Hold an unsigned integer type.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.