git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@40 331e1502-861f-0410-8da2-ba01fb791d7f
121 lines
5 KiB
TeX
121 lines
5 KiB
TeX
\section{eo\-Aged$<$ Object $>$ Class Template Reference}
|
|
\label{classeo_aged}\index{eoAged@{eoAged}}
|
|
eo\-Age is a template class that adds an age to an object.$\backslash$ Requisites for template instantiation are that the object must admit a default ctor and a copy ctor.
|
|
|
|
|
|
{\tt \#include $<$eo\-Aged.h$>$}
|
|
|
|
\subsection*{Public Member Functions}
|
|
\begin{CompactItemize}
|
|
\item
|
|
{\bf eo\-Aged} (const Object \&\_\-o)\label{classeo_aged_a0}
|
|
|
|
\begin{CompactList}\small\item\em Main ctor from an already built Object. \item\end{CompactList}\item
|
|
{\bf eo\-Aged} (const {\bf eo\-Aged} \&\_\-a)\label{classeo_aged_a1}
|
|
|
|
\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item
|
|
virtual {\bf $\sim$eo\-Aged} ()\label{classeo_aged_a2}
|
|
|
|
\begin{CompactList}\small\item\em Virtual dtor. They are needed in virtual class hierarchies. \item\end{CompactList}\item
|
|
unsigned long {\bf Age} () const \label{classeo_aged_a3}
|
|
|
|
\begin{CompactList}\small\item\em returns the age of the object \item\end{CompactList}\item
|
|
const {\bf eo\-Aged} \& {\bf operator++} ()\label{classeo_aged_a4}
|
|
|
|
\begin{CompactList}\small\item\em Increments age. \item\end{CompactList}\end{CompactItemize}
|
|
\begin{Indent}{\bf Methods from eo\-Object}\par
|
|
{\em read\-From and print\-On are directly inherited from eo1d }\begin{CompactItemize}
|
|
\item
|
|
virtual std::string {\bf class\-Name} () const
|
|
\begin{CompactList}\small\item\em Return the class id. \item\end{CompactList}\item
|
|
virtual void {\bf read\-From} (istream \&\_\-is)
|
|
\begin{CompactList}\small\item\em Read object. \item\end{CompactList}\item
|
|
virtual void {\bf print\-On} (ostream \&\_\-os) const
|
|
\begin{CompactList}\small\item\em Write object. \item\end{CompactList}\end{CompactItemize}
|
|
\end{Indent}
|
|
\subsection*{Private Member Functions}
|
|
\begin{CompactItemize}
|
|
\item
|
|
{\bf eo\-Aged} ()
|
|
\begin{CompactList}\small\item\em Default Constructor. \item\end{CompactList}\end{CompactItemize}
|
|
\subsection*{Private Attributes}
|
|
\begin{CompactItemize}
|
|
\item
|
|
unsigned long {\bf age}\label{classeo_aged_r0}
|
|
|
|
\end{CompactItemize}
|
|
|
|
|
|
\subsection{Detailed Description}
|
|
\subsubsection*{template$<$class Object$>$ class eo\-Aged$<$ Object $>$}
|
|
|
|
eo\-Age is a template class that adds an age to an object.$\backslash$ Requisites for template instantiation are that the object must admit a default ctor and a copy ctor.
|
|
|
|
The Object must be an {\bf eo\-Object}{\rm (p.\,\pageref{classeo_object})}, thus, it must have its methods: class\-Name, print\-On, read\-From. \begin{Desc}
|
|
\item[See also:]{\bf eo\-Object}{\rm (p.\,\pageref{classeo_object})} \end{Desc}
|
|
|
|
|
|
|
|
|
|
Definition at line 47 of file eo\-Aged.h.
|
|
|
|
\subsection{Constructor \& Destructor Documentation}
|
|
\index{eoAged@{eo\-Aged}!eoAged@{eoAged}}
|
|
\index{eoAged@{eoAged}!eoAged@{eo\-Aged}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class Object$>$ {\bf eo\-Aged}$<$ Object $>$::{\bf eo\-Aged} ()\hspace{0.3cm}{\tt [inline, private]}}\label{classeo_aged_d0}
|
|
|
|
|
|
Default Constructor.
|
|
|
|
$\backslash$ It180s private so that it is not used anywhere; the right way of using this object is to create an Object and passing it to an aged by means of the copy ctor; that way it180s turned into an Aged object
|
|
|
|
Definition at line 103 of file eo\-Aged.h.
|
|
|
|
\subsection{Member Function Documentation}
|
|
\index{eoAged@{eo\-Aged}!className@{className}}
|
|
\index{className@{className}!eoAged@{eo\-Aged}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class Object$>$ virtual std::string {\bf eo\-Aged}$<$ Object $>$::class\-Name () const\hspace{0.3cm}{\tt [inline, virtual]}}\label{classeo_aged_z9_0}
|
|
|
|
|
|
Return the class id.
|
|
|
|
This should be redefined in each class; but it's got code as an example of implementation. Only \char`\"{}leaf\char`\"{} classes can be non-virtual.
|
|
|
|
Definition at line 74 of file eo\-Aged.h.\index{eoAged@{eo\-Aged}!readFrom@{readFrom}}
|
|
\index{readFrom@{readFrom}!eoAged@{eo\-Aged}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class Object$>$ virtual void {\bf eo\-Aged}$<$ Object $>$::read\-From (istream \& {\em \_\-is})\hspace{0.3cm}{\tt [inline, virtual]}}\label{classeo_aged_z9_1}
|
|
|
|
|
|
Read object.
|
|
|
|
\begin{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\item[{\em \_\-is}]A istream. \end{description}
|
|
\end{Desc}
|
|
\begin{Desc}
|
|
\item[Exceptions:]
|
|
\begin{description}
|
|
\item[{\em runtime\_\-exception}]If a valid object can't be read. \end{description}
|
|
\end{Desc}
|
|
|
|
|
|
Definition at line 81 of file eo\-Aged.h.\index{eoAged@{eo\-Aged}!printOn@{printOn}}
|
|
\index{printOn@{printOn}!eoAged@{eo\-Aged}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class Object$>$ virtual void {\bf eo\-Aged}$<$ Object $>$::print\-On (ostream \& {\em \_\-os}) const\hspace{0.3cm}{\tt [inline, virtual]}}\label{classeo_aged_z9_2}
|
|
|
|
|
|
Write object.
|
|
|
|
It's called print\-On since it prints the object \_\-on\_\- a stream. \begin{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\item[{\em \_\-os}]A ostream. \end{description}
|
|
\end{Desc}
|
|
|
|
|
|
Definition at line 91 of file eo\-Aged.h.
|
|
|
|
The documentation for this class was generated from the following file:\begin{CompactItemize}
|
|
\item
|
|
eo\-Aged.h\end{CompactItemize}
|