Thread: [Doxygen-users] Displaying classes contained by smart pointer like contained by raw pointer
Brought to you by:
dimitri
From: Jens F. <fra...@st...> - 2014-11-11 14:47:46
|
Since the discussion and workarounds in Getting shared_ptr refs to appear in collaboration diagrams..... Eric J. Holtman 2010-03-01 and Re: templates and association diagrams James Ahlborn 2004-08-04 there is now the C++C11 standard (and one dos not need boost for certain smart pointer anymore) and I am still searching for an solution which is showing an embedded class object by a smart pointer (std::shared_ptr, std::week_ptr, std::unique_ptr) like a usual raw pointer. When generating UML look diagrams raw pointer s are indicated which the usually diamond symbol, but classed embedded by smart pointers are not shown. The workarounds managed in the post above are not solving the problem because they are showing an intermediate object "shared_ptr" between class and embedded class object. Since smart pointer can be use like raw pointers (and provide a lot of advantages) they should be treated like raw pointers. Maybe there are some good reasons that doxygen will not show all classes embedded in containers. |
From: Jens F. <fra...@st...> - 2015-01-07 07:33:32
|
Since the discussion and workarounds in Getting shared_ptr refs to appear in collaboration diagrams..... Eric J. Holtman 2010-03-01 and Re: templates and association diagrams James Ahlborn 2004-08-04 there is now the C++11 (and 14) standard (and one dos not need boost for certain smart pointer anymore) and I am still searching for an solution which is showing an embedded class object by a smart pointer (std::shared_ptr, std::week_ptr, std::unique_ptr) like a usual raw pointer. When generating UML look diagrams raw pointer s are indicated which the usually diamond symbol, but classed embedded by smart pointers are not shown. The workarounds managed in the posts (namespace std { template<class T> class shared_ptr { T *dummy; }; } ) above are not solving the problem because they are showing an intermediate object "shared_ptr" between class and embedded class object. (Maybe there are some good reasons that doxygen will not show all classes embedded in containers but since smart pointer can be use and treated like raw pointers (and provide a lot of advantages) I know no reasons why they should not be displayed like raw pointers.) Best Regards, Jens Frangenheim |
From: Dimitri v. H. <do...@gm...> - 2015-01-10 09:46:41
|
Hi Jens, Did you already try to enable BUILTIN_STL_SUPPORT? That basically does what the workaround below does, but then marks the classes as internal/artificial, so they don't appear in the output. Regards, Dimitri > On 07 Jan 2015, at 8:20 , Jens Frangenheim <fra...@st...> wrote: > > Since the discussion and workarounds in > > Getting shared_ptr refs to appear in collaboration diagrams..... Eric J. Holtman 2010-03-01 > > and > > Re: templates and association diagrams James Ahlborn 2004-08-04 > > there is now the C++11 (and 14) standard (and one dos not need boost for certain smart pointer anymore) > > and I am still searching for an solution which is showing an embedded class object by a smart pointer > (std::shared_ptr, std::week_ptr, std::unique_ptr) like a usual raw pointer. > > When generating UML look diagrams raw pointer s are indicated which the usually diamond symbol, > > but classed embedded by smart pointers are not shown. > > The workarounds managed in the posts (namespace std { template<class T> class shared_ptr { T *dummy; }; } ) > > above are not solving the problem because they are showing an intermediate object "shared_ptr" > between class and embedded class object. > > > (Maybe there are some good reasons that doxygen will not show all classes embedded in containers but > > since smart pointer can be use and treated like raw pointers (and provide a lot of advantages) I know no reasons why they should not be displayed like raw pointers.) > > Best Regards, Jens Frangenheim > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net_______________________________________________ > Doxygen-users mailing list > Dox...@li... > https://lists.sourceforge.net/lists/listinfo/doxygen-users |
From: Jens F. <fra...@st...> - 2015-01-12 07:48:12
|
Hi Dimitri, enabling BUILTIN_STL_SUPPORT does show up all the STL Objects created in the class but not the one handle over to the constructor. (with defining: namespace std { template<class T> class shared_ptr { T *dummy; }; } ) class MyClass { public: MyClass(std::shared_ptr<embedded_type> input, second_embedded_type input2); // second_embedded_type is show as embedded class visualized by the diamond symbol, embedded_type not // -> both (and also unique_ptrs and week_ptr should be show as like they are raw pointers private: //also for public if not enabling ~Show_private.... std::string myString; std::unique_ptr myPTR; // both are show as embedded visualized by the diamond symbol, string is displayed as typedef (orange arrow) from basic_string<char>, myPTR from unique_ptr<T> which embeds T // -> all of this should not been shown }; Regards, Jens |