用Doxygen记录不存在的成员 [英] Documenting a non-existing member with Doxygen

查看:61
本文介绍了用Doxygen记录不存在的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Doxygen记录python类。该类通过d-bus公开了一组属性,但是python类中没有相应的公共getter / setter。相反,它们是通过d-bus属性界面(Set / Get / GetAll / Introspect)实现的。

I'm trying to document a python class using Doxygen. The class exposes a set of properties over d-bus, but these have no corresponding public getters/setters in the python class. Instead, they are implemented through a d-bus properties interface (Set/Get/GetAll/Introspect).

我要做的是能够记录这些属性使用类似这样的东西:

What I want to do is to be able to document these properties using something like this:

## @property package :: Class ::名称描述

整个package :: Class都可以工作(相同的方法可以找到函数,因此可以找到正确的类)。

The whole package::Class works (the same method finds functions, so it finds the right class).

运行doxygen时我收到以下错误消息:

When running doxygen I get the following error:

警告:未声明或定义文档功能``package :: Class :: Name'。

我可以忍受警告,但是不幸的是,该属性未能出现在为该类生成的文档中,因此它不仅是警告,而且

I can live with a warning, but unfortunately the property fails to appear in the documentation generated for the class, so it is not only a warning, but it is silenced as well.

所以,我的问题是,如果可以的话,如何使不存在的财产成员出现在生成的文档中?

So, my question is, how, if I can, do I make the non-existing property member appear in the generated docs?

推荐答案

if 0:块内定义属性:

## @class X
## @brief this is useless
class X:
    if 0:
        ## @brief whatevs is a property that doesn't exist in spacetime
        ##
        ## It is designed to make bunny cry.
        whatevs = property

这将导致它存在于文档中(经过 doxygen 1.8.1.2-1 debian-挤压上)。该属性将永远不会在运行时存在,实际上,它看起来像是python字节码优化器消除了if语句及其主体。

This will cause it to exist in the documentation (tested with doxygen 1.8.1.2-1 on debian-squeeze). The attribute will never be made to exist at runtime, and in fact it looks like the python bytecode optimizer eliminates if statement and its body altogether.

这篇关于用Doxygen记录不存在的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆