Skip to content

Commit 6f8ea67

Browse files
committed
[datatools] Support array append and array item override modes from properties parser
1 parent 88f05d8 commit 6f8ea67

File tree

5 files changed

+514
-96
lines changed

5 files changed

+514
-96
lines changed

release_notes.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Additions
2222
=========
2323

2424
* PR #49: Modernize ``datatools::properties`` and
25-
``datatools::multi_properties`` classes (B.Morgan).
26-
* PR #50: Modernize some other *data model* classes (B.Morgan).
25+
``datatools::multi_properties`` classes.
26+
* PR #50: Modernize some other *data model* classes.
2727
* Add optional support for external BxDecay0_ C++ library (from
2828
version 1) in place of the C++ port of the legacy Decay0/Genbb code
2929
embedded in the genbb_help module. The BxDecay0 is an independant
@@ -34,10 +34,12 @@ Additions
3434
* Implement the new ``print_tree`` method for various classes.
3535
* Implement new file inclusion mechanism from ``datatools::properties``
3636
and ``datatools::multi_properties`` formatted files.
37+
* Support array append mode for the ``datatools::properties`` parser
38+
* Support array item override mode for the ``datatools::properties`` parser
3739
* PR #57 : The ``bxg4_seeds`` program allows to extend a list of simulation runs
3840
with statistically independant PRNG seeds.
3941
* Support with GCC 9.3.0 (default on Ubuntu 20.04)
40-
* Support Boost 1.71 (default on Ubuntu 20.04)
42+
* Support Boost 1.71 (default on Ubuntu 20.04) and set minimum version for Boost at 1.69
4143
* Support CLHEP 2.1.4.2
4244
* Support CAMP 0.8.4 (default on Ubuntu 20.04)
4345

source/bxdatatools/include/datatools/properties.h

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,12 @@ namespace datatools {
592592
/// 1.2 \ # no space is allowed after '\'
593593
/// 2.4 \ # no space is allowed after '\'
594594
/// 4.8 # last value
595+
///
596+
/// #@description Here two more elements are appended to the original four items
597+
/// in the 'guess_values' array so that it contains finally six elements.
598+
/// In case of real values, the unit ('in UNITNAME') should be the same that
599+
/// the one used for the previous definition in order to avoid confusion or inconsistency.
600+
/// guess_values : real[2] in mm += 3.2 1.32
595601
///
596602
/// #@description Algorithm verbosity
597603
/// logging : string = "mute" # no print at all
@@ -604,14 +610,18 @@ namespace datatools {
604610
/// logging : string = "debug" # print debug messages
605611
///
606612
/// #@forbid_key_override # Special directive
607-
/// # From this point, overriding already defined properties is forbidden.
613+
/// # From this point, overriding already defined properties is forbidden again.
608614
///
609615
/// #@enable_variants
610616
/// # Enable the parsing of variant preprocessor directives.
611617
///
612-
/// #@variant_only math:numerical_library/with_gsl
618+
/// #@variant_only math:numerical_library/with_gsl|true
613619
/// # This variant directive only applies to the next property directive
614-
/// # if the "math:numerical_library/with_gsl" variant condition is set (boolean).
620+
/// # if the "math:numerical_library/with_gsl" variant condition is set (boolean)
621+
/// # where 'math' is the name of the target variant registry and
622+
/// # 'numerical_library/with_gsl' is the path of a variant condition within
623+
/// # this registry. The '|true' tag indicates that the condition should be
624+
/// # considered as true if no variant system is activated.
615625
/// #@description GSL error handling flag is set only if the GSL library is used
616626
/// gsl_error_support : boolean = true
617627
///
@@ -638,7 +648,7 @@ namespace datatools {
638648
/// #
639649
/// default_epsilon : real = @variant(math:tolerance/is_user/epsilon|1.e-7)
640650
///
641-
/// #@variant_if math:numerical_library/with_std
651+
/// #@variant_if math:numerical_library/with_std|true
642652
/// # This variant directive starts a conditional block of property directives.
643653
/// # The block is activated if and only if the "math:numerical_library/with_std"
644654
/// # variant condition is set. This directive implies the use of a matching
@@ -660,6 +670,7 @@ namespace datatools {
660670
/// #@variant_endif # End of the variant conditional block of property directives
661671
/// # Optionaly the '#@variant_endif' can specify the variant condition is refers to :
662672
/// # #@variant_endif math:numerical_library/with_std
673+
/// # Variant conditional blocks can be nested.
663674
///
664675
/// #@description The Pi constant in explicit angular unit
665676
/// # The variant system provides three different options associated to the
@@ -965,6 +976,12 @@ namespace datatools {
965976
//! Check if data with name 'prop_key_' is public
966977
bool is_public(const std::string & prop_key_) const;
967978

979+
//! Return the type of the data
980+
int get_type(const std::string & prop_key_) const;
981+
982+
/// Get a string label associated to the type of the data
983+
std::string get_type_label(const std::string & prop_key_) const;
984+
968985
//! Check if data with name 'prop_key_' is boolean
969986
bool is_boolean(const std::string & prop_key_) const;
970987

0 commit comments

Comments
 (0)