From aed9cae83affd8ce8f82586c551279eddd6e0ccf Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Fri, 31 Mar 2017 16:12:49 -0700 Subject: [PATCH] mobility: Add GetSize() method to ListPositionAllocator --- src/mobility/model/position-allocator.cc | 6 ++++++ src/mobility/model/position-allocator.h | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/mobility/model/position-allocator.cc b/src/mobility/model/position-allocator.cc index 8aa8cfa6a..5a01278f8 100644 --- a/src/mobility/model/position-allocator.cc +++ b/src/mobility/model/position-allocator.cc @@ -87,6 +87,12 @@ ListPositionAllocator::AssignStreams (int64_t stream) return 0; } +uint32_t +ListPositionAllocator::GetSize (void) const +{ + return m_positions.size (); +} + NS_OBJECT_ENSURE_REGISTERED (GridPositionAllocator); TypeId diff --git a/src/mobility/model/position-allocator.h b/src/mobility/model/position-allocator.h index dda795f8a..d33aee430 100644 --- a/src/mobility/model/position-allocator.h +++ b/src/mobility/model/position-allocator.h @@ -83,6 +83,14 @@ public: * \param v the position to append at the end of the list of positions to return from GetNext. */ void Add (Vector v); + /** + * Return the number of positions stored. Note that this will not change + * based on calling GetNext(), as the number of positions is not altered + * by calling GetNext (). + * + * \return the number of positions stored + */ + uint32_t GetSize (void) const; virtual Vector GetNext (void) const; virtual int64_t AssignStreams (int64_t stream); private: