Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1596)

Unified Diff: src/helper/csma-star-helper.h

Issue 176077: Ns-3 Net-anim Interface Documentation (Closed)
Patch Set: method typo Created 14 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/tcp/star.cc ('k') | src/helper/csma-star-helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/helper/csma-star-helper.h
===================================================================
--- a/src/helper/csma-star-helper.h
+++ b/src/helper/csma-star-helper.h
@@ -28,21 +28,85 @@
namespace ns3 {
+/**
+ * \brief A helper to make it easier to create a star topology
+ * with Csma links
+ */
class CsmaStarHelper
{
public:
+ /**
+ * Create a CsmaStarHelper in order to easily create
+ * star topologies using Csma links
+ *
+ * \param numSpokes the number of links attached to
+ * the hub node, creating a total of
+ * numSpokes + 1 nodes
+ *
+ * \param csmaHelper the link helper for Csma links,
+ * used to link nodes together
+ */
CsmaStarHelper (uint32_t numSpokes,
CsmaHelper csmaHelper);
+
~CsmaStarHelper ();
+
public:
+ /**
+ * \returns a node pointer to the hub node in the
+ * star, i.e., the center node
+ */
Ptr<Node> GetHub () const;
- Ptr<Node> GetSpoke (uint32_t) const;
+
+ /**
+ * \param i an index into the spokes of the star
+ *
+ * \returns a node pointer to the node at the indexed spoke
+ */
+ Ptr<Node> GetSpokeNode (uint32_t i) const;
+
+ /**
+ * \returns the net-device container which contains all of
+ * the devices on the hub node
+ */
NetDeviceContainer GetHubDevices () const;
+
+ /**
+ * \returns the net-device container which contains all of
+ * the spoke node devices
+ */
NetDeviceContainer GetSpokeDevices () const;
- Ipv4Address GetHubIpv4Address (uint32_t) const;
- Ipv4Address GetSpokeIpv4Address (uint32_t) const;
+
+ /**
+ * \param i index into the hub interfaces
+ *
+ * \returns Ipv4Address according to indexed hub interface
+ */
+ Ipv4Address GetHubIpv4Address (uint32_t i) const;
+
+ /**
+ * \param i index into the spoke interfaces
+ *
+ * \returns Ipv4Address according to indexed spoke interface
+ */
+ Ipv4Address GetSpokeIpv4Address (uint32_t i) const;
+
+ /**
+ * \returns the total number of spokes in the star
+ */
uint32_t SpokeCount () const;
+
+ /**
+ * \param stack an InternetStackHelper which is used to install
+ * on every node in the star
+ */
void InstallStack (InternetStackHelper stack);
+
+ /**
+ * \param address an Ipv4AddressHelper which is used to install
+ * Ipv4 addresses on all the node interfaces in
+ * the star
+ */
void AssignIpv4Addresses (Ipv4AddressHelper address);
private:
@@ -53,7 +117,7 @@ private:
Ipv4InterfaceContainer m_hubInterfaces;
Ipv4InterfaceContainer m_spokeInterfaces;
};
-}
-#endif
+} // namespace ns3
+#endif /* CSMA_STAR_HELPER_H */
« no previous file with comments | « examples/tcp/star.cc ('k') | src/helper/csma-star-helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b