Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Private Attributes
CppImport::NodeHasher Class Reference

This is a helper class which aims to create unique identifiers for clang nodes. More...

Public Member Functions

 NodeHasher (ClangHelpers &clang)
 
const QString hashClassTemplate (const clang::ClassTemplateDecl *classTemplate)
 
const QString hashClassTemplateSpec (const clang::ClassTemplateSpecializationDecl *classTemplateSpec)
 
const QString hashEnum (const clang::EnumDecl *enumDecl)
 
const QString hashFunction (const clang::FunctionDecl *functionDecl)
 
const QString hashMethod (const clang::CXXMethodDecl *methodDecl)
 
const QString hashNameSpace (const clang::NamespaceDecl *namespaceDecl)
 
const QString hashNameSpaceAlias (const clang::NamespaceAliasDecl *namespaceAlias)
 
const QString hashNamespaceField (const clang::VarDecl *varDecl)
 
const QString hashNestedNameSpecifier (const clang::NestedNameSpecifier *nestedName)
 
const QString hashParentOfStaticField (const clang::DeclContext *context)
 This function is a dispatcher for a context which represents a class to return the correct hash. More...
 
const QString hashRecord (const clang::RecordDecl *recordDecl)
 
const QString hashStaticField (const clang::VarDecl *varDecl)
 Hashes a static field. More...
 
const QString hashTemplateArg (const clang::TemplateArgument &templateArg)
 
const QString hashTemplateTypeParm (const clang::NonTypeTemplateParmDecl *nonTypeTemplParam)
 
const QString hashTemplateTypeParm (const clang::TemplateTypeParmDecl *templTypeParam)
 
const QString hashType (const clang::QualType &type)
 
const QString hashTypeAlias (const clang::TypedefNameDecl *typeAlias)
 
const QString hashTypeAliasTemplate (const clang::TypeAliasTemplateDecl *typeAliasTemplate)
 
const QString hashTypeSourceInfo (const clang::TypeSourceInfo *info)
 
const QString hashUnresolvedUsingDecl (const clang::UnresolvedUsingValueDecl *unresolvedUsing)
 
const QString hashUsingDecl (const clang::UsingDecl *usingDecl)
 
const QString hashUsingDirective (const clang::UsingDirectiveDecl *usingDirective)
 
const QString hashUsingParent (const clang::DeclContext *context)
 

Private Attributes

ClangHelpersclang_
 

Detailed Description

This is a helper class which aims to create unique identifiers for clang nodes.

The methods should return the same value for full defined clang nodes and declarations. The user of this class has to make sure that the source manager is set and valid.

Constructor & Destructor Documentation

◆ NodeHasher()

CppImport::NodeHasher::NodeHasher ( ClangHelpers clang)

Member Function Documentation

◆ hashClassTemplate()

const QString CppImport::NodeHasher::hashClassTemplate ( const clang::ClassTemplateDecl *  classTemplate)

◆ hashClassTemplateSpec()

const QString CppImport::NodeHasher::hashClassTemplateSpec ( const clang::ClassTemplateSpecializationDecl *  classTemplateSpec)

◆ hashEnum()

const QString CppImport::NodeHasher::hashEnum ( const clang::EnumDecl *  enumDecl)

◆ hashFunction()

const QString CppImport::NodeHasher::hashFunction ( const clang::FunctionDecl *  functionDecl)

◆ hashMethod()

const QString CppImport::NodeHasher::hashMethod ( const clang::CXXMethodDecl *  methodDecl)

◆ hashNameSpace()

const QString CppImport::NodeHasher::hashNameSpace ( const clang::NamespaceDecl *  namespaceDecl)

◆ hashNameSpaceAlias()

const QString CppImport::NodeHasher::hashNameSpaceAlias ( const clang::NamespaceAliasDecl *  namespaceAlias)

◆ hashNamespaceField()

const QString CppImport::NodeHasher::hashNamespaceField ( const clang::VarDecl *  varDecl)

◆ hashNestedNameSpecifier()

const QString CppImport::NodeHasher::hashNestedNameSpecifier ( const clang::NestedNameSpecifier *  nestedName)

◆ hashParentOfStaticField()

const QString CppImport::NodeHasher::hashParentOfStaticField ( const clang::DeclContext *  context)

This function is a dispatcher for a context which represents a class to return the correct hash.

It is used to hash the context (=parent) of static fields.

◆ hashRecord()

const QString CppImport::NodeHasher::hashRecord ( const clang::RecordDecl *  recordDecl)

◆ hashStaticField()

const QString CppImport::NodeHasher::hashStaticField ( const clang::VarDecl *  varDecl)

Hashes a static field.

Note that clang treats static fields as VarDecl's.

◆ hashTemplateArg()

const QString CppImport::NodeHasher::hashTemplateArg ( const clang::TemplateArgument &  templateArg)

◆ hashTemplateTypeParm() [1/2]

const QString CppImport::NodeHasher::hashTemplateTypeParm ( const clang::NonTypeTemplateParmDecl *  nonTypeTemplParam)

◆ hashTemplateTypeParm() [2/2]

const QString CppImport::NodeHasher::hashTemplateTypeParm ( const clang::TemplateTypeParmDecl *  templTypeParam)

◆ hashType()

const QString CppImport::NodeHasher::hashType ( const clang::QualType &  type)

◆ hashTypeAlias()

const QString CppImport::NodeHasher::hashTypeAlias ( const clang::TypedefNameDecl *  typeAlias)

◆ hashTypeAliasTemplate()

const QString CppImport::NodeHasher::hashTypeAliasTemplate ( const clang::TypeAliasTemplateDecl *  typeAliasTemplate)

◆ hashTypeSourceInfo()

const QString CppImport::NodeHasher::hashTypeSourceInfo ( const clang::TypeSourceInfo *  info)

◆ hashUnresolvedUsingDecl()

const QString CppImport::NodeHasher::hashUnresolvedUsingDecl ( const clang::UnresolvedUsingValueDecl *  unresolvedUsing)

◆ hashUsingDecl()

const QString CppImport::NodeHasher::hashUsingDecl ( const clang::UsingDecl *  usingDecl)

◆ hashUsingDirective()

const QString CppImport::NodeHasher::hashUsingDirective ( const clang::UsingDirectiveDecl *  usingDirective)

◆ hashUsingParent()

const QString CppImport::NodeHasher::hashUsingParent ( const clang::DeclContext *  context)

Member Data Documentation

◆ clang_

ClangHelpers& CppImport::NodeHasher::clang_
private