]> Creatis software - bbtk.git/blob - kernel/doc/bbtkDevelopersGuide/bbtkDevelopersGuide.tex
the latex \def made in config.tex where not taken into account by tth (does tth parse...
[bbtk.git] / kernel / doc / bbtkDevelopersGuide / bbtkDevelopersGuide.tex
1 \documentclass[a4paper,11pt]{report}
2 \input{config.tex}
3
4
5 \def\todo{\scriptsize\fbox{\bf TODO !!}\normalsize}
6 \def\x{\bm{x}}
7 \def\BBTK{{\xspace}The {\bf Black Box Toolkit} }
8 \def\bbtk{{\xspace}$\texttt{bbtk}$ }
9 \def\bbi{{\xspace}$\texttt{bbi}$ }
10 \def\bbStudio{{\xspace}$\texttt{bbStudio}$ }
11 \def\bbfy{{\xspace}$\texttt{bbfy}$ }
12 \def\bbdoc{{\xspace}$\texttt{bbdoc}$ }
13 \def\bbCreatePackage{{\xspace}$\texttt{bbCreatePackage}$ }
14
15 \def\bb{{\xspace}$\texttt{bb}$ }
16 %\def\bbp{{\xspace}$\texttt{bbp}$\xspace}
17
18 \def\cmake{{\xspace}$\texttt{cmake}$ }
19
20 \def\C{{\xspace}$\texttt{C}$ }
21 \def\CPP{{\xspace}$\texttt{C++}$ }
22
23 \def\xml{{\xspace}$\texttt{xml}$ }
24
25 \def\itk{{\xspace}$\texttt{itk}$ }
26 \def\vtk{{\xspace}$\texttt{vtk}$ }
27 \def\gdcm{{\xspace}$\texttt{gdcm}$ }
28 \def\gsmis{{\xspace}$\texttt{gsmis}$ }
29 \def\wx{{\xspace}$\texttt{wxWidgets}$ }
30
31 \def\lin{{\xspace}\textit{Linux} }
32 \def\win{{\xspace}\textit{Windows} }
33
34 % the same macros with no space at the end
35
36 \def\BBTKns{{\xspace}The {\bf Black Box Toolkit}}
37 \def\bbtkns{{\xspace}$\texttt{bbtk}$}
38 \def\bbins{{\xspace}$\texttt{bbi}$}
39 \def\bbfyns{{\xspace}$\texttt{bbfy}$}
40 \def\bbdocns{{\xspace}$\texttt{bbdoc}$}
41 \def\bbCreatePackagens{{\xspace}$\texttt{bbCreatePackage}$}
42
43 \def\bbns{{\xspace}$\texttt{bb}$}
44 %\def\bbp{{\xspace}$\texttt{bbp}$\xspace}
45
46 \def\cmakens{{\xspace}$\texttt{cmake}$}
47
48 \def\Cns{{\xspace}$\texttt{C}$}
49 \def\CPPns{{\xspace}$\texttt{C++}$}
50
51 \def\xmlns{{\xspace}$\texttt{xml}$}
52
53 \def\itkns{{\xspace}$\texttt{itk}$}
54 \def\vtkns{{\xspace}$\texttt{vtk}$}
55 \def\gdcmns{{\xspace}$\texttt{gdcm}$}
56 \def\gsmisns{{\xspace}$\texttt{gsmis}$}
57 \def\wxns{{\xspace}$\texttt{wxWidgets}$}
58
59 \def\linns{{\xspace}\textit{Linux}}
60 \def\winns{{\xspace}\textit{Windows}}
61
62 \author{L. Guigues}
63 \title{The Black Box Tool Kit\\Developers' Guide}
64
65 \begin{document}
66 \maketitle
67 \tableofcontents
68 \chapter{Introduction}
69
70
71 \chapter{Misc}
72 \section{Displaying messages}
73
74 \section{Types and RTTI}
75
76
77
78 In \bbtk the class conveying the information on a type is 
79 \begin{verbatim}
80 bbtk::TypeInfo
81 \end{verbatim}
82 which is simply a typedef on 
83 \begin{verbatim}
84 const std::type_info&
85 \end{verbatim}
86 Remember that all constructors ofthe std::type\_info class are private, 
87 hence objects can only be created by the operator \texttt{typeid} 
88 which returns a const reference on a type\_info. 
89 Hence the \bbtk type TypeInfo conveys that const reference 
90 and cannot be itself referenced. 
91 Any function or method which takes or returns a TypeInfo must take 
92 or return it \emph{by value} (see e.g. the TypeName function below).
93 To print the name of a type use one of the template functions 
94 \begin{verbatim}
95 template <class T> std::string TypeName();
96 template <class T> std::string TypeName(const T&);
97 template <class T> std::string TypeName(bbtk::TypeInfo);
98 \end{verbatim}
99
100
101 \begin{verbatim}
102 BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::string,"string");
103 \end{verbatim}
104
105 \end{document}