Allocate positions on a rectangular 2d grid. More...
#include <position-allocator.h>
Public Types | |
enum | LayoutType { ROW_FIRST, COLUMN_FIRST } |
Public Member Functions | |
GridPositionAllocator () | |
void | SetMinX (double xMin) |
void | SetMinY (double yMin) |
void | SetDeltaX (double deltaX) |
void | SetDeltaY (double deltaY) |
void | SetN (uint32_t n) |
void | SetLayoutType (enum LayoutType layoutType) |
double | GetMinX (void) const |
double | GetMinY (void) const |
double | GetDeltaX (void) const |
double | GetDeltaY (void) const |
uint32_t | GetN (void) const |
enum LayoutType | GetLayoutType (void) const |
virtual Vector | GetNext (void) const |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::GridPositionAllocator. | |
Private Attributes | |
uint32_t | m_current |
enum LayoutType | m_layoutType |
double | m_xMin |
double | m_yMin |
uint32_t | m_n |
double | m_deltaX |
double | m_deltaY |
Allocate positions on a rectangular 2d grid.
Definition at line 75 of file position-allocator.h.
Determine whether positions are allocated row first or column first.
Definition at line 83 of file position-allocator.h.
ns3::GridPositionAllocator::GridPositionAllocator | ( | ) |
Definition at line 117 of file position-allocator.cc.
double ns3::GridPositionAllocator::GetDeltaX | ( | void | ) | const |
Definition at line 163 of file position-allocator.cc.
References m_deltaX.
double ns3::GridPositionAllocator::GetDeltaY | ( | void | ) | const |
Definition at line 168 of file position-allocator.cc.
References m_deltaY.
enum GridPositionAllocator::LayoutType ns3::GridPositionAllocator::GetLayoutType | ( | void | ) | const |
Definition at line 178 of file position-allocator.cc.
References m_layoutType.
double ns3::GridPositionAllocator::GetMinX | ( | void | ) | const |
Definition at line 153 of file position-allocator.cc.
References m_xMin.
double ns3::GridPositionAllocator::GetMinY | ( | void | ) | const |
Definition at line 158 of file position-allocator.cc.
References m_yMin.
uint32_t ns3::GridPositionAllocator::GetN | ( | void | ) | const |
Definition at line 173 of file position-allocator.cc.
References m_n.
Vector ns3::GridPositionAllocator::GetNext | ( | void | ) | const [virtual] |
This method _must_ be implement in subclasses.
Implements ns3::PositionAllocator.
Definition at line 184 of file position-allocator.cc.
References COLUMN_FIRST, m_current, m_deltaX, m_deltaY, m_layoutType, m_n, m_xMin, m_yMin, and ROW_FIRST.
TypeId ns3::GridPositionAllocator::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::GridPositionAllocator.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::PositionAllocator.
Definition at line 83 of file position-allocator.cc.
References ns3::TypeId::AddAttribute(), ns3::TypeId::AddConstructor(), COLUMN_FIRST, m_deltaX, m_deltaY, m_layoutType, m_n, m_xMin, m_yMin, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ROW_FIRST, and ns3::TypeId::SetParent().
void ns3::GridPositionAllocator::SetDeltaX | ( | double | deltaX | ) |
deltaX | the x interval between two x-consecutive positions. |
Definition at line 132 of file position-allocator.cc.
References m_deltaX.
void ns3::GridPositionAllocator::SetDeltaY | ( | double | deltaY | ) |
deltaY | the y interval between two y-consecutive positions. |
Definition at line 137 of file position-allocator.cc.
References m_deltaY.
void ns3::GridPositionAllocator::SetLayoutType | ( | enum LayoutType | layoutType | ) |
layoutType | the type of layout to use (row first or column first). |
Definition at line 147 of file position-allocator.cc.
References m_layoutType.
void ns3::GridPositionAllocator::SetMinX | ( | double | xMin | ) |
xMin | the x coordinate where layout will start. |
Definition at line 122 of file position-allocator.cc.
References m_xMin.
void ns3::GridPositionAllocator::SetMinY | ( | double | yMin | ) |
yMin | the y coordinate where layout will start |
Definition at line 127 of file position-allocator.cc.
References m_yMin.
void ns3::GridPositionAllocator::SetN | ( | uint32_t | n | ) |
n | the number of positions allocated on each row (or each column) before switching to the next column (or row). |
Definition at line 142 of file position-allocator.cc.
References m_n.
uint32_t ns3::GridPositionAllocator::m_current [mutable, private] |
Definition at line 154 of file position-allocator.h.
Referenced by GetNext().
double ns3::GridPositionAllocator::m_deltaX [private] |
Definition at line 159 of file position-allocator.h.
Referenced by GetDeltaX(), GetNext(), GetTypeId(), and SetDeltaX().
double ns3::GridPositionAllocator::m_deltaY [private] |
Definition at line 160 of file position-allocator.h.
Referenced by GetDeltaY(), GetNext(), GetTypeId(), and SetDeltaY().
enum LayoutType ns3::GridPositionAllocator::m_layoutType [private] |
Definition at line 155 of file position-allocator.h.
Referenced by GetLayoutType(), GetNext(), GetTypeId(), and SetLayoutType().
uint32_t ns3::GridPositionAllocator::m_n [private] |
Definition at line 158 of file position-allocator.h.
Referenced by GetN(), GetNext(), GetTypeId(), and SetN().
double ns3::GridPositionAllocator::m_xMin [private] |
Definition at line 156 of file position-allocator.h.
Referenced by GetMinX(), GetNext(), GetTypeId(), and SetMinX().
double ns3::GridPositionAllocator::m_yMin [private] |
Definition at line 157 of file position-allocator.h.
Referenced by GetMinY(), GetNext(), GetTypeId(), and SetMinY().