2011-11-30 29 views
7

私はDoxygenでいくつかの類似の値を含む2つのクラスの列挙を文書化しようとしています。しかし、それは同じ名前の各フィールドに重複したテキストを生成します。ここでDoxygenで同じ名前の列挙値を文書化するにはどうすればいいですか?

は私の2つの列挙されている:

/*! 
* \enum OperandType 
* \brief A type of operand. Represents the location of the operand. 
*/ 
enum class OperandType : unsigned int { 
    IMMEDIATE,   /**< An immediate operand */ 
    REGISTER,   /**< An operand in a register */ 
    STACK,    /**< An operand on the stack */ 
    GLOBAL    /**< A global operand */ 
}; 
/*! 
* \enum PositionType 
* \brief A type of position for a variable 
*/ 
enum class PositionType : unsigned int { 
    STACK,   /**< A variable on the stack */ 
    PARAMETER,  /**< A parameter */ 
    GLOBAL,   /**< A global variable */ 
    CONST   /**< A const variable.*/ 
}; 

各列挙のスタックメンバーの説明は、両方の記述の連結され、グローバルに同じ問題があります。

STACKの説明は次のとおりです。

スタック

上のスタック

オペランドの変数は、具体的にそれらのそれぞれを文書化する方法はありますか?

+4

DoxygenはC++ 11のサポートがかなり悪いです。 – Pubby

+1

enumの1つを名前空間に入れてから、その後にenumを親の名前空間にインポートすると機能しますか?私はあまり醜い方法があると思うだろうが、私はdoxygenをよく知らない。うまくいけばC++ 11のサポートはすぐに改善されます – bames53

答えて

2

回避策は名前空間に入れて、usingにすることです。

/*! 
* enum class 
*/ 
namespace enum_class { 
    /*! 
    * \enum OperandType 
    * \brief A type of operand. Represents the location of the operand. 
    * Ok 
    */ 
    enum class OperandType : unsigned int { 
     IMMEDIATE,   /**< An immediate operand */ 
      REGISTER,   /**< An operand in a register */ 
     STACK,    /**< An operand on the stack */ 
     GLOBAL    /**< A global operand */ 
    }; 
} 
using enum_class::OperandType; 
/*! 
* \enum PositionType 
* \brief A type of position for a variable 
*/ 
enum class PositionType : unsigned int { 
    STACK,   /**< A variable on the stack */ 
    PARAMETER,  /**< A parameter */ 
    GLOBAL,   /**< A global variable */ 
    CONST   /**< A const variable.*/ 
}; 

あなたは分離を好きではない場合は、別の名前空間(enumeration)でPositionTypeを置くことができます。

+0

それは動作しますが、列挙はenum_classの下で文書化され、私の名前空間では記述されません。私はこれが理想的ではないと思います。この列挙型を使用する人は、ルート名前空間のドキュメントを検索します。使用するためのドキュメントを生成するようにDoxygenに指示する方法はありますか? –

関連する問題