Narnia_Optimus
Narnia_Optimus

Reputation: 448

How to model this C++ code using UML class diagram or SysML bdd?

namespace collections {
  class Iterable : public Sized<T> 
  {}
}

class Item_id {}

class Item_info {}

class Connected_items : public collections::Iterable<std::map<Item_id, Item_info>>
{}

First, I like to see how this can be modeled as exact as possible.

Second, it would be nice to see how this can be simplified so the model is not cluttered with unnecessary details.

This is part of a large model. So having both inputs would be valuable.

Upvotes: 2

Views: 505

Answers (1)

Marnix
Marnix

Reputation: 6547

I would most likely go for something along these lines. It's written in mermaid, but PlantUML won't be much different. I couldn't get the <> working on the line of T=map<Item_Id, Item_Info>.

classDiagram

    class Item_Info
    class Item_Id
    class Connected_Items

    class Iterable~T~

    class Sized~T~

    Sized~T~ <|-- Iterable~T~
    Iterable~T~ <|-- Connected_Items : T=map{Item_Id, Item_Info}

    Connected_Items ..> Item_Info
    Connected_Items ..> Item_Id

Image of the output

And some other packages also support to put the T in the top right corner

enter image description here

Upvotes: 1

Related Questions