Skip to content
Snippets Groups Projects

Rich Conditions - Use nlohmann::json

Merged Christopher Rob Jones requested to merge jonrob/LHCb:rich-conds-use-nlohmann-json into master
All threads resolved!
4 files
+ 82
2
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -21,6 +21,7 @@
#include <GaudiKernel/detected.h>
#include <Kernel/STLExtensions.h>
#include <LbDD4hep/IDD4hepSvc.h>
#include <LbDD4hep/utils.h>
#include <any>
#include <stdexcept>
#include <type_traits>
@@ -139,7 +140,9 @@ namespace LHCb::Det::LbDD4hep {
return T( cond );
} else {
using DT = std::decay_t<T>;
if constexpr ( !detail::PassAsAny<DT>::value ) {
if constexpr ( std::is_same_v<DT, nlohmann::json> ) {
return utils::y2j( cond.get<YAML::Node>() );
} else if constexpr ( !detail::PassAsAny<DT>::value ) {
return cond.get<DT>();
} else {
const DT* p = nullptr;
Loading