Pred Class Reference
#include <codemodel_utils.h>
Detailed Description
The predicate.
Pred is not a real class, it is only a template parameter used in CodeModelUtils functions.
How to create the predicate:
Predicate is simply a class that have
bool operator() (predicateArgument)
. The return value of that operator is the result of a predicate.
For example we want to find all function definitions with a particular name. We can use CodeModelUtils::findFunctionDefinitions functions that require you to write a predicate for function definition DOM's. This can be done with following code:
class MyPred{
public:
MyPred(const TQString &name): m_name(name) {}
bool operator() (const FunctionDefinitionDom &def) const
{
return def->name() == m_name;
}
private:
TQString m_name;
};
The documentation for this class was generated from the following file: