0.6.0
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Functions
Forward template for convertions to ID from various entities

Detailed Description

These methods provide the main mechanism for generating globally unique identifiers for all elements in the diagrams. The identifiers must be unique between different translation units in order for element relationships to be properly rendered in diagrams.

Functions

template<typename T >
eid_t clanguml::common::to_id (const T &declaration)
 
template<>
eid_t clanguml::common::to_id (const std::string &full_name)
 
eid_t clanguml::common::to_id (const clang::QualType &type, const clang::ASTContext &ctx)
 
template<>
eid_t clanguml::common::to_id (const clang::NamespaceDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::CXXRecordDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::RecordDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::ObjCCategoryDecl &type)
 
template<>
eid_t clanguml::common::to_id (const clang::ObjCInterfaceDecl &type)
 
template<>
eid_t clanguml::common::to_id (const clang::ObjCProtocolDecl &type)
 
template<>
eid_t clanguml::common::to_id (const clang::EnumDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::TagDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::EnumType &type)
 
template<>
eid_t clanguml::common::to_id (const clang::TemplateSpecializationType &type)
 
template<>
eid_t clanguml::common::to_id (const std::filesystem::path &type)
 

Function Documentation

◆ to_id() [1/14]

template<>
eid_t clanguml::common::to_id ( const clang::CXXRecordDecl &  declaration)

Definition at line 506 of file clang_utils.cc.

507{
508 return to_id(get_qualified_name(declaration));
509}

◆ to_id() [2/14]

template<>
eid_t clanguml::common::to_id ( const clang::EnumDecl &  declaration)

Definition at line 496 of file clang_utils.cc.

497{
498 return to_id(get_qualified_name(declaration));
499}

◆ to_id() [3/14]

template<>
eid_t clanguml::common::to_id ( const clang::EnumType &  type)

Definition at line 511 of file clang_utils.cc.

512{
513 return to_id(*t.getDecl());
514}

◆ to_id() [4/14]

template<>
eid_t clanguml::common::to_id ( const clang::NamespaceDecl &  declaration)

Definition at line 471 of file clang_utils.cc.

472{
473 return to_id(get_qualified_name(declaration));
474}

◆ to_id() [5/14]

template<>
eid_t clanguml::common::to_id ( const clang::ObjCCategoryDecl &  type)

Definition at line 481 of file clang_utils.cc.

482{
483 return to_id(fmt::format("__objc__category__{}", type.getNameAsString()));
484}

◆ to_id() [6/14]

template<>
eid_t clanguml::common::to_id ( const clang::ObjCInterfaceDecl &  type)

Definition at line 486 of file clang_utils.cc.

487{
488 return to_id(fmt::format("__objc__interface__{}", type.getNameAsString()));
489}

◆ to_id() [7/14]

template<>
eid_t clanguml::common::to_id ( const clang::ObjCProtocolDecl &  type)

Definition at line 491 of file clang_utils.cc.

492{
493 return to_id(fmt::format("__objc__protocol__{}", type.getNameAsString()));
494}

◆ to_id() [8/14]

eid_t clanguml::common::to_id ( const clang::QualType &  type,
const clang::ASTContext &  ctx 
)

Definition at line 466 of file clang_utils.cc.

467{
468 return to_id(common::to_string(type, ctx));
469}

◆ to_id() [9/14]

template<>
eid_t clanguml::common::to_id ( const clang::RecordDecl &  declaration)

Definition at line 476 of file clang_utils.cc.

477{
478 return to_id(get_qualified_name(declaration));
479}

◆ to_id() [10/14]

template<>
eid_t clanguml::common::to_id ( const clang::TagDecl &  declaration)

Definition at line 501 of file clang_utils.cc.

502{
503 return to_id(get_qualified_name(declaration));
504}

◆ to_id() [11/14]

template<>
eid_t clanguml::common::to_id ( const clang::TemplateSpecializationType &  type)

◆ to_id() [12/14]

template<>
eid_t clanguml::common::to_id ( const std::filesystem::path &  type)

Definition at line 516 of file clang_utils.cc.

517{
518 return to_id(file.lexically_normal().string());
519}

◆ to_id() [13/14]

template<>
eid_t clanguml::common::to_id ( const std::string &  full_name)

Definition at line 460 of file clang_utils.cc.

461{
462 return static_cast<eid_t>(
463 static_cast<uint64_t>(std::hash<std::string>{}(full_name)));
464}

◆ to_id() [14/14]

template<typename T >
eid_t clanguml::common::to_id ( const T &  declaration)