0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
clanguml::sequence_diagram::model Namespace Reference

Classes

class  activity
 Model of a sequence diagram activity. More...
 
struct  class_
 Sequence diagram participant representing a class. More...
 
class  diagram
 Model of a sequence diagram. More...
 
struct  function
 Participant mode representing a free function. More...
 
struct  function_template
 Participant model representing a function template. More...
 
class  message
 Model of a sequence diagram message. More...
 
struct  method
 Participant model representing a method. More...
 
struct  participant
 Base class for various types of sequence diagram participants. More...
 

Typedefs

using message_chain_t = std::vector< sequence_diagram::model::message >
 

Functions

void to_json (nlohmann::json &j, const participant &c)
 
void to_json (nlohmann::json &j, const activity &c)
 
bool operator== (const class_ &l, const class_ &r)
 

Typedef Documentation

◆ message_chain_t

Definition at line 31 of file diagram.h.

Function Documentation

◆ operator==()

bool clanguml::sequence_diagram::model::operator== ( const class_ l,
const class_ r 
)

Definition at line 99 of file participant.cc.

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

◆ to_json() [1/2]

void clanguml::sequence_diagram::model::to_json ( nlohmann::json &  j,
const activity c 
)

Definition at line 54 of file sequence_diagram_generator.cc.

55{
56 j["participant_id"] = std::to_string(c.from().value());
57}

◆ to_json() [2/2]

void clanguml::sequence_diagram::model::to_json ( nlohmann::json &  j,
const participant c 
)

Definition at line 34 of file sequence_diagram_generator.cc.

35{
36 to_json(j, dynamic_cast<const participant::element &>(c));
37 j["type"] = c.type_name();
38
39 if (c.type_name() == "method") {
40 j["name"] = dynamic_cast<const method &>(c).method_name();
41 }
42
43 j["full_name"] = generators::json::render_name(c.full_name(false));
44
45 if (c.type_name() == "function" || c.type_name() == "function_template") {
46 const auto &f = dynamic_cast<const function &>(c);
47 if (f.is_cuda_kernel())
48 j["is_cuda_kernel"] = true;
49 if (f.is_cuda_device())
50 j["is_cuda_device"] = true;
51 }
52}