Added recursive template sequence diagram test case

This commit is contained in:
Bartek Kryza
2022-12-09 23:34:52 +01:00
parent fef88325ab
commit 757dd3eed9
8 changed files with 107 additions and 13 deletions

View File

@@ -90,10 +90,9 @@ void generator::generate_return(const message &m, std::ostream &ostr) const
{
// Add return activity only for messages between different actors and
// only if the return type is different than void
if ((m.from != m.to) && (m.return_type != "void")) {
const auto &from = m_model.get_participant<model::participant>(m.from);
const auto &to = m_model.get_participant<model::participant>(m.to);
const auto &from = m_model.get_participant<model::participant>(m.from);
const auto &to = m_model.get_participant<model::function>(m.to);
if ((m.from != m.to) && !to.value().is_void()) {
const std::string from_alias = generate_alias(from.value());
const std::string to_alias = generate_alias(to.value());

View File

@@ -209,6 +209,10 @@ bool function::is_void() const { return is_void_; }
void function::is_void(bool v) { is_void_ = v; }
bool function::is_static() const { return is_static_; }
void function::is_static(bool s) { is_static_ = s; }
void function::add_parameter(const std::string &a) { parameters_.push_back(a); }
const std::vector<std::string> &function::parameters() const
@@ -268,10 +272,6 @@ std::string method::to_string() const
type_name(), id(), full_name(false), class_id());
}
bool method::is_static() const { return is_static_; }
void method::is_static(bool s) { is_static_ = s; }
function_template::function_template(
const common::model::namespace_ &using_namespace)
: function{using_namespace}

View File

@@ -160,6 +160,10 @@ struct function : public participant {
void is_void(bool v);
bool is_static() const;
void is_static(bool s);
void add_parameter(const std::string &a);
const std::vector<std::string> &parameters() const;
@@ -167,6 +171,7 @@ struct function : public participant {
private:
bool is_const_{false};
bool is_void_{false};
bool is_static_{false};
std::vector<std::string> parameters_;
};
@@ -200,15 +205,10 @@ struct method : public function {
std::string to_string() const override;
bool is_static() const;
void is_static(bool s);
private:
diagram_element::id_t class_id_;
std::string method_name_;
std::string class_full_name_;
bool is_static_{false};
};
struct function_template : public function, public template_trait {