Line |
Branch |
Exec |
Source |
1 |
|
|
#ifndef DOXYGEN_DOC_HH |
2 |
|
|
#define DOXYGEN_DOC_HH |
3 |
|
|
|
4 |
|
|
#include <boost/preprocessor/repetition.hpp> |
5 |
|
|
#include <boost/preprocessor/punctuation/comma_if.hpp> |
6 |
|
|
|
7 |
|
|
#include <boost/mpl/void.hpp> |
8 |
|
|
|
9 |
|
|
#ifndef DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR |
10 |
|
|
#define DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR 10 |
11 |
|
|
#endif |
12 |
|
|
|
13 |
|
|
namespace doxygen { |
14 |
|
|
typedef boost::mpl::void_ void_; |
15 |
|
|
|
16 |
|
|
template <typename _class> |
17 |
|
|
struct class_doc_impl { |
18 |
|
25 |
static inline const char* run() { return ""; } |
19 |
|
15 |
static inline const char* attribute(const char*) { return ""; } |
20 |
|
|
}; |
21 |
|
|
|
22 |
|
|
template <typename _class> |
23 |
|
330 |
inline const char* class_doc() { |
24 |
|
330 |
return class_doc_impl<_class>::run(); |
25 |
|
|
} |
26 |
|
|
|
27 |
|
|
template <typename _class> |
28 |
|
860 |
inline const char* class_attrib_doc(const char* name) { |
29 |
|
860 |
return class_doc_impl<_class>::attribute(name); |
30 |
|
|
} |
31 |
|
|
|
32 |
|
|
template <typename FuncPtr> |
33 |
|
1365 |
inline const char* member_func_doc(FuncPtr) { |
34 |
|
1365 |
return ""; |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
template <typename FuncPtr> |
38 |
|
1030 |
inline void_ member_func_args(FuncPtr) { |
39 |
|
1030 |
return void_(); |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
#define DOXYGEN_DOC_DECLARE_CONSTRUCTOR(z, nargs, unused) \ |
43 |
|
|
template <typename Class BOOST_PP_COMMA_IF(nargs) \ |
44 |
|
|
BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \ |
45 |
|
|
struct constructor_##nargs##_impl { \ |
46 |
|
|
static inline const char* doc() { return ""; } \ |
47 |
|
|
static inline void_ args() { return void_(); } \ |
48 |
|
|
}; \ |
49 |
|
|
\ |
50 |
|
|
template <typename Class BOOST_PP_COMMA_IF(nargs) \ |
51 |
|
|
BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \ |
52 |
|
|
inline const char* constructor_doc() { \ |
53 |
|
|
return constructor_##nargs##_impl<Class BOOST_PP_COMMA_IF( \ |
54 |
|
|
nargs) BOOST_PP_ENUM_PARAMS(nargs, Arg)>::doc(); \ |
55 |
|
|
} |
56 |
|
|
|
57 |
|
560 |
BOOST_PP_REPEAT(DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR, |
58 |
|
|
DOXYGEN_DOC_DECLARE_CONSTRUCTOR, ~) |
59 |
|
|
#undef DOXYGEN_DOC_DECLARE_CONSTRUCTOR |
60 |
|
|
/* |
61 |
|
|
template <typename Class> |
62 |
|
|
inline const char* constructor_doc () |
63 |
|
|
{ |
64 |
|
|
return ""; |
65 |
|
|
} |
66 |
|
|
*/ |
67 |
|
|
|
68 |
|
|
template <typename Class> |
69 |
|
|
struct destructor_doc_impl { |
70 |
|
|
static inline const char* run() { return ""; } |
71 |
|
|
}; |
72 |
|
|
|
73 |
|
|
template <typename Class> |
74 |
|
|
inline const char* destructor_doc() { |
75 |
|
|
return destructor_doc_impl<Class>::run(); |
76 |
|
|
} |
77 |
|
|
|
78 |
|
|
/* TODO class attribute can be handled by |
79 |
|
|
|
80 |
|
|
template <typename Class, typename AttributeType> |
81 |
|
|
const char* attribute_doc (AttributeType Class::* ptr) |
82 |
|
|
{ |
83 |
|
|
// Body looks like |
84 |
|
|
// if (ptr == &Class::attributeName) |
85 |
|
|
// return "attrib documentation"; |
86 |
|
|
return "undocumented"; |
87 |
|
|
} |
88 |
|
|
*/ |
89 |
|
|
|
90 |
|
|
} // namespace doxygen |
91 |
|
|
|
92 |
|
|
#endif // DOXYGEN_DOC_HH |
93 |
|
|
|