0.6.3
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
clanguml::class_diagram::model::concept_ Class Reference

Model of C++ concept. More...

Detailed Description

Model of C++ concept.

Definition at line 35 of file concept.h.

#include <concept.h>

Public Member Functions

 concept_ (const common::model::namespace_ &using_namespace)
 
 concept_ (const concept_ &)=delete
 
 concept_ (concept_ &&) noexcept=default
 
concept_ & operator= (const concept_ &)=delete
 
concept_ & operator= (concept_ &&)=delete
 
std::string type_name () const override
 Get the elements type name.
 
std::string full_name_no_ns () const override
 
void add_parameter (const method_parameter &mp)
 Add concept parameter.
 
const std::vector< method_parameter > & requires_parameters () const
 Get concepts requires expression parameters.
 
void add_statement (std::string stmt)
 Add a concept statement.
 
const std::vector< std::string > & requires_statements () const
 Get the concepts requires statements.
 
- Public Member Functions inherited from clanguml::common::model::stylable_element
void set_style (const std::string &style)
 
std::optional< std::string > style () const
 
- Public Member Functions inherited from clanguml::common::model::template_element
 ~template_element () override=default
 
bool is_template () const
 
void is_template (bool is_template)
 
int calculate_template_specialization_match (const template_element &other) const
 Calculate template specialization match with other class.
 
bool template_specialization_found () const
 
void template_specialization_found (bool found)
 
 element (namespace_ using_namespace, path_type pt=path_type::kNamespace)
 
- Public Member Functions inherited from clanguml::common::model::element
 element (namespace_ using_namespace, path_type pt=path_type::kNamespace)
 
 ~element () override=default
 
std::string name_and_ns () const
 
void set_namespace (const namespace_ &ns)
 
namespace_ get_namespace () const
 
namespace_ get_relative_namespace () const
 
const namespace_ & path () const
 
void set_module (const std::string &module)
 
std::optional< std::string > module () const
 
void set_module_private (const bool module_private)
 
bool module_private () const
 
virtual std::string full_name_no_ns () const
 
const namespace_ & using_namespace () const
 
- Public Member Functions inherited from clanguml::common::model::diagram_element
 diagram_element ()
 
 ~diagram_element () override=default
 
const eid_t & id () const
 Returns diagram element id.
 
void set_id (eid_t id)
 
std::optional< eid_t > parent_element_id () const
 
void set_parent_element_id (eid_t id)
 
virtual std::string alias () const
 Return elements' diagram alias.
 
void set_name (const std::string &name)
 
void set_name (const std::string &parent, const std::string &name)
 
std::string name () const
 
virtual std::string type_name () const
 
std::string full_name (bool relative) const
 Return the elements fully qualified name.
 
std::vector< relationship > & relationships ()
 
const std::vector< relationship > & relationships () const
 
void add_relationship (relationship &&cr)
 
void append (const decorated_element &e)
 
bool is_nested () const
 
void nested (bool nested)
 
bool complete () const
 
void complete (bool completed)
 
void remove_duplicate_relationships ()
 
virtual void apply_filter (const diagram_filter &filter, const std::set< eid_t > &removed)
 
- Public Member Functions inherited from clanguml::common::model::decorated_element
virtual ~decorated_element ()=default
 
bool skip () const
 
bool skip_relationship () const
 
std::pair< relationship_t, std::string > get_relationship () const
 
std::string style_spec () const
 
const std::vector< std::shared_ptr< decorators::decorator > > & decorators () const
 
void add_decorators (const std::vector< std::shared_ptr< decorators::decorator > > &decorators)
 
void append (const decorated_element &de)
 
std::optional< comment_t > comment () const
 
void set_comment (const comment_t &c)
 
virtual std::optional< std::string > doxygen_link () const
 
- Public Member Functions inherited from clanguml::common::model::source_location
 source_location ()=default
 
 source_location (std::string f, unsigned int l)
 
const std::string & file () const
 
void set_file (const std::string &file)
 
const std::string & file_relative () const
 
void set_file_relative (const std::string &file)
 
const std::string & translation_unit () const
 
void set_translation_unit (const std::string &translation_unit)
 
unsigned int line () const
 
void set_line (const unsigned line)
 
unsigned int column () const
 
void set_column (const unsigned column)
 
unsigned int location_id () const
 
void set_location_id (unsigned int h)
 
- Public Member Functions inherited from clanguml::util::memoized< full_name_tag_t, std::string, bool >
auto memoize (bool is_complete, F &&f, Args... args) const
 
void invalidate (Args... args) const
 
- Public Member Functions inherited from clanguml::util::memoized< name_and_ns_tag, std::string >
auto memoize (bool is_complete, F &&f, Args... args) const
 
void invalidate (Args... args) const
 
- Public Member Functions inherited from clanguml::common::model::template_trait
std::ostream & render_template_params (std::ostream &ostr, const common::model::namespace_ &using_namespace, bool relative) const
 
void add_template (template_parameter &&tmplt)
 
const std::vector< template_parameter > & template_params () const
 
int calculate_template_specialization_match (const template_trait &other) const
 Wrapper around calculate_template_params_specialization_match()
 

Protected Member Functions

std::string full_name_impl (bool relative=true) const override
 
- Protected Member Functions inherited from clanguml::common::model::element
std::string full_name_impl (bool relative) const override
 
virtual std::string name_and_ns_impl () const
 
virtual std::string full_name_impl (bool) const
 

Private Attributes

std::vector< std::string > requires_expression_
 
std::vector< method_parameter > requires_parameters_
 
std::vector< std::string > requires_statements_
 

Friends

bool operator== (const concept_ &l, const concept_ &r)
 

Additional Inherited Members

- Public Types inherited from clanguml::util::memoized< full_name_tag_t, std::string, bool >
using key_t = std::tuple< Args... >
 
using value_t = std::string
 
- Public Types inherited from clanguml::util::memoized< name_and_ns_tag, std::string >
using key_t = std::tuple< Args... >
 
using value_t = std::string
 

Constructor & Destructor Documentation

◆ concept_() [1/3]

clanguml::class_diagram::model::concept_::concept_ ( const common::model::namespace_ &  using_namespace)

Definition at line 26 of file concept.cc.

27 : template_element{using_namespace}
28{
29}

◆ concept_() [2/3]

clanguml::class_diagram::model::concept_::concept_ ( const concept_ &  )
delete

◆ concept_() [3/3]

clanguml::class_diagram::model::concept_::concept_ ( concept_ &&  )
defaultnoexcept

Member Function Documentation

◆ add_parameter()

void clanguml::class_diagram::model::concept_::add_parameter ( const method_parameter &  mp)

Add concept parameter.

Concept class for convenience uses the same method parameter model as regular methods and functions.

Parameters
mpConcept parameter

Definition at line 73 of file concept.cc.

74{
75 requires_parameters_.emplace_back(mp);
76}

◆ add_statement()

void clanguml::class_diagram::model::concept_::add_statement ( std::string  stmt)

Add a concept statement.

Parameters
stmtConcept statement

Definition at line 83 of file concept.cc.

84{
85 requires_statements_.emplace_back(std::move(stmt));
86}

◆ full_name_impl()

std::string clanguml::class_diagram::model::concept_::full_name_impl ( bool  relative = true) const
overrideprotectedvirtual

Reimplemented from clanguml::common::model::diagram_element.

Definition at line 49 of file concept.cc.

50{
51 using namespace clanguml::util;
53
54 std::ostringstream ostr;
55
56 ostr << name_and_ns();
57
58 render_template_params(ostr, using_namespace(), relative);
59
60 std::string res;
61
62 if (relative)
63 res = using_namespace().relative(ostr.str());
64 else
65 res = ostr.str();
66
67 if (res.empty())
68 return "<<anonymous>>";
69
70 return res;
71}

◆ full_name_no_ns()

std::string clanguml::class_diagram::model::concept_::full_name_no_ns ( ) const
overridevirtual

Return elements full name but without namespace.

Returns
Elements full name without namespace.

Reimplemented from clanguml::common::model::element.

Definition at line 36 of file concept.cc.

37{
38 using namespace clanguml::util;
39
40 std::ostringstream ostr;
41
42 ostr << name();
43
45
46 return ostr.str();
47}

◆ operator=() [1/2]

concept_ & clanguml::class_diagram::model::concept_::operator= ( concept_ &&  )
delete

◆ operator=() [2/2]

concept_ & clanguml::class_diagram::model::concept_::operator= ( const concept_ &  )
delete

◆ requires_parameters()

const std::vector< method_parameter > & clanguml::class_diagram::model::concept_::requires_parameters ( ) const

Get concepts requires expression parameters.

Returns
List of concept requires expression parameters

Definition at line 78 of file concept.cc.

79{
81}

◆ requires_statements()

const std::vector< std::string > & clanguml::class_diagram::model::concept_::requires_statements ( ) const

Get the concepts requires statements.

Returns
List of concepts requires statements

Definition at line 88 of file concept.cc.

89{
91}

◆ type_name()

std::string clanguml::class_diagram::model::concept_::type_name ( ) const
inlineoverridevirtual

Get the elements type name.

Returns
'concept'

Reimplemented from clanguml::common::model::diagram_element.

Definition at line 50 of file concept.h.

50{ return "concept"; }

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const concept_ &  l,
const concept_ &  r 
)
friend

Definition at line 31 of file concept.cc.

32{
33 return l.id() == r.id();
34}

Member Data Documentation

◆ requires_expression_

std::vector<std::string> clanguml::class_diagram::model::concept_::requires_expression_
private

Definition at line 91 of file concept.h.

◆ requires_parameters_

std::vector<method_parameter> clanguml::class_diagram::model::concept_::requires_parameters_
private

Definition at line 93 of file concept.h.

◆ requires_statements_

std::vector<std::string> clanguml::class_diagram::model::concept_::requires_statements_
private

Definition at line 95 of file concept.h.


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