Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:45

0001 /// \file ROOT/RNTupleImtTaskScheduler.hxx
0002 /// \ingroup NTuple ROOT7
0003 /// \author Jakob Blomer <jblomer@cern.ch>
0004 /// \date 2024-02-19
0005 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
0006 /// is welcome!
0007 
0008 /*************************************************************************
0009  * Copyright (C) 1995-2024, Rene Brun and Fons Rademakers.               *
0010  * All rights reserved.                                                  *
0011  *                                                                       *
0012  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0013  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0014  *************************************************************************/
0015 
0016 #ifndef ROOT7_RNTupleImtTaskScheduler
0017 #define ROOT7_RNTupleImtTaskScheduler
0018 
0019 #ifdef R__USE_IMT
0020 
0021 #include <ROOT/RPageStorage.hxx>
0022 #include <ROOT/TTaskGroup.hxx>
0023 
0024 #include <functional>
0025 #include <utility>
0026 
0027 namespace ROOT {
0028 namespace Experimental {
0029 
0030 namespace Internal {
0031 
0032 class RNTupleImtTaskScheduler : public RPageStorage::RTaskScheduler {
0033 private:
0034    TTaskGroup fTaskGroup;
0035 
0036 public:
0037    RNTupleImtTaskScheduler() = default;
0038    ~RNTupleImtTaskScheduler() override = default;
0039    void AddTask(const std::function<void(void)> &taskFunc) final { fTaskGroup.Run(taskFunc); }
0040    void Wait() final { fTaskGroup.Wait(); }
0041 };
0042 
0043 } // namespace Internal
0044 } // namespace Experimental
0045 } // namespace ROOT
0046 
0047 #endif // R__USE_IMT
0048 #endif // ROOT7_RNTupleImtTaskScheduler