From f0732322c317c1feba753aefa22714c0fc8b7998 Mon Sep 17 00:00:00 2001 From: raiqarasool Date: Mon, 16 Dec 2024 17:53:42 -0500 Subject: [PATCH] Modified JANA2 JObject::Get() to mimic the behaviour of JANA1 Get with paramrams --- src/libraries/JANA/JObject.h | 37 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/libraries/JANA/JObject.h b/src/libraries/JANA/JObject.h index f353a5735..371baa6ca 100644 --- a/src/libraries/JANA/JObject.h +++ b/src/libraries/JANA/JObject.h @@ -217,24 +217,25 @@ std::vector JObject::Get() const { /// Returns a vector of pointers to all associated objects of type T. std::vector results; - for (auto obj : associated) { - const T* t = dynamic_cast(obj); - if (t != nullptr) { - results.push_back(t); - } - } - if (results.empty()) { - // If nothing found, attempt matching by strings. - // Why? Because dl and RTTI aren't playing nicely together; - // each plugin might assign a different typeid to the same class. - - std::string classname = JTypeInfo::demangle(); - for (auto obj : associated) { - if (obj->className() == classname) { - results.push_back(reinterpret_cast(obj)); - } - } - } + // for (auto obj : associated) { + // const T* t = dynamic_cast(obj); + // if (t != nullptr) { + // results.push_back(t); + // } + // } + // if (results.empty()) { + // // If nothing found, attempt matching by strings. + // // Why? Because dl and RTTI aren't playing nicely together; + // // each plugin might assign a different typeid to the same class. + + // std::string classname = JTypeInfo::demangle(); + // for (auto obj : associated) { + // if (obj->className() == classname) { + // results.push_back(reinterpret_cast(obj)); + // } + // } + // } + Get(results); return results; }