From 5e19bd4b23778c330b8c798c4b406073b6e4b89f Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Mon, 22 May 2017 01:22:58 +0200 Subject: [PATCH] network: doxygen updates (partial) --- src/network/examples/main-packet-header.cc | 18 ++++++++++++++++-- src/network/examples/main-packet-tag.cc | 19 +++++++++++++++++-- src/network/model/buffer.h | 1 + src/network/model/byte-tag-list.h | 3 +++ src/network/model/packet-metadata.h | 13 +++++++++---- src/network/model/packet.h | 4 ++++ src/network/model/socket.h | 2 ++ src/network/utils/error-model.h | 4 ++++ src/network/utils/ethernet-header.h | 2 ++ src/network/utils/inet-socket-address.h | 1 + src/network/utils/ipv4-address.h | 2 ++ src/network/utils/queue.h | 4 +++- src/network/utils/sll-header.h | 4 ++-- 13 files changed, 66 insertions(+), 11 deletions(-) diff --git a/src/network/examples/main-packet-header.cc b/src/network/examples/main-packet-header.cc index 43e69c184..5f3afcf91 100644 --- a/src/network/examples/main-packet-header.cc +++ b/src/network/examples/main-packet-header.cc @@ -6,7 +6,9 @@ using namespace ns3; -/* A sample Header implementation +/** + * \ingroup network + * A simple example of an Header implementation */ class MyHeader : public Header { @@ -15,9 +17,21 @@ public: MyHeader (); virtual ~MyHeader (); + /** + * Set the header data. + * \param data The data. + */ void SetData (uint16_t data); + /** + * Get the header data. + * \return The data. + */ uint16_t GetData (void) const; + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; virtual void Print (std::ostream &os) const; @@ -25,7 +39,7 @@ public: virtual uint32_t Deserialize (Buffer::Iterator start); virtual uint32_t GetSerializedSize (void) const; private: - uint16_t m_data; + uint16_t m_data; //!< Header data }; MyHeader::MyHeader () diff --git a/src/network/examples/main-packet-tag.cc b/src/network/examples/main-packet-tag.cc index b0598bf8e..ecc3fd684 100644 --- a/src/network/examples/main-packet-tag.cc +++ b/src/network/examples/main-packet-tag.cc @@ -24,10 +24,17 @@ using namespace ns3; -// define this class in a public header +/** + * \ingroup network + * A simple example of an Tag implementation + */ class MyTag : public Tag { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; virtual uint32_t GetSerializedSize (void) const; @@ -36,10 +43,18 @@ public: virtual void Print (std::ostream &os) const; // these are our accessors to our tag structure + /** + * Set the tag value + * \param value The tag value. + */ void SetSimpleValue (uint8_t value); + /** + * Get the tag value + * \return the tag value. + */ uint8_t GetSimpleValue (void) const; private: - uint8_t m_simpleValue; + uint8_t m_simpleValue; //!< tag value }; TypeId diff --git a/src/network/model/buffer.h b/src/network/model/buffer.h index 373d2e4f0..9c9bd1b55 100644 --- a/src/network/model/buffer.h +++ b/src/network/model/buffer.h @@ -382,6 +382,7 @@ public: uint32_t GetRemainingSize (void) const; private: + /// Friend class friend class Buffer; /** * Constructor - initializes the iterator to point to the buffer start diff --git a/src/network/model/byte-tag-list.h b/src/network/model/byte-tag-list.h index c10a583dc..a8e1cb395 100644 --- a/src/network/model/byte-tag-list.h +++ b/src/network/model/byte-tag-list.h @@ -87,7 +87,9 @@ public: TagBuffer buf; //!< the data for the tag as generated by Tag::Serialize Item (TagBuffer buf); //!< constructs an item with the given TagBuffer private: + /// Friend class friend class ByteTagList; + /// Friend class friend class ByteTagList::Iterator; }; @@ -112,6 +114,7 @@ private: */ uint32_t GetOffsetStart (void) const; private: + /// Friend class friend class ByteTagList; /** diff --git a/src/network/model/packet-metadata.h b/src/network/model/packet-metadata.h index 4a82839e5..aa4af2917 100644 --- a/src/network/model/packet-metadata.h +++ b/src/network/model/packet-metadata.h @@ -84,10 +84,11 @@ public: */ struct Item { - enum { - PAYLOAD, - HEADER, - TRAILER + /// Type of data in the packet + enum ItemType { + PAYLOAD, //!< Payload + HEADER, //!< Header + TRAILER //!< Trailer } type; //!< metadata type /** * true: this is a fragmented header, trailer, or, payload. @@ -252,6 +253,8 @@ private: /** * \brief Initialize the item iterator to the buffer begin + * \param buffer buffer to initialize. + * \return the buffer iterator. */ ItemIterator BeginItem (Buffer buffer) const; @@ -501,6 +504,7 @@ public: }; friend DataFreeList::~DataFreeList (); + /// Friend class friend class ItemIterator; PacketMetadata (); @@ -596,6 +600,7 @@ public: /** * \brief Get the total size used by the metadata + * \return the metadata used size */ uint32_t GetTotalSize (void) const; diff --git a/src/network/model/packet.h b/src/network/model/packet.h index ae871c9ca..ead8bd03c 100644 --- a/src/network/model/packet.h +++ b/src/network/model/packet.h @@ -87,6 +87,7 @@ public: */ void GetTag (Tag &tag) const; private: + /// Friend class friend class ByteTagIterator; /** * \brief Constructor @@ -111,6 +112,7 @@ private: */ Item Next (void); private: + /// Friend class friend class Packet; /** * Copy Constructor @@ -149,6 +151,7 @@ public: */ void GetTag (Tag &tag) const; private: + /// Friend class friend class PacketTagIterator; /** * Constructor @@ -166,6 +169,7 @@ private: */ Item Next (void); private: + /// Friend class friend class Packet; /** * Constructor diff --git a/src/network/model/socket.h b/src/network/model/socket.h index d2b13885b..2493acba9 100644 --- a/src/network/model/socket.h +++ b/src/network/model/socket.h @@ -1024,6 +1024,8 @@ protected: /** * \brief Notify through the callback (if set) that a new connection has been * created. + * \param socket The socket receiving the new connection. + * \param from The address of the node initiating the connection. */ void NotifyNewConnectionCreated (Ptr socket, const Address &from); diff --git a/src/network/utils/error-model.h b/src/network/utils/error-model.h index fb4b21d71..4104386b1 100644 --- a/src/network/utils/error-model.h +++ b/src/network/utils/error-model.h @@ -465,6 +465,10 @@ private: class BinaryErrorModel : public ErrorModel { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); BinaryErrorModel (); diff --git a/src/network/utils/ethernet-header.h b/src/network/utils/ethernet-header.h index 6273f1506..a15240a8e 100644 --- a/src/network/utils/ethernet-header.h +++ b/src/network/utils/ethernet-header.h @@ -28,6 +28,8 @@ namespace ns3 { /** + * \ingroup network + * * Types of ethernet packets. Indicates the type of the current * header. */ diff --git a/src/network/utils/inet-socket-address.h b/src/network/utils/inet-socket-address.h index 218b5ec81..095bdb532 100644 --- a/src/network/utils/inet-socket-address.h +++ b/src/network/utils/inet-socket-address.h @@ -117,6 +117,7 @@ public: private: /** * \brief Convert to an Address type + * \return the Address corresponding to this object. */ Address ConvertTo (void) const; diff --git a/src/network/utils/ipv4-address.h b/src/network/utils/ipv4-address.h index 08133a92e..48a6d515e 100644 --- a/src/network/utils/ipv4-address.h +++ b/src/network/utils/ipv4-address.h @@ -204,6 +204,7 @@ private: /** * \brief Convert to an Address type + * \return the Address corresponding to this object. */ Address ConvertTo (void) const; @@ -294,6 +295,7 @@ public: void Set (uint32_t mask); /** * \brief Return the inverse mask in host order. + * \return The inverse mask */ uint32_t GetInverse (void) const; /** diff --git a/src/network/utils/queue.h b/src/network/utils/queue.h index c285672ab..5eef2b952 100644 --- a/src/network/utils/queue.h +++ b/src/network/utils/queue.h @@ -210,7 +210,7 @@ public: // a buffer with the date of arrival of past received packets // which are within the average window // so, it is quite costly to do it all the time. - // Hence, it is disabled by default and must be explicitely + // Hence, it is disabled by default and must be explicitly // enabled with this method which specifies the size // of the average window in time units. void EnableRunningAverage (Time averageWindow); @@ -254,6 +254,7 @@ private: uint32_t m_maxBytes; //!< max bytes in the queue QueueMode m_mode; //!< queue mode (packets or bytes) + /// Friend class template friend class Queue; }; @@ -330,6 +331,7 @@ public: protected: + /// Const iterator. typedef typename std::list >::const_iterator ConstIterator; /** diff --git a/src/network/utils/sll-header.h b/src/network/utils/sll-header.h index c47599448..75d0272b2 100644 --- a/src/network/utils/sll-header.h +++ b/src/network/utils/sll-header.h @@ -107,9 +107,9 @@ public: */ void SetPacketType (PacketType type); - //! Inherited from ObjectBase + // Inherited from ObjectBase virtual TypeId GetInstanceTypeId (void) const; - //! Inherited from Header + // Inherited from Header virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start);