diff --git a/src/helper/net-device-container.cc b/src/helper/net-device-container.cc index 9bde8226c..65509960c 100644 --- a/src/helper/net-device-container.cc +++ b/src/helper/net-device-container.cc @@ -5,36 +5,36 @@ namespace ns3 { NetDeviceContainer::Iterator NetDeviceContainer::Begin (void) const { - return m_nodes.begin (); + return m_devices.begin (); } NetDeviceContainer::Iterator NetDeviceContainer::End (void) const { - return m_nodes.end (); + return m_devices.end (); } uint32_t NetDeviceContainer::GetN (void) const { - return m_nodes.size (); + return m_devices.size (); } Ptr NetDeviceContainer::Get (uint32_t i) const { - return m_nodes[i]; + return m_devices[i]; } void NetDeviceContainer::Add (NetDeviceContainer other) { for (Iterator i = other.Begin (); i != other.End (); i++) { - m_nodes.push_back (*i); + m_devices.push_back (*i); } } void -NetDeviceContainer::Add (Ptr node) +NetDeviceContainer::Add (Ptr device) { - m_nodes.push_back (node); + m_devices.push_back (device); } } // namespace ns3 diff --git a/src/helper/net-device-container.h b/src/helper/net-device-container.h index 11297c4da..cf9a690aa 100644 --- a/src/helper/net-device-container.h +++ b/src/helper/net-device-container.h @@ -7,23 +7,49 @@ namespace ns3 { +/** + * \brief holds a vector of ns3::NetDevice pointers + * + */ class NetDeviceContainer { public: typedef std::vector >::const_iterator Iterator; + /** + * \returns an iterator which points to the start of the array of pointers. + */ Iterator Begin (void) const; + /** + * \returns an iterator which points to the end of the array of pointers. + */ Iterator End (void) const; + /** + * \returns the number of netdevice pointers stored in this container. + */ uint32_t GetN (void) const; + /** + * \param i the index of the requested netdevice pointer. + * \returns the requested netdevice pointer. + */ Ptr Get (uint32_t i) const; - void Create (uint32_t n); + /** + * \param other another netdevice container + * + * Append to the end of this container the other input container. + */ void Add (NetDeviceContainer other); - void Add (Ptr node); + /** + * \param device another netdevice pointer. + * + * Append to the end of this container the input netdevice pointer. + */ + void Add (Ptr device); private: - std::vector > m_nodes; + std::vector > m_devices; }; } // namespace ns3