\doxysection{Pin.\+hpp}
\hypertarget{Pin_8hpp_source}{}\label{Pin_8hpp_source}\index{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Pin.hpp@{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Pin.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ GYM\_PCB\_PIN\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ GYM\_PCB\_PIN\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}Py.hpp"{}}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ "{}Component.hpp"{}}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ "{}Color.hpp"{}}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classCloneEnv}{CloneEnv}};}
\DoxyCodeLine{00010\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classComponent}{Component}};}
\DoxyCodeLine{00011\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classConnection}{Connection}};}
\DoxyCodeLine{00012\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classNet}{Net}};}
\DoxyCodeLine{00013\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classPin}{Pin}};}
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00015\ \textcolor{keyword}{using\ }PinCompound\ =\ std::vector<Pin\ *>;}
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ \textcolor{keyword}{class\ }Pin\ :\ \textcolor{keyword}{public}\ Object}
\DoxyCodeLine{00018\ \{}
\DoxyCodeLine{00019\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00020\ \ \ \ \ Pin(\mbox{\hyperlink{classComponent}{Component}}\ *,\ \textcolor{keyword}{const}\ std::string\ \&name);}
\DoxyCodeLine{00021\ \ \ \ \ \string~Pin();}
\DoxyCodeLine{00022\ \ \ \ \ Object\ *clone(\mbox{\hyperlink{classCloneEnv}{CloneEnv}}\&)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00024\ \ \ \ \ \mbox{\hyperlink{classComponent}{Component}}\ *getParent()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ \ \ \ \ \textcolor{keywordtype}{bool}\ hasNet()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ !!mNet;\ \}}
\DoxyCodeLine{00027\ \ \ \ \ \mbox{\hyperlink{classNet}{Net}}\ *net()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mNet;\ \}}
\DoxyCodeLine{00028\ \ \ \ \ \textcolor{keywordtype}{bool}\ sameNetAs(\textcolor{keyword}{const}\ Pin\ \&T)\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mNet\ ==\ T.net();\ \}}
\DoxyCodeLine{00029\ \ \ \ \ \textcolor{keywordtype}{void}\ setNet(\mbox{\hyperlink{classNet}{Net}}\ *net);}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00035\ \ \ \ \ uint\ \mbox{\hyperlink{classPin_a48bbb1d21eeb24713ea42a46eed6074b}{getStartLayerFor}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classConnection}{Connection}}\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00040\ \ \ \ \ \textcolor{keyword}{const}\ PinCompound\ *\mbox{\hyperlink{classPin_a8572d814d6359da7f61860f1fa987660}{compound}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mCompound;\ \}}
\DoxyCodeLine{00041\ \ \ \ \ \textcolor{keywordtype}{bool}\ inCompound(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPin}{Pin}}\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keywordtype}{void}\ setCompound(\mbox{\hyperlink{classPin}{Pin}}\ *);}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ \ \ \ \ uint\ numConnections()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mConnections.size();\ \}}
\DoxyCodeLine{00045\ \ \ \ \ \textcolor{keywordtype}{void}\ addConnection(Connection\ *X)\ \{\ mConnections.insert(X);\ \}}
\DoxyCodeLine{00046\ \ \ \ \ \textcolor{keywordtype}{bool}\ removeConnection(Connection\ *X,\ \textcolor{keywordtype}{bool}\ retainNet);}
\DoxyCodeLine{00047\ \ \ \ \ \textcolor{keyword}{const}\ std::set<Connection\ *>\&\ connections()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mConnections;\ \}}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ \ \ \ \ Color\ colorLine()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00050\ \ \ \ \ Color\ colorFill()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ \ \ \ \ std::string\ str()\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00053\ \ \ \ \ PyObject\ *getPy(uint\ depth)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00056\ \ \ \ \ Net\ *mNet\{0\};}
\DoxyCodeLine{00057\ \ \ \ \ std::set<Connection\ *>\ mConnections;\ \textcolor{comment}{//\ Owned\ by\ the\ net!}}
\DoxyCodeLine{00058\ \ \ \ \ PinCompound\ *mCompound\{0\};}
\DoxyCodeLine{00059\ \};}
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Pin::inCompound(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPin}{Pin}}\ \&P)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00062\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00063\ \ \ \ \ \textcolor{keywordflow}{return}\ mCompound\ \&\&\ mCompound\ ==\ P.mCompound;}
\DoxyCodeLine{00064\ \}}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00066\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classColor}{Color}}\ Pin::colorLine()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00067\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{keywordflow}{return}\ Palette::PinLine[hasNet()\ ?\ 1\ :\ 0][minLayer()\ ?\ 1\ :\ 0];}
\DoxyCodeLine{00069\ \}}
\DoxyCodeLine{00070\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classColor}{Color}}\ Pin::colorFill()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00071\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00072\ \ \ \ \ \textcolor{keywordflow}{return}\ Palette::PinFill[hasNet()\ ?\ 1\ :\ 0][minLayer()\ ?\ 1\ :\ 0];}
\DoxyCodeLine{00073\ \}}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00075\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classComponent}{Component}}\ *Pin::getParent()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00076\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{dynamic\_cast<}Component\ *\textcolor{keyword}{>}(mParent);}
\DoxyCodeLine{00078\ \}}
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ GYM\_PCB\_PIN\_H}}

\end{DoxyCode}
