Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Doxygen recognize std::shared_ptr or std::map

Tags:

c++

doxygen

Is it possible to teach Doxygen to recognize a member of type std::shared_ptr<T> as an aggregation? I think it does it for normal pointers, although I have added BUILTIN_STL_SUPPORT=YES.

The question also extends to std::unique_ptr which should be a composition, and I think std::map<K,V>, std::vector<V> etc could be documented as composition with multiplicity 1...N, although I am pretty sure I don't want this in all cases.

If this is not possible with Doxygen, I would be interested in alternative documentation systems for C++.

like image 562
Jens Avatar asked Mar 09 '16 11:03

Jens


1 Answers

As of version 1.8.14, Doxygen doesn't add std::shared_ptr<T> to the internal list of std classes when BUILTIN_STL_SUPPORT is on.

But it's relatively easy to add it by modifying Doxygen sources. In src/doxygen.cpp there's a global variable g_stlinfo that holds definitions of standard classes. Also, addSTLClasses() function in the same class has a branch for smart pointer classes.

Refer to this changeset for minimal change to enable shared_ptr support.

Unfortunately, I cannot answer the rest of your question yet.

like image 97
Dmitry Avatar answered Nov 11 '22 21:11

Dmitry