Skip to content

Commit

Permalink
Added ability to get parameter as a std::array
Browse files Browse the repository at this point in the history
The underlying type is still an std::vector but it gets converted
during the call to get(Untracked)Parameter.
  • Loading branch information
Dr15Jones committed Sep 10, 2020
1 parent d1f735a commit b4a8112
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 100 deletions.
5 changes: 2 additions & 3 deletions FWCore/Integration/test/ProducerWithPSetDesc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/getFixedSizeArray.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/ParameterSet/interface/ParameterDescriptionBase.h"
#include "FWCore/ParameterSet/interface/ParameterDescription.h"
Expand Down Expand Up @@ -80,10 +79,10 @@ namespace edmtest {
vint = ps.getParameter<std::vector<int>>("vint3");
assert(vint[0] == 2147483647);
assert(vint[1] == -2147483647);
std::array<int, 2> testArray = edm::getFixedSizeArray<int, 2>(ps, std::string("vint3"));
std::array<int, 2> testArray = ps.getParameter<std::array<int, 2>>(std::string("vint3"));
assert(testArray[0] == 2147483647);
assert(testArray[1] == -2147483647);
std::array<int, 2> testArray1 = edm::getFixedSizeArray<int, 2>(ps, "vint3");
std::array<int, 2> testArray1 = ps.getParameter<std::array<int, 2>>("vint3");
assert(testArray1[0] == 2147483647);
assert(testArray1[1] == -2147483647);
vint = ps.getParameter<std::vector<int>>("vint4");
Expand Down
Loading

0 comments on commit b4a8112

Please sign in to comment.