Changeset 1299 in Sophya for trunk/SophyaLib/Manual
- Timestamp:
- Nov 8, 2000, 9:46:04 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Manual/sophya.tex
r1292 r1299 130 130 131 131 The file {\tt \$DPCBASEREP/Include/MakefileUser.h} defines the compilation 132 flag and the list of Sophya libraries. It should be included in the132 flags and the list of Sophya libraries. It should be included in the 133 133 user's makefile. The default compilation rules assumes that the object (.o) 134 134 and executable files would be put in the following diretories: \\ … … 145 145 {\tt trivial.cc }. 146 146 \begin{verbatim} 147 csh> cp $DPCBASEREP/Include/makefile_auto makefile147 csh> cp \$DPCBASEREP/Include/makefile_auto makefile 148 148 csh> make trivial 149 149 \end{verbatim} … … 157 157 example makefile. 158 158 159 Basic usage of Sophya classes are described in in the following sections. 160 Complete 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 168 class {\tcls{NDataBlock}} for handling reference counting on numerical 169 arrays, as well as classes providing the services for implementing simple 170 serialization. 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} 181 The {\bf DataCards} class can be used to read parameters from a file. 182 Each line in the file starting with \@ defines a set of values 183 associated with a keyword. In the example below, we read the 184 parameters corresponding with the keyword {\tt SIZE} from the 185 file {\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 191 DataCards dc( "ex.d" ); 192 // Getting the first and second parameters for keyword size 193 // We define a default value 100 194 int size_x = dc.IParam("SIZE", 0, 100); 195 int size_y = dc.IParam("SIZE", 1, 100); 196 cout << " size_x= " << size_x << " size_y= " << size_y << endl; 197 \end{verbatim} 198 199 \subsection{Dynamic linker} 200 The class {\bf PDynLinkMgr} can be used for managing shared libraries 201 at 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 // ... 206 string soname = "mylib.so"; 207 string funcname = "myfunc"; 208 PDynLinkMgr dyl(soname); 209 DlFunction f = dyl.GetFunction(funcname); 210 if (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 218 operations on numerical arrays. Using the class {\tt \tcls{TArray} }, 219 it is possible to create and manipulate up to 5-dimension numerical 220 arrays {\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} 159 230 160 231 \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 161 251 162 252 \section{Building and installing Sophya} … … 199 289 {\bf \large the use of GNU make is mandatory} 200 290 \rule{20mm}{0.5mm} } 201 291 202 292 \vspace*{3mm} 203 293 \begin{verbatim} … … 209 299 csh> setenv EXTLIBDIR /usr/local/ExtLibs/ 210 300 # Use the top level makefile in Mgr/ 211 csh> cd $SRC301 csh> cd \$SRC 212 302 csh> cp Mgr/Makefile Makefile 213 303 # Step 1: Create the directory tree and copy the include files (.h) … … 285 375 286 376 \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} 379 For simple programs, it is a good practice to handle 300 380 the exceptions at least at high level, in the {\tt main()} function. 301 381 The example below shows the exception handling and the usage 302 382 of 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 312 384 \input{ex1.inc} 313 385 314 \subsection{Using arrays and matrices}315 {\bf TArray} module contains template classes for handling standard316 operations on numerical arrays. Using the class {\tt \tcls{TArray} },317 it is possible to create and manipulate up to 5-dimension numerical318 arrays {\tt (int, float, double, complex, \ldots)}.319 386 320 387 \end{document}
Note:
See TracChangeset
for help on using the changeset viewer.