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