Tark_Wight

Sturct and aliases in UML

Jan 7th, 2026
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | Source Code | 0 0
  1. @startuml
  2.  
  3. skinparam shadowing false
  4. skinparam class {
  5. BackgroundColor White
  6. BorderColor Black
  7. ArrowColor Black
  8. }
  9.  
  10. ' Template class Id
  11. class "Id<Tag, Rep = std::uint32_t>" as Id <<template>> {
  12. + value() : Rep const
  13. }
  14.  
  15. ' Empty tag marker
  16. class AxisIdTag <<struct>> {
  17. }
  18.  
  19. ' alias AxisId
  20. class AxisId <<alias>>
  21.  
  22. ' Template binding: AxisId = Id<AxisIdTag, std::uint8_t>
  23. AxisId -down-> Id : <<bind>>\nTag -> AxisIdTag,\nRep -> uint8_t
  24.  
  25. ' The tag is only used as a template parameter (optional, for clarity).
  26. AxisIdTag -up- Id : <<bind>>
  27.  
  28. note right of AxisId
  29. using AxisId = Id<AxisIdTag, std::uint8_t>;
  30. end note
  31.  
  32. @enduml
Tags: plant_uml
Advertisement
Add Comment
Please, Sign In to add comment