Changeset 1299 in Sophya for trunk/SophyaLib/Manual/sophya.tex


Ignore:
Timestamp:
Nov 8, 2000, 9:46:04 AM (25 years ago)
Author:
ansari
Message:

ecriture documentation sophya.tex - commit depuis mac Reza 8/11/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Manual/sophya.tex

    r1292 r1299  
    130130
    131131The file {\tt \$DPCBASEREP/Include/MakefileUser.h} defines the compilation
    132 flag and the list of Sophya libraries. It should be included in the
     132flags and the list of Sophya libraries. It should be included in the
    133133user's makefile. The default compilation rules assumes that the object (.o)
    134134and executable files would be put in the following diretories: \\
     
    145145{\tt trivial.cc }.
    146146\begin{verbatim}
    147 csh> cp $DPCBASEREP/Include/makefile_auto makefile
     147csh> cp \$DPCBASEREP/Include/makefile_auto makefile
    148148csh> make trivial
    149149\end{verbatim}
     
    157157example makefile.
    158158
     159Basic usage of Sophya classes are described in in the following sections.
     160Complete Sophya documentation can be found at our web site: \\
     161{\bf http://hfi-l2.in2p3.fr}.
     162
     163
     164\section{Module SysTools}
     165
     166{\bf SysTools} contains utility classes such as {\tt DataCards} or
     167{\tt DVlist}, an hierarchy of exception classes for Sophya, a template
     168class {\tcls{NDataBlock}} for handling reference counting on numerical
     169arrays, as well as classes providing the services for implementing simple
     170serialization.
     171\vspace*{5mm}
     172
     173\begin{figure}[hbt]
     174\dclsa{PPersist}
     175\dclsbb{PIOPersist}{PInPersist}
     176\dclsb{POutPersist}
     177\caption{partial class diagram for classes handling persistence in Sophya}
     178\end{figure}
     179
     180\subsection{Using DataCards}
     181The {\bf DataCards} class can be used to read parameters from a file.
     182Each line in the file starting with \@ defines a set of values
     183associated with a keyword. In the example below, we read the
     184parameters corresponding with the keyword {\tt SIZE} from the
     185file {\tt ex.d}. We suppose that {\tt ex.d} contains the line: \\
     186{\tt @SIZE 400 250} \\
     187\begin{verbatim}
     188#include "datacards.h"
     189// ...
     190// Initializing DataCards object dc from file ex.d
     191DataCards dc( "ex.d" );
     192// Getting the first and second parameters for keyword size
     193// We define a default value 100
     194int size_x = dc.IParam("SIZE", 0, 100);
     195int size_y = dc.IParam("SIZE", 1, 100);
     196cout << " size_x= " << size_x << " size_y= " << size_y << endl;
     197\end{verbatim}
     198
     199\subsection{Dynamic linker}
     200The class {\bf PDynLinkMgr} can be used for managing shared libraries
     201at run time. The example below shows the run time linking of a function:\\
     202{\tt extern "C" { void myfunc(); } } \\
     203\begin{verbatim}
     204#include "pdlmgr.h"
     205// ...
     206string soname = "mylib.so";
     207string funcname = "myfunc";
     208PDynLinkMgr dyl(soname);
     209DlFunction f = dyl.GetFunction(funcname);
     210if (f != NULL) {
     211// Calling the function
     212  f();   
     213}
     214\end{verbatim}
     215
     216\section{Module TArray}
     217{\bf TArray} module contains template classes for handling standard
     218operations on numerical arrays. Using the class {\tt \tcls{TArray} },
     219it is possible to create and manipulate up to 5-dimension numerical
     220arrays {\tt (int, float, double, complex, \ldots)}.   
     221
     222\begin{figure}[hbt]
     223\dclsccc{AnyDataObj}{BaseArray}{\tcls{TArray}}
     224\ldots \\
     225\dclsccc{\tcls{TArray}}{\tcls{TMatrix}}{\tcls{TVector}}
     226\caption{partial class diagram for arrays, matrices and vectors}
     227\end{figure}
     228
     229\subsection{Using arrays}
    159230
    160231\newpage
     232
     233\section{Module HiStats}
     234\begin{figure}[hbt]
     235\dclsccc{AnyDataObj}{Histo}{HProf}
     236\dclsbb{AnyDataObj}{Histo2D}
     237\dclsbb{AnyDataObj}{Ntuple}
     238\dclsb{XNtuple}
     239\caption{partial class diagram for histograms and ntuples}
     240\end{figure}
     241
     242\section{Module SkyMap}
     243
     244\section{Module NTools}
     245
     246\section{Module Samba}
     247
     248\section{Module SkyT}
     249
     250
    161251
    162252\section{Building and installing Sophya}
     
    199289        {\bf \large the use of GNU make is mandatory}
    200290        \rule{20mm}{0.5mm} }
    201 
     291 
    202292\vspace*{3mm}
    203293\begin{verbatim}
     
    209299csh> setenv EXTLIBDIR /usr/local/ExtLibs/
    210300# Use the top level makefile in Mgr/
    211 csh> cd $SRC
     301csh> cd \$SRC
    212302csh> cp Mgr/Makefile Makefile
    213303# Step 1: Create the directory tree and copy the include files (.h)
     
    285375 
    286376\newpage
    287 
    288 \section{Learning Sophya through examples}
    289 The examples here illustrates the basic
    290 usage of Sophya classes. Sophya documentation can be found at our web site: \\
    291 {\bf http://hfi-l2.in2p3.fr}.
    292 
    293 \subsection{Using classes in SysTools}
    294 
    295 {\bf SysTools} contains utility classes such as {\tt DataCards} or
    296 {\tt DVlist}, an hierarchy of exception classes for Sophya, a template
    297 class {\tcls{NDataBlock}} for handling reference counting on numerical
    298 arrays, as well as classes providing the services for implementing simple
    299 serialization. For simple programs, it is a good practice to handle
     377\appendix
     378\section{Exception handling: An example}
     379For simple programs, it is a good practice to handle
    300380the exceptions at least at high level, in the {\tt main()} function.
    301381The example below shows the exception handling and the usage
    302382of Sophya persistence.
    303 \vspace*{5mm}
    304 
    305 \begin{figure}[hbt]
    306 \dclsa{PPersist}
    307 \dclsbb{PIOPersist}{PInPersist}
    308 \dclsb{POutPersist}
    309 \caption{partial class diagram for classes handling persistencein Sophya}
    310 \end{figure}
    311 
     383 
    312384\input{ex1.inc}
    313385
    314 \subsection{Using arrays and matrices}
    315 {\bf TArray} module contains template classes for handling standard
    316 operations on numerical arrays. Using the class {\tt \tcls{TArray} },
    317 it is possible to create and manipulate up to 5-dimension numerical
    318 arrays {\tt (int, float, double, complex, \ldots)}.   
    319386
    320387\end{document}
Note: See TracChangeset for help on using the changeset viewer.