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

Class method model. More...

Detailed Description

Class method model.

Definition at line 32 of file class_method_base.h.

#include <class_method_base.h>

Public Member Functions

 class_method_base (common::model::access_t access, const std::string &name, const std::string &type)
 Constructor.
 
 ~class_method_base () override=default
 
std::string display_name () const
 Method name including template parameters/arguments if any.
 
void set_display_name (const std::string &display_name)
 
bool is_static () const
 Whether the method is static.
 
void is_static (bool is_static)
 Set whether the method is static.
 
const std::vector< method_parameter > & parameters () const
 Get the method parameters.
 
void add_parameter (method_parameter &&parameter)
 Add methods parameter.
 
- Public Member Functions inherited from clanguml::class_diagram::model::class_element
 class_element (common::model::access_t access, std::string name, std::string type)
 
 ~class_element () override=default
 
common::model::access_t access () const
 Get elements access scope.
 
std::string name () const
 Get elements name.
 
void set_name (const std::string &name)
 Set elements name.
 
std::string type () const
 Get elements type as string.
 
void set_type (const std::string &type)
 Set elements type as string.
 
void set_qualified_name (const std::string &qn)
 Set class elements qualified name.
 
std::string qualified_name () const
 get fully qualified name of the class element.
 
- 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)
 

Private Attributes

std::vector< method_parameterparameters_
 
bool is_static_ {false}
 
std::string display_name_
 

Constructor & Destructor Documentation

◆ class_method_base()

clanguml::class_diagram::model::class_method_base::class_method_base ( common::model::access_t  access,
const std::string &  name,
const std::string &  type 
)

Constructor.

Parameters
accessMethods access scope (e.g. public)
nameMethods name.
typeMethods return type as string.

Definition at line 22 of file class_method_base.cc.

25{
26}

◆ ~class_method_base()

clanguml::class_diagram::model::class_method_base::~class_method_base ( )
overridedefault

Member Function Documentation

◆ add_parameter()

void clanguml::class_diagram::model::class_method_base::add_parameter ( method_parameter &&  parameter)

Add methods parameter.

Parameters
parameterMethod parameter.

Definition at line 44 of file class_method_base.cc.

45{
46 parameters_.emplace_back(std::move(parameter));
47}

◆ display_name()

std::string clanguml::class_diagram::model::class_method_base::display_name ( ) const

Method name including template parameters/arguments if any.

Returns
String representation of the methods display name

Definition at line 28 of file class_method_base.cc.

28{ return display_name_; }

◆ is_static() [1/2]

bool clanguml::class_diagram::model::class_method_base::is_static ( ) const

Whether the method is static.

Returns
True, if the method is static

Definition at line 35 of file class_method_base.cc.

35{ return is_static_; }

◆ is_static() [2/2]

void clanguml::class_diagram::model::class_method_base::is_static ( bool  is_static)

Set whether the method is static.

Parameters
is_staticTrue, if the method is static

Definition at line 37 of file class_method_base.cc.

◆ parameters()

const std::vector< method_parameter > & clanguml::class_diagram::model::class_method_base::parameters ( ) const

Get the method parameters.

Returns
List of methods parameters

Definition at line 39 of file class_method_base.cc.

40{
41 return parameters_;
42}

◆ set_display_name()

void clanguml::class_diagram::model::class_method_base::set_display_name ( const std::string &  display_name)

Definition at line 30 of file class_method_base.cc.

31{
33}

Member Data Documentation

◆ display_name_

std::string clanguml::class_diagram::model::class_method_base::display_name_
private

Definition at line 87 of file class_method_base.h.

◆ is_static_

bool clanguml::class_diagram::model::class_method_base::is_static_ {false}
private

Definition at line 86 of file class_method_base.h.

◆ parameters_

std::vector<method_parameter> clanguml::class_diagram::model::class_method_base::parameters_
private

Definition at line 84 of file class_method_base.h.


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