F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Condition.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Condition.hpp
3 // \brief public Os::ConditionVariable interface and alias
4 //
5 // This header aggregates all definitions needed to use Os::ConditionVariable:
6 // the interface, the configured alias, and the concrete delegate type.
7 //
8 // The includes below must appear in the order given: each depends on names
9 // defined by the one before it, so reordering them will fail to compile.
10 // The ordering constraints are:
11 //
12 // 1. config/OsSelection.hpp (CFG) defines the Os::ConditionVariable type
13 // alias (alongside Os::Mutex, as the two must be selected as a pair) by
14 // forward-declaring a link-time delegate (e.g. DelegateConditionVariable)
15 // or directly aliasing a concrete implementation.
16 // Must not include Os OSAL headers (they aren't yet defined).
17 // Should only be included in Os/RawTimeInterface.hpp,
18 // Os/MutexInterface.hpp, and Os/ConditionVariableInterface.hpp.
19 //
20 // 2. Os/ConditionVariableInterface.hpp (IF) includes CFG first, then defines
21 // ConditionVariableHandle and ConditionVariableInterface.
22 //
23 // 3. OS_CONDITION_VARIABLE_HEADER (IMPL) is defined by CFG and points to the
24 // concrete implementation header. If using delegation, this points to
25 // Os/DelegateConditionVariable.hpp. If using compile-time selection, it
26 // points directly to a platform-specific implementation.
27 //
28 // ConditionVariableInterface.hpp must precede OS_CONDITION_VARIABLE_HEADER here,
29 // and CFG must never include either of them (that would form a cycle).
30 // ======================================================================
31 #ifndef OS_CONDITION_HPP_
32 #define OS_CONDITION_HPP_
33 
35 
36 // Validate that OS_CONDITION_VARIABLE_HEADER was defined by config/OsSelection.hpp
37 #ifndef OS_CONDITION_VARIABLE_HEADER
38 #error "OS_CONDITION_VARIABLE_HEADER must be defined in config/OsSelection.hpp, paired with Os::Mutex"
39 #endif
40 
41 #include OS_CONDITION_VARIABLE_HEADER
42 
43 #endif // OS_CONDITION_HPP_