0

I am dealing with C++ code that I want to model it as component diagram (UML2.0). So, a main step is to realize which parameters are input & output signals.

One problem with that is: Not every parameter has to be an input/output signal, because it can be passed from or read by an external function in other module. An example for such a case is:

/* @parameter[in,out] p1
@parameter[in] var1 */
ret_1 function_name_1 (CParameter& p1, uint16 var1)
{
// Modify p1
// use var1
}

void function_name_2 (int speed, int count)
{}

Further, I would like to know how can I represent both the port & required/provided interface? i.e. Should every function with input or output be a port? Either ways, what if the function has multiple inputs or outputs?

Or should these functions be a lollipop notation (provided/required)? In that case, which element should be the port name?

  • 1
    Why are you trying to draw component diagrams of a function? These diagrams are usually applied on a much higher level (libraries or services), if they are used at all. – amon Mar 4 at 22:47
  • it is a component diagram for a whole module (module.cpp, module.hpp). The source code has many functioncs that are more or less as same as the given pseudo code. – sam Mar 4 at 22:54
  • 1
    Take a look at sites that documet C++ API's. I'd take a look at en.cppreference.com and boost for a decent cross section of robust documentation styles. – Kain0_0 Mar 4 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.