Model of a method parameter.
More...
Model of a method parameter.
Definition at line 31 of file method_parameter.h.
#include <method_parameter.h>
◆ method_parameter() [1/2]
clanguml::class_diagram::model::method_parameter::method_parameter |
( |
| ) |
|
|
default |
◆ method_parameter() [2/2]
clanguml::class_diagram::model::method_parameter::method_parameter |
( |
std::string |
type, |
|
|
std::string |
name, |
|
|
std::string |
default_value = {} |
|
) |
| |
Constructor.
- Parameters
-
type | Type of the method parameter as string. |
name | Name of the method parameter. |
default_value | Default value of the parameter or empty. |
Definition at line 25 of file method_parameter.cc.
◆ ~method_parameter()
clanguml::class_diagram::model::method_parameter::~method_parameter |
( |
| ) |
|
|
overridedefault |
◆ default_value()
std::string clanguml::class_diagram::model::method_parameter::default_value |
( |
| ) |
const |
◆ name()
std::string clanguml::class_diagram::model::method_parameter::name |
( |
| ) |
const |
◆ set_default_value()
void clanguml::class_diagram::model::method_parameter::set_default_value |
( |
const std::string & |
value | ) |
|
Set parameters default value.
- Parameters
-
type | Parameters default value as string. |
Definition at line 41 of file method_parameter.cc.
◆ set_name()
void clanguml::class_diagram::model::method_parameter::set_name |
( |
const std::string & |
name | ) |
|
◆ set_type()
void clanguml::class_diagram::model::method_parameter::set_type |
( |
const std::string & |
type | ) |
|
Set parameters type.
- Parameters
-
type | Parameters type as string. |
Definition at line 33 of file method_parameter.cc.
◆ to_string()
std::string clanguml::class_diagram::model::method_parameter::to_string |
( |
const common::model::namespace_ & |
using_namespaces | ) |
const |
Render the method parameter to a string.
- Parameters
-
using_namespaces | If provided, make all namespaces relative to it. |
- Returns
- String representation of the parameter.
Definition at line 48 of file method_parameter.cc.
50{
52 auto type_ns =
54
55 auto name_ns =
57
59 if (name_ns.empty())
60 return type_ns;
61
62 return fmt::format("{} {}", type_ns, name_ns);
63 }
64
65 return fmt::format(
"{} {} = {}", type_ns, name_ns,
default_value());
66}
◆ type()
std::string clanguml::class_diagram::model::method_parameter::type |
( |
| ) |
const |
Get parameters type.
- Returns
- Parameters type as string.
Definition at line 35 of file method_parameter.cc.
◆ default_value_
std::string clanguml::class_diagram::model::method_parameter::default_value_ |
|
private |
◆ name_
std::string clanguml::class_diagram::model::method_parameter::name_ |
|
private |
◆ type_
std::string clanguml::class_diagram::model::method_parameter::type_ |
|
private |
The documentation for this class was generated from the following files: