]> Creatis software - bbtk.git/blob - kernel/doc/bbtkDevelopersGuide/bbtkDevelopersGuide.tex
0de7e4e20f0bc0e7d2472a5e039525047f21b064
[bbtk.git] / kernel / doc / bbtkDevelopersGuide / bbtkDevelopersGuide.tex
1 \documentclass[a4paper,11pt]{report}
2 \input{config.tex}
3 \author{L. Guigues}
4 \title{The Black Box Tool Kit\\Developers' Guide}
5
6 \begin{document}
7 \maketitle
8 \tableofcontents
9 \chapter{Introduction}
10
11
12 \chapter{Misc}
13 \section{Displaying messages}
14
15 \section{Types and RTTI}
16
17
18
19 In \bbtk the class conveying the information on a type is 
20 \begin{verbatim}
21 bbtk::TypeInfo
22 \end{verbatim}
23 which is simply a typedef on 
24 \begin{verbatim}
25 const std::type_info&
26 \end{verbatim}
27 Remember that all constructors ofthe std::type\_info class are private, 
28 hence objects can only be created by the operator \texttt{typeid} 
29 which returns a const reference on a type\_info. 
30 Hence the \bbtk type TypeInfo conveys that const reference 
31 and cannot be itself referenced. 
32 Any function or method which takes or returns a TypeInfo must take 
33 or return it \emph{by value} (see e.g. the TypeName function below).
34 To print the name of a type use one of the template functions 
35 \begin{verbatim}
36 template <class T> std::string TypeName();
37 template <class T> std::string TypeName(const T&);
38 template <class T> std::string TypeName(bbtk::TypeInfo);
39 \end{verbatim}
40
41
42 \begin{verbatim}
43 BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::string,"string");
44 \end{verbatim}
45
46 \end{document}