Project

General

Profile

Feature #11106

Feature #9078: ParameterSet validation enhancements

Feature #8962: Create 'TupleAs' class that supports FHiCL-to-C++ conversion

Redesign fhiclcpp parameter registration system

Added by Kyle Knoepfel over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
12/08/2015
Due date:
% Done:

100%

Estimated time:
60.00 h
Spent time:
Duration:

Description

In order to more easily support extensions to the fhiclcpp parameter system, which enables configuration validation and description, the parameter registration system must be redesigned so that only the parameters that must be registered due to C++ limitations actually are.

History

#1 Updated by Kyle Knoepfel over 3 years ago

  • Status changed from New to Assigned

#2 Updated by Kyle Knoepfel over 3 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

The redesign was implemented with fhicl-cpp:ed42628. To summarize the changes:

  • All parameters used to be registered at construction time. Since stack-variable addresses were being used, this resulted in unnecessarily complicated memory handling. To remove this complication, heap-memory was used instead, where the std::shared_ptr<T> is used to manage it.
  • To facilitate the above change, the c'tor signatures for the Sequence<T(,N)> and Tuple<T...> parameters needed to be adjusted -- if specifying a default value for sequences is desired, the return type should be used:
    - Sequence<int> nums { Name("nums"), Sequence<int>{1, 3, 5} };
    + Sequence<int> nums { Name("nums"), std::vector<int>{1, 3, 5} };
      Sequence<int> nums { Name("nums"), {1,3,5} }; // brace-enclosed
    
    - Tuple<string, int> pair { Name("pair"), Tuple<string,int>{"foo", 3} };
    + Tuple<string, int> pair { Name("pair"), std::tuple<string,int>{"foo", 3} };
      Tuple<string, int> pair { Name("pair"), {"foo", 3} }; // brace-enclosed
    
    Brace-enclosed default-values are still supported.
  • Now, only table-members are registered--i.e. a struct object's data members, which cannot be easily provided due to inadequate reflection support by C++.

#3 Updated by Kyle Knoepfel over 3 years ago

  • Target version changed from 2.01.00 to 1.17.05

#4 Updated by Kyle Knoepfel over 3 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF