update dox

This commit is contained in:
Mathieu Lacage
2007-08-04 16:58:16 +02:00
parent b6618577c7
commit 797d537cb8
3 changed files with 29 additions and 15 deletions

View File

@@ -63,20 +63,24 @@ namespace ns3 {
*
* Each header must also make sure that:
* - it defines a public default constructor
* - it defines a public static method named GetUid which returns a string.
* - it defines a public static method named GetUid which returns a 32 bit integer
*
* The latter should look like the following to ensure that
* every header returns a unique string.
* The latter should look like the following:
* \code
* // in the header,
* class MyHeader : public Header
* {
* public:
* static const char *GetUid (void);
* static uint32_t GetUid (void);
* };
*
* const char *MyHeader::GetUid (void)
* // in the source file:
* NS_HEADER_ENSURE_REGISTERED (MyHeader);
*
* uint32_t MyHeader::GetUid (void)
* {
* return "MyHeader.unique.prefix";
* static uint32_t uid = Header::Register<MyHeader> ("MyHeader.unique.prefix");
* return uid;
* }
* \endcode
*

View File

@@ -327,6 +327,7 @@ private:
*
* So, a tag class should look like this:
* \code
* // in header file
* // note how a tag class does not derive from any other class.
* class MyTag
* {
@@ -334,9 +335,9 @@ private:
* // we need a public default constructor
* MyTag ();
* // we need a public static GetUid
* // GetUid must return a string which uniquely
* // GetUid must return a 32 bit integer which uniquely
* // identifies this tag type
* static std::string GetUid (void);
* static uint32_t GetUid (void);
* // Print should record in the output stream
* // the content of the tag instance.
* void Print (std::ostream &os) const;
@@ -352,11 +353,16 @@ private:
* uint32_t Deserialize (Buffer::Iterator i);
* };
*
* // in source file
*
* NS_TAG_ENSURE_REGISTERED (MyTag);
*
* std::string MyTag::GetUid (void)
* {
* // we really want to make sure that this
* // string is unique in the universe.
* return "MyTag.unique.prefix";
* static uint32_t uid = TagRegistry<MyTag> ("MyTag.unique.prefix");
* return uid;
* }
* \endcode
*/

View File

@@ -63,20 +63,24 @@ namespace ns3 {
*
* Each trailer must also make sure that:
* - it defines a public default constructor
* - it defines a public static method named GetUid which returns a string.
* - it defines a public static method named GetUid which returns a 32 bit integer.
*
* The latter should look like the following to ensure that
* every trailer returns a unique string.
* The latter should look like the following:
* \code
* // in the header
* class MyTrailer : public Header
* {
* public:
* static const char *GetUid (void);
* static uint32_t GetUid (void);
* };
*
* const char *MyTrailer::GetUid (void)
* // in the source file
* NS_TRAILER_ENSURE_REGISTERED (MyTrailer);
*
* uint32_t MyTrailer::GetUid (void)
* {
* return "MyTrailer.unique.prefix";
* static uint32_t uid = Trailer::Register<MyTrailer> ("MyTrailer.unique.prefix");
* return uid;
* }
* \endcode
*