Fixed return message generation in sequence diagrams
This commit is contained in:
@@ -69,6 +69,8 @@ void generator::generate_call(const message &m, std::ostream &ostr) const
|
|||||||
|
|
||||||
void generator::generate_return(const message &m, std::ostream &ostr) const
|
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")) {
|
if ((m.from != m.to) && (m.return_type != "void")) {
|
||||||
const auto from = ns_relative(m_config.using_namespace, m.from);
|
const auto from = ns_relative(m_config.using_namespace, m.from);
|
||||||
const auto to = ns_relative(m_config.using_namespace, m.to);
|
const auto to = ns_relative(m_config.using_namespace, m.to);
|
||||||
|
|||||||
@@ -100,12 +100,15 @@ void translation_unit_visitor::process_activities(const cppast::cpp_function &e)
|
|||||||
m.to_usr = type_safe::get(function_call.get_callee_method_id());
|
m.to_usr = type_safe::get(function_call.get_callee_method_id());
|
||||||
|
|
||||||
const auto &callee_method =
|
const auto &callee_method =
|
||||||
|
static_cast<const cppast::cpp_member_function &>(
|
||||||
ctx.entity_index()
|
ctx.entity_index()
|
||||||
.lookup_definition(function_call.get_callee_method_id())
|
.lookup_definition(function_call.get_callee_method_id())
|
||||||
.value();
|
.value());
|
||||||
|
|
||||||
m.message = callee_method.name();
|
m.message = callee_method.name();
|
||||||
|
|
||||||
|
m.return_type = cppast::to_string(callee_method.return_type());
|
||||||
|
|
||||||
if (ctx.diagram().sequences.find(m.from_usr) ==
|
if (ctx.diagram().sequences.find(m.from_usr) ==
|
||||||
ctx.diagram().sequences.end()) {
|
ctx.diagram().sequences.end()) {
|
||||||
activity a;
|
activity a;
|
||||||
|
|||||||
Reference in New Issue
Block a user