Doxygen将全局变量声明视为C ++中的函数

时间:2019-02-21 16:34:47

标签: c++ doxygen

当我运行Doxygen(1.8.15)时,我在日志文件中收到警告,指出未记录功能的所有参数:

warning: parameters of member gSwInstallIoMgr are not (all) documented
warning: return type of member gSwInstallIoMgr is not documented

有问题的“函数”不是函数,而是变量声明:

//! This defines the handler for processing changes to the SW installation.
SwInstallIoMgr gSwInstallIoMgr(gsIoMgrDictionary.mMainPcba.mSwInstall);

我尝试添加@var命令以将其指定为变量:

//! @var SwInstallIoMgr gSwInstallIoMgr
//! This defines the handler for processing changes to the SW installation.
SwInstallIoMgr gSwInstallIoMgr(gsIoMgrDictionary.mMainPcba.mSwInstall);

但是随后我收到警告,提示该功能未记录。

有人知道解决此问题的方法吗?

编辑:添加更多上下文

//! @brief Software Installation interface class definition.

class SwInstallIoMgr : public Observer
{
public:
   //! @brief Constructor.
   //! @param[in] rIoParams This provides items used for user communication.
   SwInstallIoMgr(SwInstallIoMgrParams & rIoParams);

   //! @brief Destructor.
   virtual ~SwInstallIoMgr();
}

gsIoMgrDictionary是一个包含共享数据的全局对象。

IoManagerParams gsIoMgrDictionaryInstance; //!< Dictionary instance for ioMgr
IoManagerParams& gsIoMgrDictionary = gsIoMgrDictionaryInstance; //!< reference to dictionary

IoManagerParams是美化的数据结构。

可重现的示例: BoxBase.h

#ifndef BOX_BASE_H
#define BOX_BASE_H

//! @brief BoxBase is a base for the Box
class BoxBase
{
public:

   //! Set of notification policy bits for a Box instance.
   enum NotifyFlags
   {
      //! Notify observers when Box::Attach() method is called.
      NOTIFY_ON_ATTACH = 0x01,

      //! Notify observers when Box::Set() method is called.
      NOTIFY_ON_SET = 0x02,

      //! Notify observers when Box::Set() method is called and the
      //! Box value has changed, or more precisely when C::operator!=
      //! returns true.
      NOTIFY_ON_CHANGE = 0x04
   };

}

Box.h

#ifndef BOX_H
#define BOX_H

//! @brief A Box
template <class C> class Box: public BoxBase
{
   //! @brief Box constructor with an initial value and notification
   //! policy.
   //!
   //! A copy of the initial value object object is managed by the
   //! box.
   //!
   //! @param[in] c Initial value of the box.
   //! @param[in] notifyFlags Box<>::NotifyFlags type or'd together.
   explicit Box(const C& c,
                int notifyFlags = (NOTIFY_ON_CHANGE | NOTIFY_ON_ATTACH));

private:
   // The box value.
   C mVal;

   // The box value when constructed.
   C mInitialValue;

   // An or composition of NotifyFlags maintaining the Box
   // notification policy. Defined mutable since it does not
   // participate in the equality operator.
   mutable int mNotifyFlags;

   // Marker that the Box contents have been changed via Set() after the
   // previous Get(). If yes this flag is set to true, otherwise false.
   // Defined mutable since it does not participate in the equality
   // operator.
   mutable bool mHasChanged;
};

template <class C>
Box<C>::Box(const C& ival, int notifyFlags):
   BoxBase(), mVal(ival), mInitialValue(ival),
   mNotifyFlags(notifyFlags), mHasChanged(false)
{}

#endif

TestFile.h

//****************************************************************************
//! @file
//! @brief A Box group stuff.
//!
//! Copyright (C) 2016 MyCompany, Inc. All rights reserved.
//****************************************************************************
#include "Box.h"

namespace Dictionary
{
   namespace OtherSettingsGroup
   {
      //! Informing GUI of current reminder period.
      extern Box<int> toGUIReminder;

      //! GUI informing GUI of new reminder period.
      extern Box<int> toApplicationReminder;

      //! Tells Application to update the values in the OtherSettings group.
      extern Box<bool> toApplicationUpdateOtherSettings;
   }
}

TestFile.cpp

//****************************************************************************
//! @file
//! @brief A Box group for stuff.
//!
//! Copyright (C) 2016 MyCompany, Inc. All rights reserved.
//****************************************************************************

#include "TestFile.h"

namespace Dictionary
{
   namespace OtherSettingsGroup
   {
      Box<int> toGUIReminder(int(0), BoxBase::NOTIFY_ON_SET);

      Box<int> toApplicationReminder(int(0), BoxBase::NOTIFY_ON_SET);

      Box<bool> toApplicationUpdateOtherSettings(bool(false), 
                                                 BoxBase::NOTIFY_ON_SET);
   }
}

此示例产生两个警告:

TestFile.cpp:14: warning: Member toGUIReminder(int(0), BoxBase::NOTIFY_ON_SET) (function) of namespace Dictionary::OtherSettingsGroup is not documented.
TestFile.cpp:16: warning: Member toApplicationReminder(int(0), BoxBase::NOTIFY_ON_SET) (function) of namespace Dictionary::OtherSettingsGroup is not documented.

0 个答案:

没有答案