私はいくつかの Doxygen コメント ブロックを書き込もうとしています。コードのサンプル スニペットを含めたいと思います。もちろん、サンプルが古くならないように実際にコンパイルしたいと思います。
私の example.cpp (.h ファイルに \include する) は次のようになります。
#include "stdafx.h"
#include "../types_lib/Time_Limiter.h"
#include <vector>
void tl_demo () {
// scarce will be a gate to control some resource that shouldn't get called
// more than 10 times a second
Time_Limiter scarce (10);
// here's a bunch of requests
std::vector<int> req (500);
for (size_t i=0;i<req.size ();i++) {
scarce.tick ();
// once we get here, we know that we haven't ticked
// more than 10 times in the last second.
// do something interesting with req[i]
}
}
// endcode
私のヘッダーファイル(私はDoxygenを実行しています)は次のようになります:
/**
* \ingroup types_lib
*
* \class Time_Limiter
*
* \brief Thread safe gate used to control a resource (such as an internet quote service) that has a limit on how often you can call it.
*
* \dontinclude Time_Limiter_example.cpp
* \skipline void
* \until endcode
*
**/
そして、doxygenに「void demo」からファイルの最後までを含めるようにしたいと思います(ただし、//エンドコードはありません)。
\dontinclude と \skip、\skipline、\until を試してみましたが、正しい呪文がわかりません。
編集: 私の .h ファイルを含めて、今ではほとんど正しい呪文を手に入れました。タグなしで \until を使用し、最後の // エンドコード行を example.cpp から削除する方法はありますか?