0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
clanguml::common::model::context Struct Reference

Detailed Description

This struct manages a single level of template deduced context, e.g. & or const*

Definition at line 61 of file template_parameter.h.

#include <template_parameter.h>

Public Member Functions

std::string to_string () const
 
bool operator== (const context &rhs) const
 
bool operator!= (const context &rhs) const
 

Public Attributes

bool is_const {false}
 
bool is_volatile {false}
 
bool is_ref_const {false}
 
bool is_ref_volatile {false}
 
rpqualifier pr {rpqualifier::kNone}
 

Member Function Documentation

◆ operator!=()

bool clanguml::common::model::context::operator!= ( const context rhs) const

Definition at line 59 of file template_parameter.cc.

59{ return !(rhs == *this); }

◆ operator==()

bool clanguml::common::model::context::operator== ( const context rhs) const

Definition at line 52 of file template_parameter.cc.

53{
54 return is_const == rhs.is_const && is_volatile == rhs.is_volatile &&
55 is_ref_const == rhs.is_ref_const &&
56 is_ref_volatile == rhs.is_ref_volatile && pr == rhs.pr;
57}

◆ to_string()

std::string clanguml::common::model::context::to_string ( ) const

Definition at line 27 of file template_parameter.cc.

28{
29 std::vector<std::string> cv_qualifiers;
30 if (is_const)
31 cv_qualifiers.emplace_back("const");
32 if (is_volatile)
33 cv_qualifiers.emplace_back("volatile");
34
35 auto res = fmt::format("{}", fmt::join(cv_qualifiers, " "));
36
38 res += "*";
40 res += "&";
42 res += "&&";
43
44 if (is_ref_const)
45 res += " const";
47 res += " volatile";
48
49 return res;
50}

Member Data Documentation

◆ is_const

bool clanguml::common::model::context::is_const {false}

Definition at line 62 of file template_parameter.h.

◆ is_ref_const

bool clanguml::common::model::context::is_ref_const {false}

Definition at line 64 of file template_parameter.h.

◆ is_ref_volatile

bool clanguml::common::model::context::is_ref_volatile {false}

Definition at line 65 of file template_parameter.h.

◆ is_volatile

bool clanguml::common::model::context::is_volatile {false}

Definition at line 63 of file template_parameter.h.

◆ pr

rpqualifier clanguml::common::model::context::pr {rpqualifier::kNone}

Definition at line 66 of file template_parameter.h.


The documentation for this struct was generated from the following files: