diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 8af872a64176d..be6329b48b7eb 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -46,7 +46,7 @@ std::string strToUpper(std::string&& str); namespace o2::soa { void accessingInvalidIndexFor(const char* getter); -void dereferenceWithWrongType(); +void dereferenceWithWrongType(const char* getter, const char* target); void missingFilterDeclaration(int hash, int ai); void notBoundTable(const char* tableName); } // namespace o2::soa @@ -2473,7 +2473,7 @@ consteval auto getIndexTargets() } \ auto t = mBinding.get(); \ if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ + o2::soa::dereferenceWithWrongType(#_Getter_, #_Table_); \ } \ if (O2_BUILTIN_UNLIKELY(!has_##_Getter_())) { \ return t->emptySlice(); \ @@ -2558,7 +2558,7 @@ consteval auto getIndexTargets() } \ auto t = mBinding.get(); \ if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ + o2::soa::dereferenceWithWrongType(#_Getter_, #_Table_); \ } \ return getIterators(); \ } \ @@ -2571,7 +2571,7 @@ consteval auto getIndexTargets() } \ auto t = mBinding.get(); \ if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ + o2::soa::dereferenceWithWrongType(#_Getter_, #_Table_); \ } \ return getFilteredIterators(); \ } \ @@ -2617,7 +2617,7 @@ consteval auto getIndexTargets() } \ auto t = mBinding.get(); \ if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ + o2::soa::dereferenceWithWrongType(#_Getter_, #_Table_); \ } \ return t->rawIteratorAt((*mColumnIterator)[0]); \ } \ @@ -2630,7 +2630,7 @@ consteval auto getIndexTargets() } \ auto t = mBinding.get(); \ if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ + o2::soa::dereferenceWithWrongType(#_Getter_, #_Table_); \ } \ return t->rawIteratorAt((*mColumnIterator).back()); \ } \ @@ -2715,7 +2715,7 @@ consteval auto getIndexTargets() } \ auto t = mBinding.get(); \ if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ + o2::soa::dereferenceWithWrongType(#_Getter_, #_Table_); \ } \ return t->rawIteratorAt(*mColumnIterator); \ } \ @@ -2793,7 +2793,7 @@ consteval auto getIndexTargets() } \ auto t = mBinding.get(); \ if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ + o2::soa::dereferenceWithWrongType(#_Getter_, "self"); \ } \ return t->rawIteratorAt(*mColumnIterator); \ } \ @@ -2851,7 +2851,7 @@ consteval auto getIndexTargets() { \ auto t = mBinding.get(); \ if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ + o2::soa::dereferenceWithWrongType(#_Getter_, "self"); \ } \ if (O2_BUILTIN_UNLIKELY(!has_##_Getter_())) { \ return t->emptySlice(); \ @@ -2912,7 +2912,7 @@ consteval auto getIndexTargets() { \ auto t = mBinding.get(); \ if (O2_BUILTIN_UNLIKELY(t == nullptr)) { \ - o2::soa::dereferenceWithWrongType(); \ + o2::soa::dereferenceWithWrongType(#_Getter_, "self"); \ } \ return getIterators(); \ } \ diff --git a/Framework/Core/src/ASoA.cxx b/Framework/Core/src/ASoA.cxx index a37d0f33891e7..8f509ea17d2ba 100644 --- a/Framework/Core/src/ASoA.cxx +++ b/Framework/Core/src/ASoA.cxx @@ -21,9 +21,9 @@ void accessingInvalidIndexFor(const char* getter) { throw o2::framework::runtime_error_f("Accessing invalid index for %s", getter); } -void dereferenceWithWrongType() +void dereferenceWithWrongType(const char* getter, const char* target) { - throw o2::framework::runtime_error_f("Trying to dereference index with a wrong type in _as<>. Note that if you have several compatible index targets in your process() signature, the last one will be the one actually bound to the getter."); + throw o2::framework::runtime_error_f("Trying to dereference index with a wrong type in %s_as for base target \"%s\". Note that if you have several compatible index targets in your process() signature, the last one will be the one actually bound.", getter, target); } void missingFilterDeclaration(int hash, int ai) {