doxygen不解析@ref对同一C#名称空间中成员的引用

时间:2015-07-30 19:00:22

标签: c# doxygen ref

首先,我应该说我不是一个doxygen专家,似乎每次尝试使用它都会学习一些新的技巧或技巧。但是,我遇到了一种情况,我对那些看似非常基本的东西感到困惑,即为方法创建@ ref。

为了确保我没有重复已经报告的内容,我搜索了其他doxygen报告的例子“无法解析对于\ ref命令的引用”,并发现类似于我所看到的内容,但对于C ++ 。据说这个特殊问题在doxygen 1.8.6中得到修复。

但是,我看到的特殊问题是C#。我也在使用doxygen 1.8.9.1。

我将事情简化为一个较短的例子,其中一个非常简单的mainpage.cs与两个简单的C#类中的完全限定的成员有几个@ ref。两个类都在同一名称空间中。我不知道它是germain还是重要的,但命名空间实际上有一个复合名称,即XXX.Reader_Interface,而不是像ReaderInterface这样的简单名称。

但是,即使我使用命名空间完全限定方法名称,我仍然会得到doxygen警告:

C:/RefBug/Interface/mainpage.cs:26:警告:无法解析对{ref命令的XXX.Reader_Interface.Reader.GetAvailableReaders()' for \ref command C:/RefBug/Interface/mainpage.cs:31: warning: unable to resolve reference to XXX.Reader_Interface.ReaderRef'的引用

我的mainpage.cs:

/**
 * @file
 * 
 * @mainpage
 *
 * @tableofcontents
 *
 * @section intro  Introduction
 *
 * This document describes the Application Programming Interface (API) for
 * communicating with readers in the XXX Software system.

 * @section usingTheAPI Using the API
 *
 * This section describes a typical usage scenario for the API, along with the 
 * data sources and sinks and threads of execution.
 *
 * @subsection findingReaders   Finding Readers
 *
 * First, the application must be configured for (or figure out) what readers 
 * are available to be used by the system.  
 *
 * @subsubsection queryReaders Automatically Finding Readers
 *
 * One option to do this will be provided via the method 
 * @ref XXX.Reader_Interface.Reader.GetAvailableReaders() ,
 * which will use some kind of magic.  
 *
 * @subsubsection makeReader    Creating a Reader
 *
 * Instantiate a reader using a @ref XXX.Reader_Interface.ReaderRef.
 *
 * @defgroup abstractReader     What all Readers have in common
 */

一个C#文件,Reader.cs:

/**
 * 
 * @file
 * 
 * @brief      Brief description of file/module.
 * @details    More detailed description of file/module.
 * @copyright  (c) 2015 Somebody, Incorporated.  All rights reserved.
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XXX.Instrument_Interface
{
    /// @ingroup abstractReader
    ///
    /// @brief  Abstract base class for a reader.
    ///
    /// <summary>
    /// Abstract base class to represent an reader with a serial interface.
    /// </summary>
    public abstract class Reader
    {
        /// <summary>
        /// Check each serial port to see if a reader is attached.
        /// </summary>
        /// <returns>
        /// Array of available readers.
        /// </returns>
        public static ReaderRef[] GetAvailableReaders()
        {
            return null;
        }

        /// <summary>
        /// Create an instance of a new reader, using an element of the list of 
        /// available readers as input.
        /// </summary>
        /// <param name="reader">
        /// One of the readers found attached to this PC.
        /// Obtained from the list provided by GetAvailableReader().
        /// </param>
        public Reader(ReaderRef reader)
        {
            throw new NotImplementedException();
        }
    }
}

另一个C#文件,ReaderRef.cs:

////////////////////////////////////////////////////////////////////////////////
/// 
/// @file
/// 
/// @brief      Brief description of file/module.
/// 
/// @details    More detailed description of file/module.
/// 
/// @copyright  (c) 2015 Somebody, Incorporated.  All rights reserved.
/// 
////////////////////////////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XXX.Instrument_Interface
{
    /// @ingroup abstractReader
    ///
    /// @brief  Reference to a reader.
    ///
    /// <summary>
    /// Reference to an reader connected to this PC.
    /// </summary>
    public class ReaderRef
    {
        /// <summary>
        /// Gets or sets the type of reader.
        /// </summary>
        public Type ReaderType
        {
            set;
            get;
        }

        /// <summary>
        /// Gets or sets a unique description for the reader.
        /// This should be unique to each reader, such as a serial number.
        /// </summary>
        public string Description
        {
            get;
            set;
        }

        /// <summary>
        /// Gets an instance of a specific reader based on the
        /// reader type.
        /// </summary>
        /// <returns>The reader if found, null otherwise.</returns>
        public Reader GetReader()
        {
            return null;
        }
    }
}

这是一个错误,还是我以某种方式使用doxygen?我希望有人可以告诉我为什么doxygen无法解决这些问题。对于想要试用它的人,我也很乐意为这个完整的例子上传一个.zip文件。

提前感谢您的帮助和耐心!

1 个答案:

答案 0 :(得分:1)

对不起,这是一个非常简单,愚蠢的错误。我创建的引用与命名空间说明符不匹配,因此COURSE doxygen无法解析它。在退回并重新审核代码后,我立即找到了它。很抱歉杂乱的电子邮件流量,感谢您的耐心等待。