xref: /aosp_15_r20/frameworks/native/libs/ftl/README.md (revision 38e8c45f13ce32b0dcecb25141ffecaf386fa17f)
1*38e8c45fSAndroid Build Coastguard Worker# FTL
2*38e8c45fSAndroid Build Coastguard Worker
3*38e8c45fSAndroid Build Coastguard WorkerFTL is a template library shared by SurfaceFlinger and InputFlinger, inspired by
4*38e8c45fSAndroid Build Coastguard Workerand supplementing the C++ Standard Library. The intent is to fill gaps for areas
5*38e8c45fSAndroid Build Coastguard Workernot (yet) covered—like cache-efficient data structures and lock-free concurrency
6*38e8c45fSAndroid Build Coastguard Workerprimitives—and implement proposals that are missing or experimental in Android's
7*38e8c45fSAndroid Build Coastguard Workerlibc++ branch. The design takes some liberties with standard compliance, notably
8*38e8c45fSAndroid Build Coastguard Workerassuming that exceptions are disabled.
9*38e8c45fSAndroid Build Coastguard Worker
10*38e8c45fSAndroid Build Coastguard Worker## Tests
11*38e8c45fSAndroid Build Coastguard Worker
12*38e8c45fSAndroid Build Coastguard Worker    atest ftl_test
13*38e8c45fSAndroid Build Coastguard Worker
14*38e8c45fSAndroid Build Coastguard Worker## Style
15*38e8c45fSAndroid Build Coastguard Worker
16*38e8c45fSAndroid Build Coastguard Worker- Based on [Google C++ Style](https://google.github.io/styleguide/cppguide.html).
17*38e8c45fSAndroid Build Coastguard Worker- Informed by [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines).
18*38e8c45fSAndroid Build Coastguard Worker
19*38e8c45fSAndroid Build Coastguard WorkerNaming conventions are as follows:
20*38e8c45fSAndroid Build Coastguard Worker
21*38e8c45fSAndroid Build Coastguard Worker- `PascalCase`
22*38e8c45fSAndroid Build Coastguard Worker    - Types and aliases, except standard interfaces.
23*38e8c45fSAndroid Build Coastguard Worker    - Template parameters, including non-type ones.
24*38e8c45fSAndroid Build Coastguard Worker- `snake_case`
25*38e8c45fSAndroid Build Coastguard Worker    - Variables, and data members with trailing underscore.
26*38e8c45fSAndroid Build Coastguard Worker    - Functions, free and member alike.
27*38e8c45fSAndroid Build Coastguard Worker    - Type traits, with standard `_t` and `_v` suffixes.
28*38e8c45fSAndroid Build Coastguard Worker- `kCamelCase`
29*38e8c45fSAndroid Build Coastguard Worker    - Enumerators and `constexpr` constants with static storage duration.
30*38e8c45fSAndroid Build Coastguard Worker- `MACRO_CASE`
31*38e8c45fSAndroid Build Coastguard Worker    - Macros, with `FTL_` prefix unless `#undef`ed.
32*38e8c45fSAndroid Build Coastguard Worker
33*38e8c45fSAndroid Build Coastguard WorkerTemplate parameter packs are named with the following convention:
34*38e8c45fSAndroid Build Coastguard Worker
35*38e8c45fSAndroid Build Coastguard Worker    typename T, typename... Ts
36*38e8c45fSAndroid Build Coastguard Worker    typename Arg, typename... Args
37*38e8c45fSAndroid Build Coastguard Worker
38*38e8c45fSAndroid Build Coastguard Worker    std::size_t I, std::size_t... Is
39*38e8c45fSAndroid Build Coastguard Worker    std::size_t Size, std::size_t... Sizes
40*38e8c45fSAndroid Build Coastguard Worker
41*38e8c45fSAndroid Build Coastguard WorkerThe `details` namespace contains implementation details.
42