Changeset 2278 in Sophya
- Timestamp:
- Nov 26, 2002, 5:23:58 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Manual/sophya.tex
r1648 r2278 1 \documentclass[twoside,11pt ]{article}1 \documentclass[twoside,11pt,pdf]{article} 2 2 % Package standard : Utilisation de caracteres accentues, mode francais et graphique 3 3 \usepackage{url} … … 36 36 \vspace{1cm} 37 37 \begin{center} 38 {\bf \Large Sophya Version: 1. 2 (V\_Jul2001) }38 {\bf \Large Sophya Version: 1.4 (V\_Nov2002) } 39 39 % Document revision 1.0 } 40 40 \end{center} … … 64 64 presents only a brief overview of the class library, 65 65 mainly from the user's point of view. A more complete description 66 can be found in the reference manual, available from our 67 web site: {\bf http://www.sophya.org}. 66 can be found in the reference manual, available from the SOPHYA 67 web site: {\bf http://www.sophya.org}. 68 % \href{http://www.sophya.org}{http://www.sophya.org}. 68 69 \par 69 70 \vspace*{2mm} … … 75 76 \item[] {\bf Mgr/} Scripts for code management, 76 77 makefile generation and software installation 77 \item[] {\bf SysTools/} General architecture support classes such78 \item[] {\bf BaseTools/} General architecture support classes such 78 79 as {\tt PPersist, NDataBlock<T>}, and few utility classes 79 ({\tt DataCard, DVList} \ldots). Presently, this module contains 80 also classes implementing interfaces to OS specific services, such 81 as shared object and dynamic link handling. This module will be 82 separated in three modules, one for the general architecture 83 support, one for the utility classes, and one for the OS specific 84 services. 80 such as the dynamic variable list manager ({\tt DVList}) as well 81 as the basic set of exception classes used in SOPHYA. 85 82 \item[] {\bf TArray/} template numerical arrays, vectors and matrices \\ 86 83 ({\tt TArray<T> TMatrix<T> TVector<T> } \ldots) … … 92 89 handling utility classes. \\ 93 90 ({\tt PixelMap<T>, LocalMap<T>, SphericalMap<T>, \ldots}) 91 \item[] {\bf SUtils/} This module contains 92 few utility classes, such as the 93 {\tt DataCard} class, as well as string manipulation functions in C and C++. 94 \item[] {\bf SysTools/} This module contains classes implementing 95 an interface to various OS specific services, such 96 as shared object and dynamic link handling. 97 94 98 \end{itemize} 95 99 … … 116 120 \end{itemize} 117 121 118 Other modules: 122 The following modules contain each a set of related programs using the 123 SOPHYA library. 119 124 \begin{itemize} 120 125 \item[] {\bf Tests/} Simple test programs 121 126 \item[] {\bf PrgUtil/} Various utility programs (runcxx, scanppf, scanfits, \ldots) 127 \item[] {\bf PrgMap/} Programs performing operations on skymaps: projections, 128 power spectrum in harmonic space, \ldots 122 129 \item[] {\bf PMixer/} skymixer and related programs 123 \item[] {\bf ProgPI/} interactive analysis tool - It should be noted that 124 this module uses the SOPHYA class library and is based on {\bf PI} 125 which is a C++ library defining a complete GUI program 126 architecture. An additional module (PIext) define the interactive 127 analysis program framework and the interfaces with the objects 128 in SOPHYA. The {\bf PI/} \footnote{the PI package documentation 129 is available from {\bf http://www.lal.in2p3.fr/recherche/eros/PeidaDoc/} } 130 and {\bf PIext/} modules are not currently part 131 of the SOPHYA CVS structure. 130 \end{itemize} 131 132 As a companion to SOPHYA, the {\bf (s)piapp} interactive data analysis 133 program is built on top of SOPHYA and the {\bf PI} GUI class library 134 and application framework. The {\bf PI} ({\bf P}eida {\bf Interactive}) 135 development started in 1995, in the EROS \footnote{EROS: {\bf E}xp\'erience 136 de {\bf R}echerche d'{\bf O}bjets {\bf S}ombres - http://eros.in2p3.fr} 137 microlensing search collaboration, with PEIDA++ \footnote {PEIDA++: 138 The EROS data analysis class library - 139 http://www.lal.in2p3.fr/recherche/eros/PeidaDoc/}. 140 The {\bf PI} documentation and the {\bf piapp} user's guide are available 141 from {\bf http://www.sophya.org}. 142 %\href{http://www.sophya.org}{http://www.sophya.org}. 143 The {\bf PI} is organized as the following modules: 144 \begin{itemize} 145 \item[] {\bf PI} Portable GUI class library and application development 146 framework kernel. 147 \item[] {\bf PIGcont} Contour-plot drawing classes. 148 \item[] {\bf PIext} Specific drawers and adapters for SOPHYA objects, 149 and the {\bf piapp} interactive data analysis framework. 150 \item[] {\bf ProgPI/} interactive analysis tool main program and pre-loaded 151 modules. 132 152 \end{itemize} 133 153 … … 143 163 \section{Using Sophya} 144 164 Basic usage of Sophya classes are described in in the following sections. 145 Complete Sophya documentation can be found at our web site : \\165 Complete Sophya documentation can be found at our web site 146 166 {\bf http://www.sophya.org}. 147 167 … … 234 254 csh> runcxx -f example.icc 235 255 \end{verbatim} 236 256 257 \subsection{the scanppf program} 258 {\bf scanppf} is a simple SOPHYA application which can be used to check 259 PPF files and list their contents. 260 \begin{verbatim} 261 csh> scanppf -h 262 PIOPersist::Initialize() Starting Sophya Persistence management service 263 SOPHYA Version 1.4 Revision 0 (V_Nov2002) -- Nov 15 2002 10:32:12 cxx 264 Usage: scanppf filename [s/n/a0/a1/a2/a3] 265 s[=default} : Sequential reading of objects 266 n : Object reading at NameTags 267 a0...a3 : Tag List with PInPersist.AnalyseTags(0...3) 268 \end{verbatim} 269 270 237 271 \newpage 238 272 … … 288 322 289 323 \newpage 290 \section{Module SysTools}291 292 {\bf SysTools} contains utility classes such as {\tt DataCards} or324 \section{Module BaseTools} 325 326 {\bf BaseTools} contains utility classes such as 293 327 {\tt DVlist}, an hierarchy of exception classes for Sophya, a template 294 328 class {\tcls{NDataBlock}} for handling reference counting on numerical … … 435 469 \end{verbatim} 436 470 437 \subsection{Using DataCards}438 \index{DataCards}439 The {\bf DataCards} class can be used to read parameters from a file.440 Each line in the file starting with \@ defines a set of values441 associated with a keyword. In the example below, we read the442 parameters corresponding with the keyword {\tt SIZE} from the443 file {\tt ex.d}. We suppose that {\tt ex.d} contains the line: \\444 {\tt @SIZE 400 250} \\445 \begin{verbatim}446 #include "datacards.h"447 // ...448 // Initialising DataCards object dc from file ex.d449 DataCards dc( "ex.d" );450 // Getting the first and second parameters for keyword size451 // We define a default value 100452 int size_x = dc.IParam("SIZE", 0, 100);453 int size_y = dc.IParam("SIZE", 1, 100);454 cout << " size_x= " << size_x << " size_y= " << size_y << endl;455 \end{verbatim}456 457 \subsection{Dynamic linker}458 \index{PDynLinkMgr}459 The class {\bf PDynLinkMgr} can be used for managing shared libraries460 at run time. The example below shows the run time linking of a function:\\461 {\tt extern "C" { void myfunc(); } } \\462 \begin{verbatim}463 #include "pdlmgr.h"464 // ...465 string soname = "mylib.so";466 string funcname = "myfunc";467 PDynLinkMgr dyl(soname);468 DlFunction f = dyl.GetFunction(funcname);469 if (f != NULL) {470 // Calling the function471 f();472 }473 \end{verbatim}474 475 \subsection{CxxCompilerLinker class}476 \index{CxxCompilerLinker}477 This class provides the services to compile C++ code and building478 shared libraries, using the same compiler and options which have479 been used to create the SOPHYA shared library.480 The sample program below illustrates using this class to build481 the shared library (myfunc.so) from the source file myfunc.cc :482 \begin{verbatim}483 #include "cxxcmplnk.h"484 // ...485 string flnm = "myfunc.cc";486 string oname, soname;487 int rc;488 CxxCompilerLinker cxx;489 // The Compile method provides a default object file name490 rc = cxx.Compile(flnm, oname);491 if (rc != 0 ) { // Error when compiling ... }492 // The BuildSO method provides a default shared object file name493 rc = cxx.BuildSO(oname, soname);494 if (rc != 0 ) { // Error when creating shared object ... }495 \end{verbatim}496 471 497 472 \newpage … … 1196 1171 ffts.FFTForward(in, out); 1197 1172 cout << "out= " << out << endl; 1173 \end{verbatim} 1174 1175 % \newpage 1176 \section{Module SUtils} 1177 Some utility classes and C/C++ string manipulation functions are gathered 1178 in {\bf SUtils} module. 1179 \subsection{Using DataCards} 1180 \index{DataCards} 1181 The {\bf DataCards} class can be used to read parameters from a file. 1182 Each line in the file starting with \@ defines a set of values 1183 associated with a keyword. In the example below, we read the 1184 parameters corresponding with the keyword {\tt SIZE} from the 1185 file {\tt ex.d}. We suppose that {\tt ex.d} contains the line: \\ 1186 {\tt @SIZE 400 250} \\ 1187 \begin{verbatim} 1188 #include "datacards.h" 1189 // ... 1190 // Initialising DataCards object dc from file ex.d 1191 DataCards dc( "ex.d" ); 1192 // Getting the first and second parameters for keyword size 1193 // We define a default value 100 1194 int size_x = dc.IParam("SIZE", 0, 100); 1195 int size_y = dc.IParam("SIZE", 1, 100); 1196 cout << " size_x= " << size_x << " size_y= " << size_y << endl; 1197 \end{verbatim} 1198 1199 \section{Module SysTools} 1200 The {\bf SysTools} module contains classes implementing interface to some 1201 OS specific services. 1202 \subsection{Dynamic linker} 1203 \index{PDynLinkMgr} 1204 The class {\bf PDynLinkMgr} can be used for managing shared libraries 1205 at run time. The example below shows the run time linking of a function:\\ 1206 {\tt extern "C" { void myfunc(); } } \\ 1207 \begin{verbatim} 1208 #include "pdlmgr.h" 1209 // ... 1210 string soname = "mylib.so"; 1211 string funcname = "myfunc"; 1212 PDynLinkMgr dyl(soname); 1213 DlFunction f = dyl.GetFunction(funcname); 1214 if (f != NULL) { 1215 // Calling the function 1216 f(); 1217 } 1218 \end{verbatim} 1219 1220 \subsection{CxxCompilerLinker class} 1221 \index{CxxCompilerLinker} 1222 This class provides the services to compile C++ code and building 1223 shared libraries, using the same compiler and options which have 1224 been used to create the SOPHYA shared library. 1225 The sample program below illustrates using this class to build 1226 the shared library (myfunc.so) from the source file myfunc.cc : 1227 \begin{verbatim} 1228 #include "cxxcmplnk.h" 1229 // ... 1230 string flnm = "myfunc.cc"; 1231 string oname, soname; 1232 int rc; 1233 CxxCompilerLinker cxx; 1234 // The Compile method provides a default object file name 1235 rc = cxx.Compile(flnm, oname); 1236 if (rc != 0 ) { // Error when compiling ... } 1237 // The BuildSO method provides a default shared object file name 1238 rc = cxx.BuildSO(oname, soname); 1239 if (rc != 0 ) { // Error when creating shared object ... } 1198 1240 \end{verbatim} 1199 1241 … … 1451 1493 Solaris & g++ (2.95) \\ 1452 1494 SGI IRIX64 & CC (7.3) \\ 1495 MacOSX/Darwin 10.1 & c++/gcc 2.95 \\ 1453 1496 \end{tabular} 1454 1497 \end{center}
Note:
See TracChangeset
for help on using the changeset viewer.