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