Bugzilla – Bug 2636
Add to doxygen a list of all registered TypeIds
Last modified: 2020-02-03 18:53:48 UTC
It would be helpful to add an index page, similar to the "All Attributes" page, containing the list of all registered TypeIds.
Hello there, where I can Find the list of all registered TypeIds?
(In reply to Parth Pandya from comment #1) > Hello there, where I can Find the list of all registered TypeIds? There is no centralized list. Searching the code for instances of the macro NS_OBJECT_ENSURE_REGISTERED() is one way to create such a list. The doxygen introspection program will need to fetch the list that is created by all of those calls to ENSURE_REGISTERED, so I recommend to follow what happens by those macro calls and it should lead you to the internal data structure where those are stored.
Hello! I've installed Doxygen and I've also found the following in a file named object-base.h : #define NS_OBJECT_ENSURE_REGISTERED(type) static struct Object ## type ## RegistrationClass { Object ## type ## RegistrationClass () { ns3::TypeId tid = type::GetTypeId (); tid.SetSize (sizeof (type)); tid.GetParent (); } } Object ## type ## RegistrationVariable Now, is this the stuff I was supposed to find and if yes, then what should I have to do with this ? Also, I've read documentation of searching a function or anything else on Doxygen manual but I found it difficult to understand so, I would need some help there too if possible!
I'd like to suggest a more straightforward way to approach this patch. The file utils/print-introspected-doxygen.cc already has a function PrintAllAttributes() that will print out the attributes for each registered TypeId. To print the attributes, the function iterates already on the list of registered TypeIds. Therefore, it should be straightforward to clone this and rename it to something like PrintAllTypeIds() and have the new function instead output the TypeIds (using the TypeId::GetName() method). Once this is done, the output needs to be linked to the main Doxygen page; studying how this is done for all attributes will help to follow the same approach.
Hello sir, I've runned print-introspected-doxygen.cc and the output I got was previewed in markdown too, which gave me a list of various entities. After that I just understood to rename the function name but I just got a mess with TypeId::GetName() method. Although I found that thing in the code of print-introspected-doxygen.cc but not quite sure about how to deal with it! Can I please get some more help here?
We do not use the tracker for debugging sessions, just to review and comment on patches and proposed approach. I can't tell for sure what is the problem because your description is not specific. If you need help, please use the ns-3-users group or Zulip to post more specific requests for help (for instance, providing your sample code so that someone could reproduce your error).
The patch should create a new function, PrintAllTypeIds(std::ostream & os). The body of this function should be similar to PrintAllAttributes, but omit the list section (lines 491-501). This new function should be called in main just before PrintAllAttributes at line 1517.
Created attachment 3248 [details] A patch after creating the function and changing other entities after editing the code of print-introspected-doxygen.cc Here's the patch :
Created attachment 3249 [details] A patch for the output generated by manipulating the required changes.
Created attachment 3250 [details] Added screenshot some of the entities which the code yielded me as an output.
Pushed to Gitlab commit 741fd9fe