# Class with template parameter

AFAIK pgf-umlcd does not support classes with template parameter (std::vector<T> for instance).

Does anybody have a workaround allowing the drawing of such classe? Is there a simple PGF/Tikz trick to do so?

I would achieve something roughly equivalent to MetaUML rendering. See MetaUML documentation page 8/9, section 2.5 "Parametrized Classes (Templates)".

Thanks!

-
I have edited the question to take your comment into account: I would like something close to MetaUML template classes. –  Thomas Moulard Sep 10 '12 at 13:36

Here's a new style template parameter that adds a dashed box to the upper right corner of the diagram:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{pgf-umlcd}
\tikzset{
template parameter/.style={
append after command={
node [draw, densely dashed, umlcolor, font=\ttfamily]
at (\tikzlastnode.north east)
{#1}
}
}
}
\begin{document}
\begin{tikzpicture}
\begin{interface}[template parameter=std::vector<T>,text width=7cm]{TestInterface}{0,0}
\operation{Test}
\end{interface}
\end{tikzpicture}
\end{document}

-
This is almost what I want. Is there a way to replace std::vector<T> by the content of the parameter automatically? –  Thomas Moulard Sep 10 '12 at 14:11
@ThomasMoulard: Yes, sorry, I had accidentally left a static value in the code. The edited version of my answer uses the parameter value. –  Jake Sep 10 '12 at 14:13
Perfect, thanks! –  Thomas Moulard Sep 10 '12 at 14:15