@@ -28,11 +28,12 @@ namespace detail::links {
2828 };
2929
3030 // / Simple struct tag for overload selection in LinkNavigator below
31- struct ReturnFromTag {};
31+ struct [[deprecated( " The tagged versions of getLinked are deprecated use getLinkedFrom instead " )]] ReturnFromTag {};
3232 // / Simple struct tag for overload selection in LinkNavigator below
33- struct ReturnToTag {};
33+ struct [[deprecated( " The tagged versions of getLinked are deprecated use getLinkedTo instead " )]] ReturnToTag {};
3434} // namespace detail::links
3535
36+ // / NOTE: This can go at the same time as the deprecated tags below are removed
3637#if !defined(__CLING__)
3738 #define INLCONSTEXPR inline constexpr
3839#else
@@ -41,11 +42,13 @@ namespace detail::links {
4142// / Tag variable to select the lookup of *From* objects have links with a *To*
4243// / object in podio::LinkNavigator::getLinked
4344// INLCONSTEXPR detail::links::ReturnFromTag ReturnFrom;
44- INLCONSTEXPR detail::links::ReturnFromTag ReturnFrom;
45+ [[deprecated(" The tagged versions of getLinked are deprecated use getLinkedFrom instead" )]] INLCONSTEXPR
46+ detail::links::ReturnFromTag ReturnFrom;
4547// / Tag variable to select the lookup of *To* objects that have links with a
4648// / *From* object in podio::LinkNavigator::getLinked
4749// INLCONSTEXPR detail::links::ReturnToTag ReturnTo;
48- INLCONSTEXPR detail::links::ReturnToTag ReturnTo;
50+ [[deprecated(" The tagged versions of getLinked are deprecated use getLinkedTo instead" )]] INLCONSTEXPR
51+ detail::links::ReturnToTag ReturnTo;
4952#undef INLCONSTEXPR
5053
5154// / A helper class to more easily handle one-to-many links.
@@ -92,7 +95,7 @@ class LinkNavigator {
9295 // /
9396 // / @returns A vector of all objects and their weights that have links with
9497 // / the passed object
95- std::vector<WeightedObject<FromT>> getLinked (const ToT& object, podio::detail::links::ReturnFromTag ) const {
98+ std::vector<WeightedObject<FromT>> getLinkedFrom (const ToT& object) const {
9699 const auto & [begin, end] = m_to2from.equal_range (object);
97100 std::vector<WeightedObject<FromT>> result;
98101 result.reserve (std::distance (begin, end));
@@ -103,9 +106,15 @@ class LinkNavigator {
103106 return result;
104107 }
105108
109+ [[deprecated(" Use getLinkedFrom instead" )]]
110+ std::vector<WeightedObject<FromT>> getLinked (const ToT& object, podio::detail::links::ReturnFromTag) const {
111+ return getLinkedFrom (object);
112+ }
113+
114+ [[deprecated(" Use getLinkedFrom instead" )]]
106115 std::vector<WeightedObject<FromT>> getLinked (const typename ToT::mutable_type& object,
107116 podio::detail::links::ReturnFromTag) const {
108- return getLinked (ToT (object), podio::ReturnFrom );
117+ return getLinkedFrom (ToT (object));
109118 }
110119
111120 // / Get all the *From* objects and weights that have links with the passed
@@ -122,15 +131,14 @@ class LinkNavigator {
122131 template <typename ToU = ToT>
123132 requires (!std::same_as<FromT, ToU>)
124133 std::vector<WeightedObject<FromT>> getLinked (const ToT& object) const {
125-
126- return getLinked (object, podio::ReturnFrom);
134+ return getLinkedFrom (object);
127135 }
128136
129137 // / Overload for cppyy that makes things work with mutable handles
130138 template <typename ToU = ToT>
131139 requires (!std::same_as<FromT, ToU>)
132140 std::vector<WeightedObject<FromT>> getLinked (const typename ToT::mutable_type& object) const {
133- return getLinked (ToT (object), podio::ReturnFrom );
141+ return getLinkedFrom (ToT (object));
134142 }
135143
136144 // / Get all the *To* objects and weights that have links with the passed
@@ -148,7 +156,7 @@ class LinkNavigator {
148156 // /
149157 // / @returns A vector of all objects and their weights that have links with
150158 // / the passed object
151- std::vector<WeightedObject<ToT>> getLinked (const FromT& object, podio::detail::links::ReturnToTag ) const {
159+ std::vector<WeightedObject<ToT>> getLinkedTo (const FromT& object) const {
152160 const auto & [begin, end] = m_from2to.equal_range (object);
153161 std::vector<WeightedObject<ToT>> result;
154162 result.reserve (std::distance (begin, end));
@@ -159,9 +167,15 @@ class LinkNavigator {
159167 return result;
160168 }
161169
170+ [[deprecated(" Use getLinkedTo instead" )]]
171+ std::vector<WeightedObject<ToT>> getLinked (const FromT& object, podio::detail::links::ReturnToTag) const {
172+ return getLinkedTo (object);
173+ }
174+
175+ [[deprecated(" Use getLinkedTo instead" )]]
162176 std::vector<WeightedObject<ToT>> getLinked (const typename FromT::mutable_type& object,
163177 podio::detail::links::ReturnToTag) const {
164- return getLinked (FromT (object), podio::ReturnTo );
178+ return getLinkedTo (FromT (object));
165179 }
166180
167181 // / Get all the *To* objects and weights that have links with the passed
@@ -178,14 +192,14 @@ class LinkNavigator {
178192 template <typename FromU = FromT>
179193 requires (!std::same_as<FromU, ToT>)
180194 std::vector<WeightedObject<ToT>> getLinked (const FromT& object) const {
181- return getLinked (object, podio::ReturnTo );
195+ return getLinkedTo (object);
182196 }
183197
184198 // / Overload for cppyy that makes things work with mutable handles
185199 template <typename FromU = FromT>
186200 requires (!std::same_as<FromU, ToT>)
187201 std::vector<WeightedObject<ToT>> getLinked (const typename FromT::mutable_type& object) const {
188- return getLinked (FromT (object), podio::ReturnTo );
202+ return getLinkedTo (FromT (object));
189203 }
190204
191205private:
0 commit comments