|
2 | 2 | = xref:headers.adoc[Headers] |
3 | 3 | :toc: |
4 | 4 |
|
5 | | -### boost/openmethod.hpp |
| 5 | +{empty} |
6 | 6 |
|
7 | | -Convenience header. Includes `core.hpp` and `macros.hpp`. This is the header |
8 | | -that most users should use. |
| 7 | +*NOTE*: The two important headers are: |
9 | 8 |
|
10 | | -### boost/openmethod/core.hpp |
| 9 | +* xref:#main[`boost/openmethod.hpp`] to define open-methods and overriders using |
| 10 | +convenient macros. |
11 | 11 |
|
12 | | -Defines all the core constructs of the library: `method`, `virtual_ptr`, |
13 | | -`use_classes`, `virtual_traits`, etc. Does not define any public macros apart |
14 | | -from `BOOST_OPENMETHOD_DEFAULT_REGISTRY`. Users with a severe allergy to macros |
15 | | -should use this header. |
| 12 | +* xref:#initialize[`boost/openmethod.hpp/initialize`] to initialize the library. |
| 13 | +Typically only included in the translation unit containing `main`. |
16 | 14 |
|
17 | | -### boost/openmethod/macros.hpp |
| 15 | +The following headers make it possible to use standard smart pointers in virtual |
| 16 | +parameters: |
18 | 17 |
|
19 | | -Defines all the public macros of the library, such as `BOOST_OPENMETHOD`, |
20 | | -`BOOST_OPENMETHOD_CLASSES`, etc. This header includes `core.hpp`. |
| 18 | +* xref:#std_shared_ptr[`boost/openmethod/interop/std_shared_ptr.hpp`] to use |
| 19 | +`std::shared_ptr` in virtual parameters. |
21 | 20 |
|
22 | | -### boost/openmethod/registry.hpp |
| 21 | +* xref:#std_unique_ptr[`boost/openmethod/interop/std_unique_ptr.hpp`] to use |
| 22 | +`std::unique_ptr` in virtual parameters. |
23 | 23 |
|
24 | | -Defines `registry` and stock policies. |
| 24 | +*The other headers are for advanced use*. |
25 | 25 |
|
26 | | -### boost/openmethod/default_registry.hpp |
| 26 | +### boost/openmethod/preamble.hpp |
27 | 27 |
|
28 | | -### boost/openmethod/policies/default_error_handler.hpp |
| 28 | +Defines `registry` and stock policies. Also defines all the types and functions |
| 29 | +necessary to the definition of `registry`. |
29 | 30 |
|
30 | | -### boost/openmethod/policies/fast_perfect_hash.hpp |
| 31 | +Most users should not include this header directly, unless for the purpose of |
| 32 | +overriding the default registry. |
31 | 33 |
|
32 | 34 | ### boost/openmethod/policies/std_rtti.hpp |
33 | 35 |
|
34 | | -### boost/openmethod/policies/static_rtti.hpp |
| 36 | +Includes all the headers above. |
| 37 | + |
| 38 | +Provides an implementation of the `rtti` policy using standard RTTI. |
| 39 | + |
| 40 | +### boost/openmethod/policies/fast_perfect_hash.hpp |
| 41 | + |
| 42 | +Includes all the headers above. |
| 43 | + |
| 44 | +Provides an implementation of the `hash` policy using a fast perfect hash |
| 45 | +function. |
| 46 | + |
| 47 | +### boost/openmethod/policies/vptr_vector.hpp |
| 48 | + |
| 49 | +Includes all the headers above. |
| 50 | + |
| 51 | +Provides an implementation of the `vptr` policy that stores the v-table pointers |
| 52 | +in a `std::vector` indexed by type ids, possibly hashed. |
| 53 | + |
| 54 | +### boost/openmethod/policies/default_error_handler.hpp |
| 55 | + |
| 56 | +Includes all the headers above. |
| 57 | + |
| 58 | +Provides an implementation of the `error_handler` policy that calls a |
| 59 | +`std::function<void(openmethod_error)>` when an error is encountered, and before |
| 60 | +the library aborts the program. |
35 | 61 |
|
36 | 62 | ### boost/openmethod/policies/stderr_output.hpp |
37 | 63 |
|
| 64 | +Includes all the headers above. |
| 65 | + |
| 66 | +Provides an implementation of the `output` policy that writes diagnostics to |
| 67 | +the C standard error stream (not using iostreams). |
| 68 | + |
| 69 | +### boost/openmethod/default_registry.hpp |
| 70 | + |
| 71 | +Includes all the headers above. |
| 72 | + |
| 73 | +Defines the default registry, which contains all the stock policies listed |
| 74 | +above. |
| 75 | + |
| 76 | +Most users should not include this header directly, unless for the purpose of |
| 77 | +overriding the default registry. |
| 78 | + |
| 79 | +### boost/openmethod/core.hpp |
| 80 | + |
| 81 | +Includes all the headers above. |
| 82 | + |
| 83 | +Defines the main constructs of the library: methods, overriders and virtual |
| 84 | +pointers, and mechanisms to implement them. Does not define any public macros |
| 85 | +apart from `BOOST_OPENMETHOD_DEFAULT_REGISTRY`, if it is not defined already. |
| 86 | + |
| 87 | +Users with a severe allergy to macros can include this header. |
| 88 | + |
| 89 | +### boost/openmethod/macros.hpp |
| 90 | + |
| 91 | +Includes all the headers above. |
| 92 | + |
| 93 | +Defines the public macros of the library, such as `BOOST_OPENMETHOD`, |
| 94 | +`BOOST_OPENMETHOD_CLASSES`, etc. |
| 95 | + |
| 96 | +There is little point in including this header directly, as it has the same |
| 97 | +effect as including `boost/openmethod.hpp`, which is shorter. |
| 98 | + |
| 99 | +[#main] |
| 100 | +### boost/openmethod.hpp |
| 101 | + |
| 102 | +Includes all the headers above. |
| 103 | + |
| 104 | +This is the header that most users should include. |
| 105 | + |
| 106 | +### boost/openmethod/policies/static_rtti.hpp |
| 107 | + |
| 108 | +Includes `preamble.hpp`. |
| 109 | + |
| 110 | +Provides a minimal implementation of the `rtti` policy that does not depend on |
| 111 | +standard RTTI. |
| 112 | + |
38 | 113 | ### boost/openmethod/policies/throw_error_handler.hpp |
39 | 114 |
|
| 115 | +Includes `preamble.hpp`. |
| 116 | + |
| 117 | +Provides an implementation of the `error_handler` policy that throws errors as |
| 118 | +exceptions. |
| 119 | + |
40 | 120 | ### boost/openmethod/policies/vptr_map.hpp |
41 | 121 |
|
42 | | -### boost/openmethod/policies/vptr_vector.hpp |
| 122 | +Includes `preamble.hpp`. |
| 123 | + |
| 124 | +Provides an implementation of the `vptr` policy that stores the v-table pointers |
| 125 | +in a map (by default a `std::map`) indexed by type ids. |
43 | 126 |
|
| 127 | +[#std_shared_ptr] |
44 | 128 | ### boost/openmethod/interop/std_shared_ptr.hpp |
45 | 129 |
|
| 130 | +Includes `core.hpp`. |
| 131 | + |
| 132 | +Provides a `virtual_traits` specialization that make it possible to use a |
| 133 | +`std::shared_ptr` in place of a raw pointer or reference in virtual parameters. |
| 134 | + |
| 135 | +[#std_unique_ptr] |
46 | 136 | ### boost/openmethod/interop/std_unique_ptr.hpp |
| 137 | + |
| 138 | +Includes `core.hpp`. |
| 139 | + |
| 140 | +Provides a `virtual_traits` specialization that make it possible to use a |
| 141 | +`std::unique_ptr` in place of a raw pointer or reference in virtual parameters. |
0 commit comments