\hypertarget{a11928}{}\section{Properties Class Reference}
\label{a11928}\index{Properties@{Properties}}


The properties storage class.  




{\ttfamily \#include $<$Type-\/\+Skeleton/\+Object\+Types/\+Skeleton/\+Properties.\+hh$>$}

Inheritance diagram for Properties\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{a11928}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{a11932}{Base\+Property}
\begin{DoxyCompactList}\small\item\em The base class for all property template instances. \end{DoxyCompactList}\item 
class \hyperlink{a11936}{PropertyT}
\begin{DoxyCompactList}\small\item\em A container storing a single property for all objects. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{Indent}\textbf{ Property management}\par
{\em Use these to edit the properties themself, not their values. }\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename T $>$ }\\bool \hyperlink{a11928_ac66c1630b251bf2bf98e1962712a6f65}{add\+\_\+property} (\hyperlink{a11924}{Property\+HandleT}$<$ T $>$ \&\+\_\+h\+Prop, std\+::string \+\_\+name)
\begin{DoxyCompactList}\small\item\em Adds a new property. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\bool \hyperlink{a11928_a49327757ccb8e28c8003b9f2aba9b05f}{get\+\_\+property} (\hyperlink{a11924}{Property\+HandleT}$<$ T $>$ \&\+\_\+h\+Prop, std\+::string \+\_\+name)
\begin{DoxyCompactList}\small\item\em Initiates the property handle. \end{DoxyCompactList}\item 
bool \hyperlink{a11928_afe7a29dc22dede045d96eca5cebbbb72}{has\+\_\+property} (std\+::string \+\_\+name)
\begin{DoxyCompactList}\small\item\em Returns true if a property with the given name exists. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\bool \hyperlink{a11928_a0d2dae25cc9924345c27ef4242eee978}{remove\+\_\+property} (\hyperlink{a11924}{Property\+HandleT}$<$ T $>$ \&\+\_\+h\+Prop)
\begin{DoxyCompactList}\small\item\em Deletes a property including all values. \end{DoxyCompactList}\item 
void \hyperlink{a11928_abfe11fac0280beea36b61215f103eb91}{clear\+\_\+properties} ()
\begin{DoxyCompactList}\small\item\em Deletes all properties, including their values. \end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}
\begin{Indent}\textbf{ Property access}\par
{\em Edit the properties values. }\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename T $>$ }\\T \& \hyperlink{a11928_a1b9a066c4ccb40daff2be7d51c93b03f}{property} (\hyperlink{a11924}{Property\+HandleT}$<$ T $>$ \&\+\_\+h\+Prop, int \+\_\+index)
\begin{DoxyCompactList}\small\item\em Direct access to the properties values. \end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}
\subsection*{Protected Member Functions}
\begin{Indent}\textbf{ Synchronization}\par
{\em Call these methods to keep the property indices in sync with the objects they are bound to. }\begin{DoxyCompactItemize}
\item 
void \hyperlink{a11928_a7935be4a2043bbf6021296e6788ffcea}{insert\+\_\+property\+\_\+at} (int \+\_\+index)
\begin{DoxyCompactList}\small\item\em Inserts a property for a new object at the given index. \end{DoxyCompactList}\item 
void \hyperlink{a11928_a06ec4b3013338b5afa4f981d291827e8}{remove\+\_\+property\+\_\+at} (int \+\_\+index)
\begin{DoxyCompactList}\small\item\em Removes a property for an object that is being deleted from the derived class. \end{DoxyCompactList}\item 
void \hyperlink{a11928_ac1dfe91cbea182b2c907a4acd365bd41}{clean\+\_\+properties} ()
\begin{DoxyCompactList}\small\item\em While preserving the properties themself, all values in the property are deleted. \end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a11928_a4f2921e64173202bf600c7ad859e0c34}\label{a11928_a4f2921e64173202bf600c7ad859e0c34}} 
std\+::map$<$ std\+::string, int $>$ \hyperlink{a11928_a4f2921e64173202bf600c7ad859e0c34}{property\+\_\+names\+\_\+}
\begin{DoxyCompactList}\small\item\em The property names, key holding the name, value the properties index in \hyperlink{a11928_a9b2379b39f447cbf345b4da2abb91a64}{Properties\+::properties\+\_\+}. \end{DoxyCompactList}\item 
std\+::vector$<$ \hyperlink{a11932}{Base\+Property} $\ast$ $>$ \hyperlink{a11928_a9b2379b39f447cbf345b4da2abb91a64}{properties\+\_\+}
\begin{DoxyCompactList}\small\item\em A vector holding the properties. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a11928_a4ba268c9290b266c1c4782924418deca}\label{a11928_a4ba268c9290b266c1c4782924418deca}} 
unsigned long \hyperlink{a11928_a4ba268c9290b266c1c4782924418deca}{size\+\_\+}
\begin{DoxyCompactList}\small\item\em The number of fields in each property, used when new properties have to be created. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The properties storage class. 

This class is equipped with all methods you need to access the properties. Derive your class from it, then call the \hyperlink{a11928_a7935be4a2043bbf6021296e6788ffcea}{Properties\+::insert\+\_\+property\+\_\+at} and \hyperlink{a11928_a06ec4b3013338b5afa4f981d291827e8}{Properties\+::remove\+\_\+property\+\_\+at} members, whenever the vector holding the objects this property class refers to changes. The properties are bound to objects by their integer based index. 

Definition at line 92 of file Properties.\+hh.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{a11928_ac66c1630b251bf2bf98e1962712a6f65}\label{a11928_ac66c1630b251bf2bf98e1962712a6f65}} 
\index{Properties@{Properties}!add\+\_\+property@{add\+\_\+property}}
\index{add\+\_\+property@{add\+\_\+property}!Properties@{Properties}}
\subsubsection{\texorpdfstring{add\+\_\+property()}{add\_property()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
bool Properties\+::add\+\_\+property (\begin{DoxyParamCaption}\item[{\hyperlink{a11924}{Property\+HandleT}$<$ T $>$ \&}]{\+\_\+h\+Prop,  }\item[{std\+::string}]{\+\_\+name }\end{DoxyParamCaption})}



Adds a new property. 

Give the property type as template parameter of the property handle. Assign a unique name to the property, to be able to access it later. The property is created an the property handle is updated. After this call it is directly ready for use. Returns false if a property with this name already exists. In that case the property handle will point to that property.


\begin{DoxyParams}{Parameters}
{\em \+\_\+h\+Prop} & A new unused property handle. When the method returns it will always point to a property. \\
\hline
{\em \+\_\+name} & The properties name, has to be unique. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if a new property was created, false if an existing is returned. 
\end{DoxyReturn}


Definition at line 66 of file Properties\+T\+\_\+impl.\+hh.

\mbox{\Hypertarget{a11928_ac1dfe91cbea182b2c907a4acd365bd41}\label{a11928_ac1dfe91cbea182b2c907a4acd365bd41}} 
\index{Properties@{Properties}!clean\+\_\+properties@{clean\+\_\+properties}}
\index{clean\+\_\+properties@{clean\+\_\+properties}!Properties@{Properties}}
\subsubsection{\texorpdfstring{clean\+\_\+properties()}{clean\_properties()}}
{\footnotesize\ttfamily void Properties\+::clean\+\_\+properties (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}



While preserving the properties themself, all values in the property are deleted. 

This method preserves the properties, the property handles remain valid. Call this method if all objects in the derived class are deleted, so there is no object left that has properties attached to it. Notice the difference to \hyperlink{a11928_abfe11fac0280beea36b61215f103eb91}{Properties\+::clear\+\_\+properties}. 

Definition at line 71 of file Properties.\+cc.

\mbox{\Hypertarget{a11928_abfe11fac0280beea36b61215f103eb91}\label{a11928_abfe11fac0280beea36b61215f103eb91}} 
\index{Properties@{Properties}!clear\+\_\+properties@{clear\+\_\+properties}}
\index{clear\+\_\+properties@{clear\+\_\+properties}!Properties@{Properties}}
\subsubsection{\texorpdfstring{clear\+\_\+properties()}{clear\_properties()}}
{\footnotesize\ttfamily void Properties\+::clear\+\_\+properties (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Deletes all properties, including their values. 

Notice the difference to \hyperlink{a11928_ac1dfe91cbea182b2c907a4acd365bd41}{Properties\+::clean\+\_\+properties}, which preserves the properties and only deletes the values inside them. 

Definition at line 85 of file Properties.\+cc.

\mbox{\Hypertarget{a11928_a49327757ccb8e28c8003b9f2aba9b05f}\label{a11928_a49327757ccb8e28c8003b9f2aba9b05f}} 
\index{Properties@{Properties}!get\+\_\+property@{get\+\_\+property}}
\index{get\+\_\+property@{get\+\_\+property}!Properties@{Properties}}
\subsubsection{\texorpdfstring{get\+\_\+property()}{get\_property()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
bool Properties\+::get\+\_\+property (\begin{DoxyParamCaption}\item[{\hyperlink{a11924}{Property\+HandleT}$<$ T $>$ \&}]{\+\_\+h\+Prop,  }\item[{std\+::string}]{\+\_\+name }\end{DoxyParamCaption})}



Initiates the property handle. 

If this call is successful and there is a property with the given name, the property handle will point to it. If not, this method returns false.


\begin{DoxyParams}{Parameters}
{\em \+\_\+h\+Prop} & A new, unused property handle \\
\hline
{\em \+\_\+name} & The properties name \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the property exists and \+\_\+h\+Prop is now valid, false otherwise 
\end{DoxyReturn}


Definition at line 107 of file Properties\+T\+\_\+impl.\+hh.

\mbox{\Hypertarget{a11928_afe7a29dc22dede045d96eca5cebbbb72}\label{a11928_afe7a29dc22dede045d96eca5cebbbb72}} 
\index{Properties@{Properties}!has\+\_\+property@{has\+\_\+property}}
\index{has\+\_\+property@{has\+\_\+property}!Properties@{Properties}}
\subsubsection{\texorpdfstring{has\+\_\+property()}{has\_property()}}
{\footnotesize\ttfamily bool Properties\+::has\+\_\+property (\begin{DoxyParamCaption}\item[{std\+::string}]{\+\_\+name }\end{DoxyParamCaption})}



Returns true if a property with the given name exists. 


\begin{DoxyParams}{Parameters}
{\em \+\_\+name} & The properties name \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the property exists, false otherwise 
\end{DoxyReturn}


Definition at line 137 of file Properties.\+cc.

\mbox{\Hypertarget{a11928_a7935be4a2043bbf6021296e6788ffcea}\label{a11928_a7935be4a2043bbf6021296e6788ffcea}} 
\index{Properties@{Properties}!insert\+\_\+property\+\_\+at@{insert\+\_\+property\+\_\+at}}
\index{insert\+\_\+property\+\_\+at@{insert\+\_\+property\+\_\+at}!Properties@{Properties}}
\subsubsection{\texorpdfstring{insert\+\_\+property\+\_\+at()}{insert\_property\_at()}}
{\footnotesize\ttfamily void Properties\+::insert\+\_\+property\+\_\+at (\begin{DoxyParamCaption}\item[{int}]{\+\_\+index }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}



Inserts a property for a new object at the given index. 

If the derived class inserts a new object at the given index, the properties have to insert a new property, to keep it in sync. This is done by calling this method. To append at the end simply give the size of the vector holding the objects as parameter.


\begin{DoxyParams}{Parameters}
{\em \+\_\+index} & Index of the new object, all the property indices for objects with index $>$= \+\_\+index are increased by one \\
\hline
\end{DoxyParams}


Definition at line 105 of file Properties.\+cc.

\mbox{\Hypertarget{a11928_a1b9a066c4ccb40daff2be7d51c93b03f}\label{a11928_a1b9a066c4ccb40daff2be7d51c93b03f}} 
\index{Properties@{Properties}!property@{property}}
\index{property@{property}!Properties@{Properties}}
\subsubsection{\texorpdfstring{property()}{property()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
T \& Properties\+::property (\begin{DoxyParamCaption}\item[{\hyperlink{a11924}{Property\+HandleT}$<$ T $>$ \&}]{\+\_\+h\+Prop,  }\item[{int}]{\+\_\+index }\end{DoxyParamCaption})}



Direct access to the properties values. 

Access the property by using the same index as you use for the corresponding object in the derived class. This method returns a reference to the type given by the property handle. Make sure you use the right template parameter, otherwise the result is undefined (most likely a zero-\/reference).


\begin{DoxyParams}{Parameters}
{\em \+\_\+h\+Prop} & A valid handle to a property \\
\hline
{\em \+\_\+index} & The index of the property, corresponds to the index of the object in the derived class this property refers to \\
\hline
\end{DoxyParams}


Definition at line 172 of file Properties\+T\+\_\+impl.\+hh.

\mbox{\Hypertarget{a11928_a0d2dae25cc9924345c27ef4242eee978}\label{a11928_a0d2dae25cc9924345c27ef4242eee978}} 
\index{Properties@{Properties}!remove\+\_\+property@{remove\+\_\+property}}
\index{remove\+\_\+property@{remove\+\_\+property}!Properties@{Properties}}
\subsubsection{\texorpdfstring{remove\+\_\+property()}{remove\_property()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
bool Properties\+::remove\+\_\+property (\begin{DoxyParamCaption}\item[{\hyperlink{a11924}{Property\+HandleT}$<$ T $>$ \&}]{\+\_\+h\+Prop }\end{DoxyParamCaption})}



Deletes a property including all values. 

Call this method to remove the property identified by the handle.


\begin{DoxyParams}{Parameters}
{\em \+\_\+h\+Prop} & A valid property handle pointing to a property \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the handle was valid and a property was deleted, false otherwise 
\end{DoxyReturn}


Definition at line 131 of file Properties\+T\+\_\+impl.\+hh.

\mbox{\Hypertarget{a11928_a06ec4b3013338b5afa4f981d291827e8}\label{a11928_a06ec4b3013338b5afa4f981d291827e8}} 
\index{Properties@{Properties}!remove\+\_\+property\+\_\+at@{remove\+\_\+property\+\_\+at}}
\index{remove\+\_\+property\+\_\+at@{remove\+\_\+property\+\_\+at}!Properties@{Properties}}
\subsubsection{\texorpdfstring{remove\+\_\+property\+\_\+at()}{remove\_property\_at()}}
{\footnotesize\ttfamily void Properties\+::remove\+\_\+property\+\_\+at (\begin{DoxyParamCaption}\item[{int}]{\+\_\+index }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}



Removes a property for an object that is being deleted from the derived class. 

The same as for \hyperlink{a11928_a7935be4a2043bbf6021296e6788ffcea}{Properties\+::insert\+\_\+property\+\_\+at}, just the other way around.


\begin{DoxyParams}{Parameters}
{\em \+\_\+index} & Index of the new object, all the property indices for objects with index $>$= \+\_\+index are decremented by one \\
\hline
\end{DoxyParams}


Definition at line 122 of file Properties.\+cc.



\subsection{Member Data Documentation}
\mbox{\Hypertarget{a11928_a9b2379b39f447cbf345b4da2abb91a64}\label{a11928_a9b2379b39f447cbf345b4da2abb91a64}} 
\index{Properties@{Properties}!properties\+\_\+@{properties\+\_\+}}
\index{properties\+\_\+@{properties\+\_\+}!Properties@{Properties}}
\subsubsection{\texorpdfstring{properties\+\_\+}{properties\_}}
{\footnotesize\ttfamily Properties\+::properties\+\_\+\hspace{0.3cm}{\ttfamily [protected]}}



A vector holding the properties. 

Access them using a property handle, that in turn is storing a index derived from \hyperlink{a11928_a4f2921e64173202bf600c7ad859e0c34}{Properties\+::property\+\_\+names\+\_\+}. If a property is deleted its position in the vector is deleted and set to zero. If a new property is added it will either take a place in the vector that is zero or append itself to the end. This way the property handles stay valid all the time. 

Definition at line 191 of file Properties.\+hh.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
Type-\/\+Skeleton/\+Object\+Types/\+Skeleton/\hyperlink{a05573}{Properties.\+hh}\item 
Type-\/\+Skeleton/\+Object\+Types/\+Skeleton/Properties.\+cc\item 
Type-\/\+Skeleton/\+Object\+Types/\+Skeleton/Properties\+T\+\_\+impl.\+hh\end{DoxyCompactItemize}
