Universal class for representing all kinds of Id's in the diagram model. More...
Universal class for representing all kinds of Id's in the diagram model.
This class provides a convenient way of representing id's in the diagram model. The main problem it solves is that it allows to store both Clang AST ID's (obtained using getID() method), which are local to a single translation unit and have a type int64_t as well as global (across multiple translation units) id's used by clang-uml in the intermediate model (which are uint64_t).
The class is aware which kind of value it holds and tries to ensure that mistakes such as using AST local ID in place where global id is needed do not happen.
#include <types.h>
Public Types | |
using | type = uint64_t |
Public Member Functions | |
eid_t () | |
eid_t (int64_t id) | |
eid_t (type id) | |
eid_t (const eid_t &)=default | |
eid_t (eid_t &&) noexcept=default | |
eid_t & | operator= (const eid_t &)=default |
eid_t & | operator= (eid_t &&) noexcept=default |
eid_t & | operator= (int64_t ast_id) |
~eid_t ()=default | |
bool | is_global () const |
type | value () const |
int64_t | ast_local_value () const |
Private Attributes | |
type | value_ |
bool | is_global_ |
Friends | |
bool | operator== (const eid_t &lhs, const eid_t &rhs) |
bool | operator== (const eid_t &lhs, const uint64_t &v) |
bool | operator!= (const eid_t &lhs, const uint64_t &v) |
bool | operator!= (const eid_t &lhs, const eid_t &rhs) |
bool | operator< (const eid_t &lhs, const eid_t &rhs) |
using clanguml::common::eid_t::type = uint64_t |
clanguml::common::eid_t::eid_t | ( | ) |
|
explicit |
|
explicit |
|
default |
|
defaultnoexcept |
|
default |
int64_t clanguml::common::eid_t::ast_local_value | ( | ) | const |
eid_t & clanguml::common::eid_t::operator= | ( | int64_t | ast_id | ) |
Definition at line 41 of file types.cc.
eid_t::type clanguml::common::eid_t::value | ( | ) | const |
|
friend |
|
friend |