11 #ifndef ROOT_TDATASOURCE 12 #define ROOT_TDATASOURCE 21 namespace Experimental {
58 virtual void SetNSlots(
unsigned int nSlots) = 0;
61 virtual const std::vector<std::string> &
GetColumnNames()
const = 0;
81 std::vector<T **> typedVec(typeErasedVec.size());
82 std::transform(typeErasedVec.begin(), typeErasedVec.end(), typedVec.begin(),
83 [](
void *p) {
return static_cast<T **
>(p); });
90 virtual std::vector<std::pair<ULong64_t, ULong64_t>>
GetEntryRanges() = 0;
123 virtual std::vector<void *>
131 #endif // ROOT_TDATASOURCE virtual ~TDataSource()=default
virtual void InitSlot(unsigned int, ULong64_t)
Convenience method called at the start of the data processing associated to a slot.
basic_string_view< char > string_view
Namespace for new ROOT classes and functions.
virtual std::vector< void * > GetColumnReadersImpl(std::string_view name, const std::type_info &)=0
type-erased vector of pointers to pointers to column values - one per slot
virtual void SetNSlots(unsigned int nSlots)=0
Inform TDataSource of the number of processing slots (i.e.
virtual void Initialise()
Convenience method called before starting an event-loop.
virtual std::vector< std::pair< ULong64_t, ULong64_t > > GetEntryRanges()=0
Return ranges of entries to distribute to tasks.
TDataSource defines an API that TDataFrame can use to read arbitrary data formats.
virtual void Finalise()
Convenience method called after concluding an event-loop.
virtual std::string GetTypeName(std::string_view) const =0
Type of a column as a string, e.g.
unsigned long long ULong64_t
virtual void SetEntry(unsigned int slot, ULong64_t entry)=0
Advance the "cursors" returned by GetColumnReaders to the selected entry for a particular slot...
std::vector< T ** > GetColumnReaders(std::string_view columnName)
Called at most once per column by TDF.
virtual void FinaliseSlot(unsigned int)
Convenience method called at the end of the data processing associated to a slot. ...
virtual bool HasColumn(std::string_view) const =0
Checks if the dataset has a certain column.
virtual const std::vector< std::string > & GetColumnNames() const =0
Returns a reference to the collection of the dataset's column names.