From c8f4d234ea2272973be7ebf21f6683320a29e39e Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Mon, 17 Mar 2008 17:47:45 -0700 Subject: [PATCH] improve doxygen. --- src/core/trace-source-accessor.h | 3 +- src/core/type-id.cc | 28 ------------ src/core/type-id.h | 78 +++++++++++++++++++++++++------- 3 files changed, 64 insertions(+), 45 deletions(-) diff --git a/src/core/trace-source-accessor.h b/src/core/trace-source-accessor.h index c244b2e40..48ea7ac0a 100644 --- a/src/core/trace-source-accessor.h +++ b/src/core/trace-source-accessor.h @@ -31,7 +31,8 @@ class ObjectBase; /** * \brief control access to objects' trace sources * - * This class abstracts the kind of trace source to which we want to connect. + * This class abstracts the kind of trace source to which we want to connect + * and provides services to Connect and Disconnect a sink to a trace source. */ class TraceSourceAccessor { diff --git a/src/core/type-id.cc b/src/core/type-id.cc index 1d0c26b69..1f23c8241 100644 --- a/src/core/type-id.cc +++ b/src/core/type-id.cc @@ -16,14 +16,12 @@ public: IidManager (); uint16_t AllocateUid (std::string name); void SetParent (uint16_t uid, uint16_t parent); - void SetTypeName (uint16_t uid, std::string typeName); void SetGroupName (uint16_t uid, std::string groupName); void AddConstructor (uint16_t uid, ns3::Callback callback); void HideFromDocumentation (uint16_t uid); uint16_t GetUid (std::string name) const; std::string GetName (uint16_t uid) const; uint16_t GetParent (uint16_t uid) const; - std::string GetTypeName (uint16_t uid) const; std::string GetGroupName (uint16_t uid) const; ns3::Callback GetConstructor (uint16_t uid) const; bool HasConstructor (uint16_t uid) const; @@ -70,7 +68,6 @@ private: struct IidInformation { std::string name; uint16_t parent; - std::string typeName; std::string groupName; bool hasConstructor; ns3::Callback constructor; @@ -104,7 +101,6 @@ IidManager::AllocateUid (std::string name) struct IidInformation information; information.name = name; information.parent = 0; - information.typeName = ""; information.groupName = ""; information.hasConstructor = false; information.mustHideFromDocumentation = false; @@ -129,12 +125,6 @@ IidManager::SetParent (uint16_t uid, uint16_t parent) information->parent = parent; } void -IidManager::SetTypeName (uint16_t uid, std::string typeName) -{ - struct IidInformation *information = LookupInformation (uid); - information->typeName = typeName; -} -void IidManager::SetGroupName (uint16_t uid, std::string groupName) { struct IidInformation *information = LookupInformation (uid); @@ -187,12 +177,6 @@ IidManager::GetParent (uint16_t uid) const return information->parent; } std::string -IidManager::GetTypeName (uint16_t uid) const -{ - struct IidInformation *information = LookupInformation (uid); - return information->typeName; -} -std::string IidManager::GetGroupName (uint16_t uid) const { struct IidInformation *information = LookupInformation (uid); @@ -464,12 +448,6 @@ TypeId::SetGroupName (std::string groupName) return *this; } TypeId -TypeId::SetTypeName (std::string typeName) -{ - Singleton::Get ()->SetTypeName (m_tid, typeName); - return *this; -} -TypeId TypeId::GetParent (void) const { uint16_t parent = Singleton::Get ()->GetParent (m_tid); @@ -491,12 +469,6 @@ TypeId::GetGroupName (void) const std::string groupName = Singleton::Get ()->GetGroupName (m_tid); return groupName; } -std::string -TypeId::GetTypeName (void) const -{ - std::string typeName = Singleton::Get ()->GetTypeName (m_tid); - return typeName; -} std::string TypeId::GetName (void) const diff --git a/src/core/type-id.h b/src/core/type-id.h index 3207ff1c0..548134785 100644 --- a/src/core/type-id.h +++ b/src/core/type-id.h @@ -90,16 +90,21 @@ public: */ TypeId GetParent (void) const; + /** + * \param other a parent TypeId + * \returns true if the input TypeId is really a parent + * of this TypeId, false otherwise. + * + * Calling this method is roughly similar to calling dynamic_cast + * except that you do not need object instances: you can do the check + * with TypeId instances instead. + */ bool IsChildOf (TypeId other) const; /** * \returns the name of the group associated to this TypeId. */ std::string GetGroupName (void) const; - /** - * \returns the fully-qualified C++ typename of this TypeId. - */ - std::string GetTypeName (void) const; /** * \returns the name of this interface. @@ -121,6 +126,11 @@ public: * index is i. */ std::string GetAttributeName (uint32_t i) const; + /** + * \param i index into attribute array. + * \returns the help text associated to the attribute whose + * index is i. + */ std::string GetAttributeHelp (uint32_t i) const; /** * \param i index into attribute array @@ -129,21 +139,63 @@ public: */ std::string GetAttributeFullName (uint32_t i) const; + /** + * \param i index into attribute array. + * \returns the value with which the associated attribute + * is initialized. + */ Attribute GetAttributeInitialValue (uint32_t i) const; + /** + * \param i index into attribute array. + * \returns the flags associated to the requested attribute. + */ uint32_t GetAttributeFlags (uint32_t i) const; + /** + * \param i index into attribute array. + * \returns the checker associated to the requested attribute. + */ Ptr GetAttributeChecker (uint32_t i) const; - - - uint32_t GetTraceSourceN (void) const; - std::string GetTraceSourceName (uint32_t i) const; - std::string GetTraceSourceHelp (uint32_t i) const; - Ptr GetTraceSourceAccessor (uint32_t i) const; + /** + * \param i index into attribute array. + * \returns the accessor associated to the requested attribute. + */ Ptr GetAttributeAccessor (uint32_t i) const; + /** + * \returns a callback which can be used to instanciate an object + * of this type. + */ Callback GetConstructor (void) const; + /** + * \returns true if this TypeId should be hidden from the user, + * false otherwise. + */ bool MustHideFromDocumentation (void) const; + + /** + * \returns the number of trace sources defined in this TypeId. + */ + uint32_t GetTraceSourceN (void) const; + /** + * \param i index into trace source array. + * \returns the name of the requested trace source. + */ + std::string GetTraceSourceName (uint32_t i) const; + /** + * \param i index into trace source array. + * \returns the help text of the requested trace source. + */ + std::string GetTraceSourceHelp (uint32_t i) const; + /** + * \param i index into trace source array. + * \returns the accessor used to get access to the requested + * trace source. + */ + Ptr GetTraceSourceAccessor (uint32_t i) const; + + /** * \param tid the TypeId of the base class. * \return this TypeId instance. @@ -170,12 +222,6 @@ public: * scheme. */ TypeId SetGroupName (std::string groupName); - - /** - * \param typeName the fully-qualified C++ typename of this TypeId. - * \returns this TypeId instance. - */ - TypeId SetTypeName (std::string typeName); /** * \returns this TypeId instance