Got rid of translated comments cache, seems very inefficient
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13255 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4398d1aee4
commit
f57b515ee7
2 changed files with 3 additions and 22 deletions
|
|
@ -15,12 +15,8 @@
|
||||||
#include "DoxygenTranslator.h"
|
#include "DoxygenTranslator.h"
|
||||||
|
|
||||||
DoxygenTranslator::DoxygenTranslator() {
|
DoxygenTranslator::DoxygenTranslator() {
|
||||||
// Init the cache
|
|
||||||
resultsCache = NewHash();
|
|
||||||
}
|
}
|
||||||
DoxygenTranslator::~DoxygenTranslator() {
|
DoxygenTranslator::~DoxygenTranslator() {
|
||||||
// Clean up the cache
|
|
||||||
Delete(resultsCache);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DoxygenTranslator::hasDocumentation(Node *node) {
|
bool DoxygenTranslator::hasDocumentation(Node *node) {
|
||||||
|
|
@ -37,17 +33,7 @@ String *DoxygenTranslator::getDocumentation(Node *node) {
|
||||||
if (!hasDocumentation(node))
|
if (!hasDocumentation(node))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// get from cache
|
return makeDocumentation(node);
|
||||||
String *resultedDocs = Getattr(resultsCache, getDoxygenComment(node));
|
|
||||||
|
|
||||||
if (resultedDocs)
|
|
||||||
return resultedDocs;
|
|
||||||
|
|
||||||
// not found in cache, produce it
|
|
||||||
resultedDocs = makeDocumentation(node);
|
|
||||||
Setattr(resultsCache, getDoxygenComment(node), resultedDocs);
|
|
||||||
|
|
||||||
return resultedDocs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoxygenTranslator::printTree(std::list < DoxygenEntity > &entityList) {
|
void DoxygenTranslator::printTree(std::list < DoxygenEntity > &entityList) {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A class to translate doxygen comments attacted to parser nodes
|
* A class to translate doxygen comments attached to parser nodes
|
||||||
* into alternative formats for use in code generated for target languages.
|
* into alternative formats for use in code generated for target languages.
|
||||||
*/
|
*/
|
||||||
class DoxygenTranslator {
|
class DoxygenTranslator {
|
||||||
|
|
@ -37,7 +37,7 @@ public:
|
||||||
virtual ~ DoxygenTranslator();
|
virtual ~ DoxygenTranslator();
|
||||||
/*
|
/*
|
||||||
* Return the documentation for a given node formated for the correct
|
* Return the documentation for a given node formated for the correct
|
||||||
* documentation system. The result is cached and translated only once.
|
* documentation system.
|
||||||
* @param node The node to extract and translate documentation for.
|
* @param node The node to extract and translate documentation for.
|
||||||
* @return The resulted documentation string.
|
* @return The resulted documentation string.
|
||||||
*/
|
*/
|
||||||
|
|
@ -70,11 +70,6 @@ protected:
|
||||||
* Doxygen parser object
|
* Doxygen parser object
|
||||||
*/
|
*/
|
||||||
DoxygenParser parser;
|
DoxygenParser parser;
|
||||||
|
|
||||||
/*
|
|
||||||
* Cache of translated comments
|
|
||||||
*/
|
|
||||||
Hash *resultsCache;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue