]> Creatis software - bbtk.git/blob - kernel/doc/bbtkDevelopersGuide/bbtkDevelopersGuide.tex
Doc headers
[bbtk.git] / kernel / doc / bbtkDevelopersGuide / bbtkDevelopersGuide.tex
1 \documentclass[a4paper,11pt]{report}
2 \input{config.tex}
3
4
5
6 \begin{document}
7
8 \begin{center}
9
10 {\Large \BBTK}
11 \vspace{1cm}
12
13 {\Huge Developers' Guide}
14 \vspace{1cm}
15
16 \bbtk version \bbtkVersion
17 \vspace{0.5cm}
18
19
20 Last modified on : September 16, 2008 \\
21 Generated on : \today 
22 \vspace{0.5cm}
23 \end{center}
24 \begin{center}
25 Eduardo Davila, Laurent Guigues, Jean-Pierre Roux 
26 \end{center}
27 \begin{center}
28 CREATIS-LRMN, Centre de Recherche en Imagerie Medicale \\ CNRS UMR 5220, INSERM U620\\
29 INSA Lyon\\
30 Universit\'e Claude-Bernard Lyon 1
31 \end{center}
32
33
34
35 % ==========================================
36 \tableofcontents
37 % ==========================================
38
39 \chapter{Introduction}
40
41
42 \chapter{Misc}
43
44 \section{Displaying messages}
45
46 \begin{verbatim}
47 bbtkMessage("Kind",level,"message "<<"to "<<" display : i="<<i<<std::endl);
48 bbtkDebugMessage("Kind",level,"message "<<"to "<<" display : i="<<i<<std::endl);
49 \end{verbatim}
50
51 \section{Types and RTTI}
52
53
54
55 In \bbtk the class conveying the information on a type is 
56 \begin{verbatim}
57 bbtk::TypeInfo
58 \end{verbatim}
59 which is simply a typedef on 
60 \begin{verbatim}
61 const std::type_info&
62 \end{verbatim}
63 Remember that all constructors of the std::type\_info class are private, 
64 hence objects can only be created by the operator \texttt{typeid} 
65 which returns a const reference on a type\_info. 
66 Hence the \bbtk type TypeInfo conveys that const reference 
67 and cannot be itself referenced. 
68 Any function or method which takes or returns a TypeInfo must take 
69 or return it \emph{by value} (see e.g. the TypeName function below).
70 To print the name of a type use one of the template functions 
71 \begin{verbatim}
72 template <class T> std::string TypeName();
73 template <class T> std::string TypeName(const T&);
74 template <class T> std::string TypeName(bbtk::TypeInfo);
75 \end{verbatim}
76
77
78 \begin{verbatim}
79 BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::string,"string");
80 \end{verbatim}
81
82 \end{document}