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


The properties storage class.  




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

Inheritance diagram for Properties\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{a01027}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{a00335}{Base\+Property}
\begin{DoxyCompactList}\small\item\em The base class for all property template instances. \end{DoxyCompactList}\item 
class \hyperlink{a01041}{Property\+T}
\begin{DoxyCompactList}\small\item\em A container storing a single property for all objects. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{Indent}{\bf Property management}\par
{\em Use these to edit the properties themself, not their values. }\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename T $>$ }\\bool \hyperlink{a01027_ac66c1630b251bf2bf98e1962712a6f65}{add\+\_\+property} (\hyperlink{a01031}{Property\+Handle\+T}$<$ T $>$ \&\+\_\+h\+Prop, std\+::string \+\_\+name)
\begin{DoxyCompactList}\small\item\em Adds a new property. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\bool \hyperlink{a01027_a49327757ccb8e28c8003b9f2aba9b05f}{get\+\_\+property} (\hyperlink{a01031}{Property\+Handle\+T}$<$ T $>$ \&\+\_\+h\+Prop, std\+::string \+\_\+name)
\begin{DoxyCompactList}\small\item\em Initiates the property handle. \end{DoxyCompactList}\item 
bool \hyperlink{a01027_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{a01027_a0d2dae25cc9924345c27ef4242eee978}{remove\+\_\+property} (\hyperlink{a01031}{Property\+Handle\+T}$<$ T $>$ \&\+\_\+h\+Prop)
\begin{DoxyCompactList}\small\item\em Deletes a property including all values. \end{DoxyCompactList}\item 
void \hyperlink{a01027_abfe11fac0280beea36b61215f103eb91}{clear\+\_\+properties} ()
\begin{DoxyCompactList}\small\item\em Deletes all properties, including their values. \end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}
\begin{Indent}{\bf Property access}\par
{\em Edit the properties values. }\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename T $>$ }\\T \& \hyperlink{a01027_a1b9a066c4ccb40daff2be7d51c93b03f}{property} (\hyperlink{a01031}{Property\+Handle\+T}$<$ 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}{\bf 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{a01027_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{a01027_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{a01027_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 
\hypertarget{a01027_a4f2921e64173202bf600c7ad859e0c34}{std\+::map$<$ std\+::string, int $>$ \hyperlink{a01027_a4f2921e64173202bf600c7ad859e0c34}{property\+\_\+names\+\_\+}}\label{a01027_a4f2921e64173202bf600c7ad859e0c34}

\begin{DoxyCompactList}\small\item\em The property names, key holding the name, value the properties index in \hyperlink{a01027_a9b2379b39f447cbf345b4da2abb91a64}{Properties\+::properties\+\_\+}. \end{DoxyCompactList}\item 
std\+::vector$<$ \hyperlink{a00335}{Base\+Property} $\ast$ $>$ \hyperlink{a01027_a9b2379b39f447cbf345b4da2abb91a64}{properties\+\_\+}
\begin{DoxyCompactList}\small\item\em A vector holding the properties. \end{DoxyCompactList}\item 
\hypertarget{a01027_a4ba268c9290b266c1c4782924418deca}{unsigned long \hyperlink{a01027_a4ba268c9290b266c1c4782924418deca}{size\+\_\+}}\label{a01027_a4ba268c9290b266c1c4782924418deca}

\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{a01027_a7935be4a2043bbf6021296e6788ffcea}{Properties\+::insert\+\_\+property\+\_\+at} and \hyperlink{a01027_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 100 of file Properties.\+hh.



\subsection{Member Function Documentation}
\hypertarget{a01027_ac66c1630b251bf2bf98e1962712a6f65}{\index{Properties@{Properties}!add\+\_\+property@{add\+\_\+property}}
\index{add\+\_\+property@{add\+\_\+property}!Properties@{Properties}}
\subsubsection[{add\+\_\+property}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ bool Properties\+::add\+\_\+property (
\begin{DoxyParamCaption}
\item[{{\bf Property\+Handle\+T}$<$ T $>$ \&}]{\+\_\+h\+Prop, }
\item[{std\+::string}]{\+\_\+name}
\end{DoxyParamCaption}
)}}\label{a01027_ac66c1630b251bf2bf98e1962712a6f65}


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 72 of file Properties\+T.\+cc.

\hypertarget{a01027_ac1dfe91cbea182b2c907a4acd365bd41}{\index{Properties@{Properties}!clean\+\_\+properties@{clean\+\_\+properties}}
\index{clean\+\_\+properties@{clean\+\_\+properties}!Properties@{Properties}}
\subsubsection[{clean\+\_\+properties}]{\setlength{\rightskip}{0pt plus 5cm}void Properties\+::clean\+\_\+properties (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}}\label{a01027_ac1dfe91cbea182b2c907a4acd365bd41}


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{a01027_abfe11fac0280beea36b61215f103eb91}{Properties\+::clear\+\_\+properties}. 

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

\hypertarget{a01027_abfe11fac0280beea36b61215f103eb91}{\index{Properties@{Properties}!clear\+\_\+properties@{clear\+\_\+properties}}
\index{clear\+\_\+properties@{clear\+\_\+properties}!Properties@{Properties}}
\subsubsection[{clear\+\_\+properties}]{\setlength{\rightskip}{0pt plus 5cm}void Properties\+::clear\+\_\+properties (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{a01027_abfe11fac0280beea36b61215f103eb91}


Deletes all properties, including their values. 

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

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

\hypertarget{a01027_a49327757ccb8e28c8003b9f2aba9b05f}{\index{Properties@{Properties}!get\+\_\+property@{get\+\_\+property}}
\index{get\+\_\+property@{get\+\_\+property}!Properties@{Properties}}
\subsubsection[{get\+\_\+property}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ bool Properties\+::get\+\_\+property (
\begin{DoxyParamCaption}
\item[{{\bf Property\+Handle\+T}$<$ T $>$ \&}]{\+\_\+h\+Prop, }
\item[{std\+::string}]{\+\_\+name}
\end{DoxyParamCaption}
)}}\label{a01027_a49327757ccb8e28c8003b9f2aba9b05f}


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 113 of file Properties\+T.\+cc.

\hypertarget{a01027_afe7a29dc22dede045d96eca5cebbbb72}{\index{Properties@{Properties}!has\+\_\+property@{has\+\_\+property}}
\index{has\+\_\+property@{has\+\_\+property}!Properties@{Properties}}
\subsubsection[{has\+\_\+property}]{\setlength{\rightskip}{0pt plus 5cm}bool Properties\+::has\+\_\+property (
\begin{DoxyParamCaption}
\item[{std\+::string}]{\+\_\+name}
\end{DoxyParamCaption}
)}}\label{a01027_afe7a29dc22dede045d96eca5cebbbb72}


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 145 of file Properties.\+cc.

\hypertarget{a01027_a7935be4a2043bbf6021296e6788ffcea}{\index{Properties@{Properties}!insert\+\_\+property\+\_\+at@{insert\+\_\+property\+\_\+at}}
\index{insert\+\_\+property\+\_\+at@{insert\+\_\+property\+\_\+at}!Properties@{Properties}}
\subsubsection[{insert\+\_\+property\+\_\+at}]{\setlength{\rightskip}{0pt plus 5cm}void Properties\+::insert\+\_\+property\+\_\+at (
\begin{DoxyParamCaption}
\item[{int}]{\+\_\+index}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}}\label{a01027_a7935be4a2043bbf6021296e6788ffcea}


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 113 of file Properties.\+cc.

\hypertarget{a01027_a1b9a066c4ccb40daff2be7d51c93b03f}{\index{Properties@{Properties}!property@{property}}
\index{property@{property}!Properties@{Properties}}
\subsubsection[{property}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ T \& Properties\+::property (
\begin{DoxyParamCaption}
\item[{{\bf Property\+Handle\+T}$<$ T $>$ \&}]{\+\_\+h\+Prop, }
\item[{int}]{\+\_\+index}
\end{DoxyParamCaption}
)}}\label{a01027_a1b9a066c4ccb40daff2be7d51c93b03f}


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 178 of file Properties\+T.\+cc.

\hypertarget{a01027_a0d2dae25cc9924345c27ef4242eee978}{\index{Properties@{Properties}!remove\+\_\+property@{remove\+\_\+property}}
\index{remove\+\_\+property@{remove\+\_\+property}!Properties@{Properties}}
\subsubsection[{remove\+\_\+property}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ bool Properties\+::remove\+\_\+property (
\begin{DoxyParamCaption}
\item[{{\bf Property\+Handle\+T}$<$ T $>$ \&}]{\+\_\+h\+Prop}
\end{DoxyParamCaption}
)}}\label{a01027_a0d2dae25cc9924345c27ef4242eee978}


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 137 of file Properties\+T.\+cc.

\hypertarget{a01027_a06ec4b3013338b5afa4f981d291827e8}{\index{Properties@{Properties}!remove\+\_\+property\+\_\+at@{remove\+\_\+property\+\_\+at}}
\index{remove\+\_\+property\+\_\+at@{remove\+\_\+property\+\_\+at}!Properties@{Properties}}
\subsubsection[{remove\+\_\+property\+\_\+at}]{\setlength{\rightskip}{0pt plus 5cm}void Properties\+::remove\+\_\+property\+\_\+at (
\begin{DoxyParamCaption}
\item[{int}]{\+\_\+index}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}}\label{a01027_a06ec4b3013338b5afa4f981d291827e8}


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

The same as for \hyperlink{a01027_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 130 of file Properties.\+cc.



\subsection{Member Data Documentation}
\hypertarget{a01027_a9b2379b39f447cbf345b4da2abb91a64}{\index{Properties@{Properties}!properties\+\_\+@{properties\+\_\+}}
\index{properties\+\_\+@{properties\+\_\+}!Properties@{Properties}}
\subsubsection[{properties\+\_\+}]{\setlength{\rightskip}{0pt plus 5cm}Properties\+::properties\+\_\+\hspace{0.3cm}{\ttfamily [protected]}}}\label{a01027_a9b2379b39f447cbf345b4da2abb91a64}


A vector holding the properties. 

Access them using a property handle, that in turn is storing a index derived from \hyperlink{a01027_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 199 of file Properties.\+hh.



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