0.5.4
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::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/11]

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

Definition at line 449 of file clang_utils.cc.

450{
451 return to_id(get_qualified_name(declaration));
452}

◆ to_id() [2/11]

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

Definition at line 439 of file clang_utils.cc.

440{
441 return to_id(get_qualified_name(declaration));
442}

◆ to_id() [3/11]

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

Definition at line 454 of file clang_utils.cc.

455{
456 return to_id(*t.getDecl());
457}

◆ to_id() [4/11]

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

Definition at line 429 of file clang_utils.cc.

430{
431 return to_id(get_qualified_name(declaration));
432}

◆ to_id() [5/11]

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

Definition at line 424 of file clang_utils.cc.

425{
426 return to_id(common::to_string(type, ctx));
427}

◆ to_id() [6/11]

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

Definition at line 434 of file clang_utils.cc.

435{
436 return to_id(get_qualified_name(declaration));
437}

◆ to_id() [7/11]

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

Definition at line 444 of file clang_utils.cc.

445{
446 return to_id(get_qualified_name(declaration));
447}

◆ to_id() [8/11]

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

◆ to_id() [9/11]

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

Definition at line 459 of file clang_utils.cc.

460{
461 return to_id(file.lexically_normal().string());
462}

◆ to_id() [10/11]

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

Definition at line 418 of file clang_utils.cc.

419{
420 return static_cast<eid_t>(
421 static_cast<uint64_t>(std::hash<std::string>{}(full_name)));
422}

◆ to_id() [11/11]

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