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

Sequence diagram participant representing a class. More...

Detailed Description

Sequence diagram participant representing a class.

Definition at line 79 of file participant.h.

#include <participant.h>

Public Member Functions

 class_ (const common::model::namespace_ &using_namespace)
 
 class_ (const class_ &)=delete
 
 class_ (class_ &&) noexcept=delete
 
class_operator= (const class_ &)=delete
 
class_operator= (class_ &&)=delete
 
std::string type_name () const override
 
bool is_struct () const
 Check if class is a struct.
 
void is_struct (bool is_struct)
 Set whether the class is a struct.
 
bool is_template () const
 Check if class is a template.
 
void is_template (bool is_template)
 Set whether the class is a template instantiation.
 
bool is_template_instantiation () const
 Check if class is a template instantiation.
 
void is_template_instantiation (bool is_template_instantiation)
 Set whether the class is a template instantiation.
 
std::string full_name (bool relative=true) const override
 
std::string full_name_no_ns () const override
 
bool is_abstract () const
 Check if class is a abstract.
 
bool is_alias () const
 Check if class is a typedef/using alias.
 
void is_alias (bool alias)
 Set whether the class is an alias.
 
bool is_lambda () const
 Check if the class is lambda.
 
void is_lambda (bool is_lambda)
 Set whether the class is a lambda.
 
void set_lambda_operator_id (eid_t id)
 
eid_t lambda_operator_id () const
 
- Public Member Functions inherited from clanguml::sequence_diagram::model::participant
 participant (const participant &)=delete
 
 participant (participant &&) noexcept=delete
 
participantoperator= (const participant &)=delete
 
participantoperator= (participant &&)=delete
 
std::string type_name () const override
 
virtual std::string to_string () const
 Create a string representation of the participant.
 
- 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
 
std::string full_name (bool relative) const override
 
virtual std::string full_name_no_ns () const
 
const namespace_using_namespace () const
 
inja::json context () const override
 
- Public Member Functions inherited from clanguml::common::model::diagram_element
 diagram_element ()
 
 ~diagram_element () override=default
 
const eid_tid () const
 Returns diagram element id.
 
void set_id (eid_t id)
 
std::optional< eid_tparent_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)
 
std::string name () const
 
virtual std::string type_name () const
 
virtual std::string full_name (bool) 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)
 
virtual inja::json context () const
 
bool is_nested () const
 
void nested (bool nested)
 
bool complete () const
 
void complete (bool completed)
 
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_tcomment () 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::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()
 
- Public Member Functions inherited from clanguml::common::model::stylable_element
void set_style (const std::string &style)
 
std::optional< std::string > style () const
 

Private Attributes

bool is_struct_ {false}
 
bool is_template_ {false}
 
bool is_template_instantiation_ {false}
 
bool is_alias_ {false}
 
bool is_lambda_ {false}
 
eid_t lambda_operator_id_ {}
 
std::string full_name_
 

Friends

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

Additional Inherited Members

- Public Types inherited from clanguml::sequence_diagram::model::participant
enum class  stereotype_t {
  participant = 0 , actor , boundary , control ,
  entity , database , collections , queue
}
 Enum representing stereotype of a participant. More...
 
- Public Attributes inherited from clanguml::sequence_diagram::model::participant
stereotype_t stereotype_ {stereotype_t::participant}
 

Constructor & Destructor Documentation

◆ class_() [1/3]

clanguml::sequence_diagram::model::class_::class_ ( const common::model::namespace_ using_namespace)

Definition at line 29 of file participant.cc.

◆ class_() [2/3]

clanguml::sequence_diagram::model::class_::class_ ( const class_ )
delete

◆ class_() [3/3]

clanguml::sequence_diagram::model::class_::class_ ( class_ &&  )
deletenoexcept

Member Function Documentation

◆ full_name()

std::string clanguml::sequence_diagram::model::class_::full_name ( bool  relative = true) const
overridevirtual

Return elements full name.

Returns
Fully qualified elements name.

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

Definition at line 65 of file participant.cc.

66{
67 using namespace clanguml::util;
69
70 std::ostringstream ostr;
71
72 if (relative)
73 ostr << name();
74 else
75 ostr << name_and_ns();
76 render_template_params(ostr, using_namespace(), relative);
77
78 std::string res;
79
80 if (relative)
81 res = using_namespace().relative(ostr.str());
82 else
83 res = ostr.str();
84
85 if (res.empty())
86 return "<<anonymous>>";
87
88 return res;
89}

◆ full_name_no_ns()

std::string clanguml::sequence_diagram::model::class_::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 52 of file participant.cc.

53{
54 using namespace clanguml::util;
55
56 std::ostringstream ostr;
57
58 ostr << name();
59
61
62 return ostr.str();
63}

◆ is_abstract()

bool clanguml::sequence_diagram::model::class_::is_abstract ( ) const

Check if class is a abstract.

Returns
True, if the class is abstract.

◆ is_alias() [1/2]

bool clanguml::sequence_diagram::model::class_::is_alias ( ) const

Check if class is a typedef/using alias.

Returns
True, if the class is a typedef/using alias.

Definition at line 91 of file participant.cc.

91{ return is_alias_; }

◆ is_alias() [2/2]

void clanguml::sequence_diagram::model::class_::is_alias ( bool  alias)

Set whether the class is an alias.

Parameters
aliasTrue if the class is a typedef/using alias.

Definition at line 93 of file participant.cc.

93{ is_alias_ = alias; }

◆ is_lambda() [1/2]

bool clanguml::sequence_diagram::model::class_::is_lambda ( ) const

Check if the class is lambda.

Returns

Definition at line 95 of file participant.cc.

95{ return is_lambda_; }

◆ is_lambda() [2/2]

void clanguml::sequence_diagram::model::class_::is_lambda ( bool  is_lambda)

Set whether the class is a lambda.

Parameters
is_lambdaTrue, if the class is a lambda

Definition at line 97 of file participant.cc.

◆ is_struct() [1/2]

bool clanguml::sequence_diagram::model::class_::is_struct ( ) const

Check if class is a struct.

Returns
True, if the class is declared as struct.

Definition at line 34 of file participant.cc.

34{ return is_struct_; }

◆ is_struct() [2/2]

void clanguml::sequence_diagram::model::class_::is_struct ( bool  is_struct)

Set whether the class is a struct.

Parameters
is_structTrue, if the class is declared as struct

Definition at line 36 of file participant.cc.

◆ is_template() [1/2]

bool clanguml::sequence_diagram::model::class_::is_template ( ) const

Check if class is a template.

Returns
True, if the class is a template.

Definition at line 38 of file participant.cc.

38{ return is_template_; }

◆ is_template() [2/2]

void clanguml::sequence_diagram::model::class_::is_template ( bool  is_template)

Set whether the class is a template instantiation.

Parameters
is_templateTrue, if the class is a template

Definition at line 40 of file participant.cc.

◆ is_template_instantiation() [1/2]

bool clanguml::sequence_diagram::model::class_::is_template_instantiation ( ) const

Check if class is a template instantiation.

Returns
True, if the class is a template instantiation.

Definition at line 42 of file participant.cc.

43{
45}

◆ is_template_instantiation() [2/2]

void clanguml::sequence_diagram::model::class_::is_template_instantiation ( bool  is_template_instantiation)

Set whether the class is a template instantiation.

Parameters
is_template_instantiationTrue, if the class is a template instantiation.

Definition at line 47 of file participant.cc.

◆ lambda_operator_id()

eid_t clanguml::sequence_diagram::model::class_::lambda_operator_id ( ) const
inline

Definition at line 196 of file participant.h.

196{ return lambda_operator_id_; }

◆ operator=() [1/2]

class_ & clanguml::sequence_diagram::model::class_::operator= ( class_ &&  )
delete

◆ operator=() [2/2]

class_ & clanguml::sequence_diagram::model::class_::operator= ( const class_ )
delete

◆ set_lambda_operator_id()

void clanguml::sequence_diagram::model::class_::set_lambda_operator_id ( eid_t  id)
inline

Definition at line 194 of file participant.h.

◆ type_name()

std::string clanguml::sequence_diagram::model::class_::type_name ( ) const
inlineoverridevirtual

Get the type name of the diagram element.

Returns
Type name of the diagram element.

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

Definition at line 93 of file participant.h.

94 {
95 if (is_lambda())
96 return "lambda";
97
98 return "class";
99 }

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const class_ l,
const class_ r 
)
friend

Definition at line 99 of file participant.cc.

99{ return l.id() == r.id(); }

Member Data Documentation

◆ full_name_

std::string clanguml::sequence_diagram::model::class_::full_name_
private

Definition at line 206 of file participant.h.

◆ is_alias_

bool clanguml::sequence_diagram::model::class_::is_alias_ {false}
private

Definition at line 202 of file participant.h.

◆ is_lambda_

bool clanguml::sequence_diagram::model::class_::is_lambda_ {false}
private

Definition at line 203 of file participant.h.

◆ is_struct_

bool clanguml::sequence_diagram::model::class_::is_struct_ {false}
private

Definition at line 199 of file participant.h.

◆ is_template_

bool clanguml::sequence_diagram::model::class_::is_template_ {false}
private

Definition at line 200 of file participant.h.

◆ is_template_instantiation_

bool clanguml::sequence_diagram::model::class_::is_template_instantiation_ {false}
private

Definition at line 201 of file participant.h.

◆ lambda_operator_id_

eid_t clanguml::sequence_diagram::model::class_::lambda_operator_id_ {}
private

Definition at line 204 of file participant.h.


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