1[/ 2 (C) Copyright Edward Diener 2011,2012 3 Distributed under the Boost Software License, Version 1.0. 4 (See accompanying file LICENSE_1_0.txt or copy at 5 http://www.boost.org/LICENSE_1_0.txt). 6] 7 8[section:tti_intro Introduction] 9 10Welcome to the Boost Type Traits Introspection library, abbreviated TTI. 11 12TTI is a library which provides the ability to introspect by name the elements 13of a type at compile time. 14 15TTI works through macros generating metafunctions. Metafunctions are class 16templates of a particular syntax, having a nested 'type' member. So wherever 17in C++ class templates can occur, TTI macros can be used. The metafunctions 18generated by TTI are no different from any other metafunction as defined by 19the Boost MPL library. 20 21The metafunctions generated by TTI are used to introspect elements of a type 22at compile time, always passing at minimum to each metafunction the enclosing 23type being introspected. 24 25The name of the library has been chosen because the library offers 26compile time functionality on a type, similar to the Boost Type Traits library, 27and because the functionality the library offers is the ability to introspect 28a type about the existence of a specific element within that type. 29 30I use the word "introspect" in a very broad sense here. Normally computer 31language introspection means initially asking for information to be returned 32by name, which can then further be used to introspect for more specific 33information. In the TTI library one must always know and supply the name, and 34use the functionality provided for the correct type of inner element to find 35out if that particular named entity exists. 36 37You may prefer the term "query" instead of "introspection" to denote what this 38library does, but I use terminology based on the word "introspect" throughout 39this documentation. 40 41The functionality of the library may be summed up as: 42 43* Provide the means to introspect a type at compile time 44 using a set of macros. Each macro takes the name of the 45 type's element and generates a metafunction which can be 46 subsequently invoked to determine whether or not the 47 element exists within the type. These generated metafunctions 48 will be called "macro metafunctions" in the documentation. 49 The type to be introspected can be a class, struct, or union. 50 51* Provide the means to create a typedef for a type which may 52 not exist. If the type does not exist an empty marker type 53 is returned as the typedef type. This typedef type can be 54 used as a type in the metafunctions of the library without 55 producing compile-time errors. 56 57The library is dependent on Boost PP, Boost MPL, 58Boost Type Traits, and Boost Function Types. 59 60The library is also dependent on the variadic macro support 61of the Boost PP library if the variadic macros in the library 62are used. 63 64The library is a header only library. 65 66Since the dependencies of the library are all header only 67libraries, there is no need to build a library in order to use 68the TTI library. 69 70[section:tti_headers Header Files] 71 72There is a single header file, `boost/tti/tti.hpp`, 73which includes all the header files in the library. 74 75There are also separate specific header files for each of the elements 76to be introspected by the library. This allows for finer-grained inclusion 77of the nested elements to be introspected. These header files are: 78 79[table:tbhfiles TTI Header Files 80 [ 81 [Introspected Element] 82 [Specific Header File] 83 ] 84 [ 85 [Type] 86 [[headerref boost/tti/has_type.hpp `has_type.hpp`]] 87 ] 88 [ 89 [Class/Struct] 90 [[headerref boost/tti/has_class.hpp `has_class.hpp`]] 91 ] 92 [ 93 [Enumeration] 94 [[headerref boost/tti/has_enum.hpp `has_enum.hpp`]] 95 ] 96 [ 97 [Union] 98 [[headerref boost/tti/has_union.hpp `has_union.hpp`]] 99 ] 100 [ 101 [Class Template] 102 [[headerref boost/tti/has_template.hpp `has_template.hpp`]] 103 ] 104 [ 105 [Member data] 106 [[headerref boost/tti/has_member_data.hpp `has_member_data.hpp`]] 107 ] 108 [ 109 [Member function] 110 [[headerref boost/tti/has_member_function.hpp `has_member_function.hpp`]] 111 ] 112 [ 113 [Member function template] 114 [[headerref boost/tti/has_member_function_template.hpp `has_member_function_template.hpp`]] 115 ] 116 [ 117 [Static member data] 118 [[headerref boost/tti/has_static_member_data.hpp `has_static_member_data.hpp`]] 119 ] 120 [ 121 [Static member function] 122 [[headerref boost/tti/has_static_member_function.hpp `has_static_member_function.hpp`]] 123 ] 124 [ 125 [Static member function template] 126 [[headerref boost/tti/has_static_member_function_template.hpp `has_static_member_function_template.hpp`]] 127 ] 128 [ 129 [Data] 130 [[headerref boost/tti/has_data.hpp `has_data.hpp`]] 131 ] 132 [ 133 [Function] 134 [[headerref boost/tti/has_function.hpp `has_function.hpp`]] 135 ] 136 [ 137 [Function template] 138 [[headerref boost/tti/has_function_template.hpp `has_function_template.hpp`]] 139 ] 140 [ 141 [Member Type Creation] 142 [[headerref boost/tti/member_type.hpp `member_type.hpp`]] 143 ] 144] 145 146[endsect] 147 148[endsect] 149