C++ headers malfunction when there is an include cycle. I have designed some rules to prevent inclusion cycles (ensure topological sortability).
Abstract files (in order from common to derived). Each file can include all files listed above.
- ../*_common.h
- ./general_common.h
- External libraries: none
- ./specific_common.h
- External libraries: specific -related libraries
- ./specific/nested_common.h, if used
- ./specific/nested.h
- ./specific.h (public interface of . folder)
- ./general.h, if used
- ../app.cpp will interface mostly with ./specific.h (a public interface). I should try C++ modules.
Concrete files in this folder (in order from common to derived). Each file can include all files listed above.
- audio_common.h (general audio types and functions, like Amplitude = s16)
- output.h
- Depends on output-related libraries (portaudio).
- Application code depends on output.h.
and
- audio_common.h
- synth_common.h
- Depends on synth-related libraries (blip_buf).
- synth/Nes2A03Synth.h
- class audio::synth::Nes2A03Synth
- synth.h
- Application code depends on synth.h.