Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting shared_ptr refs to appear in doxygen collaboration diagrams

I've done enough Googling to know that if I have something like

class SubObject {

public:
//blah blah blah
};

class Aggregate {
public:
   boost::shared_ptr<SubObject>   m_ptr;
};

I can get Doxygen to create the "correct" collaboration diagram if I have a dummy declaration like

namespace boost { template<class T> class shared_ptr { T *dummy; }; }

in my header file.

My question is: how do I get that to work over all my projects and all my headers, without having to actually include that line in every file?

like image 838
Eric H. Avatar asked Mar 01 '10 14:03

Eric H.


1 Answers

Heh.... I feel stupid answering my own questions, but I figure this one out pretty much right after posting it:

Put the code snippet

namespace boost { template<class T> class shared_ptr { T *dummy; }; }

in a header file, called something like "doxygen_dummy.h", and make sure it's included in your project's workspace or directory. You don't need to actually #include it anywhere (in fact, you don't want to, to avoid violating the One Definition Rule). You just need for Doxygen to be able to see it when it scans all your files.

like image 145
Eric H. Avatar answered Oct 21 '22 01:10

Eric H.