Configuration meta data for a library
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | build_script |
Alternative build script to be invoked |
||
| type(string_t), | public, | allocatable | :: | include_dir(:) |
Include path prefix |
||
| type(string_t), | public, | allocatable | :: | lib_type(:) |
Shared / Static / Monolithic library types (can be multiple) |
||
| character(len=:), | public, | allocatable | :: | source_dir |
Source path prefix |
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? |
Dump install config to toml table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(library_config_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 |
Print information on this instance
Write information on instance
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(library_config_t), | intent(in) | :: | self |
Instance of the library configuration |
||
| integer, | intent(in) | :: | unit |
Unit for IO |
||
| integer, | intent(in), | optional | :: | verbosity |
Verbosity of the printout |
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 |
Read install config from toml table (no checks made at this stage)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(library_config_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 |
Check library types
Check if this is a monolithic library config (single monolithic archive with all objects used by this project)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(library_config_t), | intent(in) | :: | self |
Instance of the library configuration |
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 |
Serialization interface
All checks passed!
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(library_config_t), | intent(in) | :: | this | |||
| class(serializable_t), | intent(in) | :: | that |
Check if this is a shared library config (full packages built as shared libs)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(library_config_t), | intent(in) | :: | self |
Instance of the library configuration |
Check if this is a static library config (full packages built as static libs)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(library_config_t), | intent(in) | :: | self |
Instance of the library configuration |
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, extends(serializable_t) :: library_config_t !> Source path prefix character(len=:), allocatable :: source_dir !> Include path prefix type(string_t), allocatable :: include_dir(:) !> Alternative build script to be invoked character(len=:), allocatable :: build_script !> Shared / Static / Monolithic library types (can be multiple) type(string_t), allocatable :: lib_type(:) contains !> Print information on this instance procedure :: info !> Serialization interface procedure :: serializable_is_same => library_is_same procedure :: dump_to_toml procedure :: load_from_toml !> Check library types procedure, non_overridable :: monolithic procedure, non_overridable :: shared procedure, non_overridable :: static end type library_config_t