|
9 | 9 | - Symbols in "detail" namespaces are never public |
10 | 10 | - public headers in "include/" |
11 | 11 | - library cpp files in "src/" |
| 12 | +- no ABI compatibility guarantee in different Boost version |
12 | 13 |
|
13 | 14 | ## Javadoc Documentation |
14 | 15 |
|
@@ -61,20 +62,83 @@ T default_value(); |
61 | 62 | - Full files, not diffs |
62 | 63 | - Accurate, compiling C++ code |
63 | 64 |
|
64 | | -## Symbol Visibility |
| 65 | +# Project |
65 | 66 |
|
66 | | -- Mark **all public classes with virtual functions or virtual base classes** with |
67 | | - `BOOST_HTTP_PROTO_SYMBOL_VISIBLE`. |
| 67 | +## Structure |
68 | 68 |
|
69 | | - - This is required for: |
70 | | - - DSO (Dynamic Shared Object) builds compiled with hidden visibility. |
71 | | - - DLL builds with MinGW GCC due to its [non-conformance with MSVC](https://github.com/cppalliance/http_proto/issues/214). |
| 69 | +* Boost.Beast2 refers to both the library which uses Boost.Asio and the collection of |
| 70 | + libraries which includes Boost.Capy, Boost.Buffers, Boost.Http (http-proto), and Boost.Beast2 |
72 | 71 |
|
73 | | -- Mark **all public exception types** and **public classes used as the operand of `dynamic_cast`** with |
74 | | - `BOOST_HTTP_PROTO_DECL`. |
| 72 | +* Boost.Capy contains general purpose data structures and algorithms |
75 | 73 |
|
76 | | - - This ensures: |
77 | | - - RTTI (typeinfo) is exported from DLLs. |
78 | | - - RTTI is visible from DSOs. |
79 | | - - Once a class is marked with `BOOST_HTTP_PROTO_DECL`, **all of its member functions are exported automatically**. |
80 | | - - Do **not** mark the member functions individually. |
| 74 | +* Boost.Buffers provides Asio-style buffers without requiring Asio, and it |
| 75 | + introduces blocking source and sink types with buffered variants |
| 76 | + |
| 77 | +* Boost.Http provides a Sans-IO HTTP which includes the following: |
| 78 | + - Containers for request and response headers |
| 79 | + - Low level HTTP algorithms such as parsing, serialization, and field processing |
| 80 | + - High level HTTP Server components |
| 81 | + - High level HTTP Client components |
| 82 | + |
| 83 | +* Boost.Beast2 builds on Capy, Buffers, and Boost.Http by providing the I/O layer |
| 84 | + using Boost.Asio. It can open ports and maintain TCP connections. |
| 85 | + |
| 86 | +* Boost.Http Server component is based on an Express JS style router, ported to |
| 87 | + idiomatic C++ |
| 88 | + |
| 89 | + - In the C++ router, route handlers are declarative rather than imperative. They |
| 90 | + package up the response using a Sans-IO API. Beast2 handles the sesnding |
| 91 | + and receiving. |
| 92 | + |
| 93 | + - Alternatively, a route handler can opt-in to seeing the Asio stream type |
| 94 | + and its associated executor, and bypass the declarative framework to take |
| 95 | + over the async aspect of sending and receiving the bytes. |
| 96 | + |
| 97 | + - Sans-IO route handlers can be built depending only on Boost.Http (no Asio) |
| 98 | + while opting-in to seeing the Asio stream allows for C++20 style co_await |
| 99 | + and all the other async continuation models that Asio supports. |
| 100 | + |
| 101 | +# Documentation |
| 102 | + |
| 103 | +## System Context |
| 104 | + |
| 105 | +You are an expert programming educator creating tutorial documentation for expert C++ programmers. |
| 106 | +Goal: Minimize time-to-competence. Maximize learning velocity. |
| 107 | +Style: Problem-first, progressive disclosure, concrete examples. |
| 108 | + |
| 109 | +## Instructions |
| 110 | + |
| 111 | +INPUT ANALYSIS |
| 112 | +- Identify distinct problems this API solves |
| 113 | +- Map API concepts to problem domains |
| 114 | +- Determine prerequisite knowledge (assume expert C++, standard dependencies) |
| 115 | + |
| 116 | +CHAPTER DESIGN |
| 117 | +- One problem domain per chapter |
| 118 | +- Order by: simplest useful → most powerful |
| 119 | +- Each chapter states upfront: "After this you can [solve X problem]" |
| 120 | +- Build dependency chain: later chapters assume earlier ones |
| 121 | + |
| 122 | +CHAPTER STRUCTURE |
| 123 | +1. Problem hook: concrete scenario reader wants to solve |
| 124 | +2. Minimal working solution: fastest path to success |
| 125 | +3. Progressive enhancement: add one capability at a time |
| 126 | +4. Each step: why this matters, what it unlocks |
| 127 | +5. End state: reader can now [do concrete thing] |
| 128 | + |
| 129 | +OPTIMIZATION PRINCIPLES |
| 130 | +- No teaching C++ basics or documented dependencies |
| 131 | +- Show power immediately (avoid toy examples) |
| 132 | +- Concrete > abstract (real problems > hypotheticals) |
| 133 | +- Remove anything not on critical path to competence |
| 134 | +- Examples must compile and demonstrate capability |
| 135 | +- Emotional tone: "you can do powerful things quickly" |
| 136 | + |
| 137 | +TRANSPARENCY |
| 138 | +- State chapter scope and outcomes first |
| 139 | +- Flag prerequisites explicitly |
| 140 | +- No surprise complexity or hidden dependencies |
| 141 | + |
| 142 | +VALIDATION METRIC |
| 143 | +- Could reader A/B test learn faster from this than alternatives? |
| 144 | +- Does each paragraph reduce time-to-competence? |
0 commit comments