I’m trying to write a program that allows a user to have a simple helper class that inherits from a provided helper class (which is embedded in the program and takes care of a number of default things).
So the way things look right now, I have the main program do a number of things, load all the input files into a chain, then it creates an RDataFrame with that chain as input and hands it over to a helper class.
This helper class was automatically compiled and loaded at run-time and is of type myHelper
which inherits from baseHelper
, and ROOT::Detail::RDF::RActionImpl<myHelper>
. baseHelper
inherits from ROOT::Detail::RDF::RActionImpl<baseHelper>
and is the only helper class known at compile time. As such the code that load (and or compiles) the myHelper
class casts the pointer of the new helper to a baseHelper
pointer. This pointer is then used to call a function that takes the RDataFrame as input and books itself as the action (using the appropriate template classes for this specific helper action). This all works fine, and all the user specific code gets called at the initialization stage. But when it comes to the data processing stage, only baseHelper::Exec
gets called, not myHelper::Exec
.
My main question here is am I even on the right track with the way I’m doing this or is this impossible with the way RDataFrame works? Mainly with the way RDataFrame::Book
takes an r-value reference of the helper class, could this result in object slicing and be the cause why this approach just can’t work? Or am I just doing another dumb mistake and this should work in principle?