Feature configuration data
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(feature_config_t), | public | :: | base | ||||
| type(feature_config_t), | public, | allocatable | :: | variants(:) |
Interface for feature_collection_t constructor
Create a feature collection from a single feature_config_t The feature becomes the base configuration for all OS/compiler combinations
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(feature_config_t), | intent(in) | :: | self |
Feature configuration to convert |
Check that the collection has valid OS/compiler logic and can be merged safely Implements standardized feature hierarchy validation: 1. OS_all+id_all (base) → id_compiler+OS_all → id_all+OS_current → id_compiler+OS_current 2. Additive properties (flags) can be concatenated 3. Allocatable properties can only exist in one variant per merge path
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(feature_collection_t), | intent(in) | :: | self | |||
| type(error_t), | intent(out), | allocatable | :: | error |
Dump dependency to toml table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
| type(toml_table), | intent(inout) | :: | table |
Data structure |
||
| type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Write serializable object to file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
| character(len=*), | intent(in) | :: | file |
File name |
||
| type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
| logical, | intent(in), | optional | :: | json |
Optional JSON format |
Write serializable object to a formatted Fortran unit
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
| integer, | intent(in) | :: | unit |
Formatted unit |
||
| type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
| logical, | intent(in), | optional | :: | json |
Optional JSON format requested? |
Serialize: base as a subtable; variants under a “variants” table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(feature_collection_t), | intent(inout) | :: | self | |||
| type(toml_table), | intent(inout) | :: | table | |||
| type(error_t), | intent(out), | allocatable | :: | error |
Extract a merged feature configuration for the given target platform
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(feature_collection_t), | intent(in) | :: | self | |||
| type(platform_config_t), | intent(in) | :: | target | |||
| type(error_t), | intent(out), | allocatable | :: | error |
Check if there is a CPP preprocessor configuration
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(feature_collection_t), | intent(in) | :: | self |
Read dependency from toml table (no checks made at this stage)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
| type(toml_table), | intent(inout) | :: | table |
Data structure |
||
| type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Read dependency tree from file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
| character(len=*), | intent(in) | :: | file |
File name |
||
| type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
| logical, | intent(in), | optional | :: | json |
Optional JSON format |
Read dependency tree from file init JSON interpreter Read object from TOML table
use default TOML parser
Read object from TOML table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
| integer, | intent(in) | :: | unit |
File name |
||
| type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
| logical, | intent(in), | optional | :: | json |
Optional JSON format |
Deserialize: read base; then any number of variants under “variants”
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(feature_collection_t), | intent(inout) | :: | self | |||
| type(toml_table), | intent(inout) | :: | table | |||
| type(error_t), | intent(out), | allocatable | :: | error |
Merge a feature configuration into an existing global package
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(feature_collection_t), | intent(in) | :: | self | |||
| class(feature_config_t), | intent(inout) | :: | package | |||
| type(platform_config_t), | intent(in) | :: | target | |||
| type(error_t), | intent(out), | allocatable | :: | error |
Check that two source files are equal All checks passed!
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(srcfile_t), | intent(in) | :: | this | |||
| class(serializable_t), | intent(in) | :: | that |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(feature_collection_t), | intent(inout) | :: | self | |||
| type(feature_config_t), | intent(in) | :: | variant |
Equality (semantic): base and variants (size + element-wise)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(feature_collection_t), | intent(in) | :: | this | |||
| class(serializable_t), | intent(in) | :: | that |
Test load/write roundtrip
Test serialization of a serializable object Dump to scratch file Load from scratch file Check same
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(serializable_t), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | message | |||
| type(error_t), | intent(out), | allocatable | :: | error |
type, public, extends(serializable_t) :: feature_collection_t ! Features shared by all platforms, all compilers type(feature_config_t) :: base ! Features shared by specific platform/compiler configurations type(feature_config_t), allocatable :: variants(:) contains procedure :: serializable_is_same => feature_collection_same procedure :: dump_to_toml => feature_collection_dump procedure :: load_from_toml => feature_collection_load procedure :: push_variant procedure :: extract_for_target procedure :: check => check_collection procedure :: merge_into_package procedure :: has_cpp end type feature_collection_t