Doxygen видит объявления глобальных переменных как функции в C ++ - PullRequest
0 голосов
/ 21 февраля 2019

Когда я запускаю 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.
...