本文介绍了Doxygen报告“潜在递归类关系”参见表2。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C ++模板化类 base :: Foo< class T> ,在另一个文件中我有一个类 base :: bar: :Foo:公共基础:: Foo< Baz> 。 Doxygen似乎不喜欢这样,因为它会引发错误

I have a C++ templated class base::Foo<class T>, and I have in another file a class base::bar::Foo : public base::Foo<Baz>. Doxygen seems not to like this, as it throws an error

<unknown>:1: Detected potential recursive class relation between class snLib::mocTwod::DsaCell and base class DsaCell< snLib::mocTwod::ProblemTraits, detLib::cellDiffusionTwod::ProblemTraits >!

是否有防止这种情况发生的方法? Doxygen的文档没有讨论此错误,也没有讨论潜在的递归类关系。

Is there a way to prevent this from occurring? Doxygen's documentation doesn't talk about this error or anything about "potential recursive class relation"s.

基本类:

/*! \file snlib/DsaCell.hpp
 */
#ifndef snlib_DsaCell_hpp
#define snlib_DsaCell_hpp
#include "Dsa.hpp"

namespace snLib {
/*!
 * \brief  Implementation of naive cell-centered DSA
 */
template <class HoTraits_T, class LoTraits_T>
class DsaCell : public snLib::Dsa< HoTraits_T, LoTraits_T >
{
    [snip]
};
}
#endif

引起问题的后代之一:

one of its descendants that is causing the problem:

/*! \file snlib/twod/moc/DsaCell.hpp
 */
#ifndef snlib_twod_moc_DsaCell_hpp
#define snlib_twod_moc_DsaCell_hpp
#include "snlib/DsaCell.hpp"

#include "ProblemTraits.hpp"
#include "detlib/twod/celldiffusion/ProblemTraits.hpp"

namespace snLib { namespace mocTwod {
/*!
 * \brief Inconsistent DSA for MOC
 */
class DsaCell : public snLib::DsaCell<
                        snLib::mocTwod::ProblemTraits,
                        detLib::cellDiffusionTwod::ProblemTraits
                        >
{
    [snip]
};
} } // end namespace snLib::mocTwod
#endif

My Doxygen配置文件设置了许多选项,包括路径配置: STRIP_FROM_PATH (设置为根目录), STRIP_FROM_INC_PATH (相同), INCLUDE_PATH (相同)。

My Doxygen configuration file has many options set, including the path configuration: STRIP_FROM_PATH (set to the root directory), STRIP_FROM_INC_PATH (same), INCLUDE_PATH (same).

编辑:看起来错误实际上是在另一个Doxyfile中抛出的,使用名称冲突的人生成的XML标签,因此问题与此相关。无论如何,我只是将基类重命名为其他名称,一切都很好。

it looks like the error was actually thrown in another Doxyfile that used the XML tags generated by the one with the conflicting name, so the problem was related to that. Anyway, I just renamed the base class to something else and all was well again.

推荐答案

Doxygen具有检查类是否可用的功能A和B具有递归的继承关系
(直接或间接)。该函数检查递归的极限深度为256。

Doxygen has a function that check whether classes A and B have an inheritance relation(either direct or indirect), which is recursive. The function check the recursion for a limit depth of 256.

doxygen可能与您的代码混淆了(由于名称一致),并认为A类取决于B和B再次取决于A。

Probably doxygen is confused with your code (since the name coincidence) and think that class A depends on B and B depends on A again.

这可能是Doxygen错误,但是最好的方法是重命名类。

It could be a Doxygen bug, but the best approach can be rename the class.

这篇关于Doxygen报告“潜在递归类关系”参见表2。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 03:45