Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 709

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::Map\-Table Class Reference}
\label{classost_1_1_map_table}\index{ost::MapTable@{ost::MapTable}}
A map table allows for entities to be mapped (hash index) onto it.Table to hold hash indexed objects.  


{\tt \#include $<$object.h$>$}

Inheritance diagram for ost::Map\-Table::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classost_1_1_map_table}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Map\-Table} (unsigned size)
\begin{CompactList}\small\item\em Create a map table with a specified number of slots. \item\end{CompactList}\item 
virtual {\bf $\sim$Map\-Table} ()
\begin{CompactList}\small\item\em Destroy the table, calls cleanup. \item\end{CompactList}\item 
virtual unsigned {\bf get\-Index} (const char $\ast$id)
\begin{CompactList}\small\item\em Get index value from id string. \item\end{CompactList}\item 
unsigned {\bf get\-Range} (void)
\begin{CompactList}\small\item\em Return range of this table. \item\end{CompactList}\item 
void $\ast$ {\bf get\-Object} (const char $\ast$id)
\begin{CompactList}\small\item\em Lookup an object by id key. \item\end{CompactList}\item 
void {\bf add\-Object} ({\bf Map\-Object} \&obj)
\begin{CompactList}\small\item\em Map an object to our table. \item\end{CompactList}\item 
void $\ast$ {\bf get\-Free} (void)
\begin{CompactList}\small\item\em Get next object from managed free list. \item\end{CompactList}\item 
void {\bf add\-Free} ({\bf Map\-Object} $\ast$obj)
\begin{CompactList}\small\item\em Add an object to the managed free list. \item\end{CompactList}\item 
{\bf Map\-Table} \& {\bf operator+=} ({\bf Map\-Object} \&obj)
\begin{CompactList}\small\item\em An operator to map an object to the table. \item\end{CompactList}\item 
virtual {\bf Map\-Table} \& {\bf operator-=} ({\bf Map\-Object} \&obj)
\begin{CompactList}\small\item\em This operator is virtual in case it must also add the object to a managed free list. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf cleanup} (void)
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
unsigned {\bf range}
\item 
{\bf Map\-Object} $\ast$$\ast$ {\bf map}
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Map\-Object}
\end{CompactItemize}


\subsection{Detailed Description}
A map table allows for entities to be mapped (hash index) onto it.Table to hold hash indexed objects. 

Unlike with {\bf Assoc}{\rm (p.\,\pageref{classost_1_1_assoc})}, This form of map table also allows objects to be removed from the table. This table also includes a mutex lock for thread safety. A free list is also optionally maintained for reusable maps.

\begin{Desc}
\item[Author:]David Sugar $<${\tt dyfet@gnutelephony.org}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::MapTable@{ost::Map\-Table}!MapTable@{MapTable}}
\index{MapTable@{MapTable}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Map\-Table::Map\-Table (unsigned {\em size})}\label{classost_1_1_map_table_5cb1baf9cbdcb47b429a07215d6f2131}


Create a map table with a specified number of slots. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em number}]of slots. \end{description}
\end{Desc}
\index{ost::MapTable@{ost::Map\-Table}!~MapTable@{$\sim$MapTable}}
\index{~MapTable@{$\sim$MapTable}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ost::Map\-Table::$\sim$Map\-Table ()\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_map_table_41b85b01b85eb7a6471b79685705fa29}


Destroy the table, calls cleanup. 



\subsection{Member Function Documentation}
\index{ost::MapTable@{ost::Map\-Table}!addFree@{addFree}}
\index{addFree@{addFree}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Map\-Table::add\-Free ({\bf Map\-Object} $\ast$ {\em obj})}\label{classost_1_1_map_table_e025e47a6545e0a2c5192de300924764}


Add an object to the managed free list. 

Some Map\-Object's may override delete operator to detach and do this.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em object}]to add. \end{description}
\end{Desc}
\index{ost::MapTable@{ost::Map\-Table}!addObject@{addObject}}
\index{addObject@{addObject}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Map\-Table::add\-Object ({\bf Map\-Object} \& {\em obj})}\label{classost_1_1_map_table_2ae4402514b29270220847071d2a40a6}


Map an object to our table. 

If it is in another table already, it is removed there first.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em object}]to map. \end{description}
\end{Desc}
\index{ost::MapTable@{ost::Map\-Table}!cleanup@{cleanup}}
\index{cleanup@{cleanup}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Map\-Table::cleanup (void)\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_map_table_4603e784aa64184f4590b1b33eea6c60}


\index{ost::MapTable@{ost::Map\-Table}!getFree@{getFree}}
\index{getFree@{getFree}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ ost::Map\-Table::get\-Free (void)}\label{classost_1_1_map_table_f2e352093e48831f567e3b0b91f4d9bb}


Get next object from managed free list. 

This returns as a void so it can be recast into the actual type being used in derived Map\-Object's. A derived version of {\bf Map\-Table}{\rm (p.\,\pageref{classost_1_1_map_table})} may well offer an explicit type version of this. Some derived Map\-Object's may override new to use managed list.

\begin{Desc}
\item[Returns:]next object on free list. \end{Desc}
\index{ost::MapTable@{ost::Map\-Table}!getIndex@{getIndex}}
\index{getIndex@{getIndex}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual unsigned ost::Map\-Table::get\-Index (const char $\ast$ {\em id})\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_map_table_07c9740944b2fd846fa23585b75e3d9d}


Get index value from id string. 

This function can be changed as needed to provide better collision avoidence for specific tables.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em id}]string \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]index slot in table. \end{Desc}
\index{ost::MapTable@{ost::Map\-Table}!getObject@{getObject}}
\index{getObject@{getObject}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ ost::Map\-Table::get\-Object (const char $\ast$ {\em id})}\label{classost_1_1_map_table_1bdbde637f2fb0480b1ceb8ead4bccdb}


Lookup an object by id key. 

It is returned as void $\ast$ for easy re-cast.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]to find. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]pointer to found object or NULL. \end{Desc}
\index{ost::MapTable@{ost::Map\-Table}!getRange@{getRange}}
\index{getRange@{getRange}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned ost::Map\-Table::get\-Range (void)\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_map_table_a8b1c538691c04ebe20bcbd37f93df6d}


Return range of this table. 

\begin{Desc}
\item[Returns:]table range. \end{Desc}
\index{ost::MapTable@{ost::Map\-Table}!operator+=@{operator+=}}
\index{operator+=@{operator+=}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Map\-Table}\& ost::Map\-Table::operator+= ({\bf Map\-Object} \& {\em obj})}\label{classost_1_1_map_table_5cade237b6cbe186b00ad50f6561443d}


An operator to map an object to the table. 

\begin{Desc}
\item[Returns:]table being used. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em object}]being mapped. \end{description}
\end{Desc}
\index{ost::MapTable@{ost::Map\-Table}!operator-=@{operator-=}}
\index{operator-=@{operator-=}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf Map\-Table}\& ost::Map\-Table::operator-= ({\bf Map\-Object} \& {\em obj})\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_map_table_e6e0b700fc9cb734df0c301bbc36ab7f}


This operator is virtual in case it must also add the object to a managed free list. 

\begin{Desc}
\item[Returns:]current table. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em object}]entity to remove. \end{description}
\end{Desc}


\subsection{Friends And Related Function Documentation}
\index{ost::MapTable@{ost::Map\-Table}!MapObject@{MapObject}}
\index{MapObject@{MapObject}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}friend class {\bf Map\-Object}\hspace{0.3cm}{\tt  [friend]}}\label{classost_1_1_map_table_d3a0f850a471fb5553eb77ee29b0af44}




\subsection{Member Data Documentation}
\index{ost::MapTable@{ost::Map\-Table}!map@{map}}
\index{map@{map}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Map\-Object}$\ast$$\ast$ {\bf ost::Map\-Table::map}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_map_table_a5ec0ac04b3d1b1d4e8af79f759bd87b}


\index{ost::MapTable@{ost::Map\-Table}!range@{range}}
\index{range@{range}!ost::MapTable@{ost::Map\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned {\bf ost::Map\-Table::range}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_map_table_e45620bcf37da41ab3089710e4dbfd32}




The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf object.h}\end{CompactItemize}