Skip to content

Commit

Permalink
[datatools] Support array append and array item override modes from p…
Browse files Browse the repository at this point in the history
…roperties parser
  • Loading branch information
fmauger committed Jul 14, 2020
1 parent 88f05d8 commit 6f8ea67
Show file tree
Hide file tree
Showing 5 changed files with 514 additions and 96 deletions.
8 changes: 5 additions & 3 deletions release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Additions
=========

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

Expand Down
25 changes: 21 additions & 4 deletions source/bxdatatools/include/datatools/properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,12 @@ namespace datatools {
/// 1.2 \ # no space is allowed after '\'
/// 2.4 \ # no space is allowed after '\'
/// 4.8 # last value
///
/// #@description Here two more elements are appended to the original four items
/// in the 'guess_values' array so that it contains finally six elements.
/// In case of real values, the unit ('in UNITNAME') should be the same that
/// the one used for the previous definition in order to avoid confusion or inconsistency.
/// guess_values : real[2] in mm += 3.2 1.32
///
/// #@description Algorithm verbosity
/// logging : string = "mute" # no print at all
Expand All @@ -604,14 +610,18 @@ namespace datatools {
/// logging : string = "debug" # print debug messages
///
/// #@forbid_key_override # Special directive
/// # From this point, overriding already defined properties is forbidden.
/// # From this point, overriding already defined properties is forbidden again.
///
/// #@enable_variants
/// # Enable the parsing of variant preprocessor directives.
///
/// #@variant_only math:numerical_library/with_gsl
/// #@variant_only math:numerical_library/with_gsl|true
/// # This variant directive only applies to the next property directive
/// # if the "math:numerical_library/with_gsl" variant condition is set (boolean).
/// # if the "math:numerical_library/with_gsl" variant condition is set (boolean)
/// # where 'math' is the name of the target variant registry and
/// # 'numerical_library/with_gsl' is the path of a variant condition within
/// # this registry. The '|true' tag indicates that the condition should be
/// # considered as true if no variant system is activated.
/// #@description GSL error handling flag is set only if the GSL library is used
/// gsl_error_support : boolean = true
///
Expand All @@ -638,7 +648,7 @@ namespace datatools {
/// #
/// default_epsilon : real = @variant(math:tolerance/is_user/epsilon|1.e-7)
///
/// #@variant_if math:numerical_library/with_std
/// #@variant_if math:numerical_library/with_std|true
/// # This variant directive starts a conditional block of property directives.
/// # The block is activated if and only if the "math:numerical_library/with_std"
/// # variant condition is set. This directive implies the use of a matching
Expand All @@ -660,6 +670,7 @@ namespace datatools {
/// #@variant_endif # End of the variant conditional block of property directives
/// # Optionaly the '#@variant_endif' can specify the variant condition is refers to :
/// # #@variant_endif math:numerical_library/with_std
/// # Variant conditional blocks can be nested.
///
/// #@description The Pi constant in explicit angular unit
/// # The variant system provides three different options associated to the
Expand Down Expand Up @@ -965,6 +976,12 @@ namespace datatools {
//! Check if data with name 'prop_key_' is public
bool is_public(const std::string & prop_key_) const;

//! Return the type of the data
int get_type(const std::string & prop_key_) const;

/// Get a string label associated to the type of the data
std::string get_type_label(const std::string & prop_key_) const;

//! Check if data with name 'prop_key_' is boolean
bool is_boolean(const std::string & prop_key_) const;

Expand Down
Loading

0 comments on commit 6f8ea67

Please sign in to comment.