GRSISort
Created by P.C. Bender
Developement Team: P.C. Bender, R. Dunlop, V. Bildstein
An extension of the ROOT analysis Framework
TDataLoop Class Reference

This loop reads raw events from a raw file.

Definition at line 32 of file TDataLoop.h.

Public Member Functions

 ~TDataLoop () override
 
void ClearQueue () override
 
virtual std::string EndStatus ()
 
size_t GetItemsCurrent () override
 
size_t GetItemsPopped () override
 
size_t GetItemsPushed () override
 
size_t GetRate () override
 
bool GetSelfStopping () const
 
const TRawFileGetSource () const
 
bool IsPaused ()
 
bool IsRunning ()
 
bool Iteration () override
 
void Join ()
 
std::string Name () const
 
void OnEnd () override
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< TRawEvent > > > & OutputQueue ()
 
void Pause ()
 
virtual std::string Progress ()
 
void ReplaceSource (TRawFile *new_source)
 
void ResetSource ()
 
void Resume ()
 
void SetSelfStopping (bool self_stopping)
 
virtual std::string Status ()
 
void Stop ()
 

Static Public Member Functions

static std::string AllThreadHeader ()
 
static std::string AllThreadProgress ()
 
static std::string AllThreadStatus ()
 
static bool AnyThreadRunning ()
 
static std::string AnyThreadStatus ()
 
static void ClearAllQueues ()
 
static void ColumnWidth (size_t val)
 
static size_t ColumnWidth ()
 
static TDataLoopGet (std::string name="", TRawFile *source=nullptr)
 
static StoppableThreadGet (const std::string &name)
 
static std::vector< StoppableThread * > GetAll ()
 
static int GetNThreads ()
 
static void join_status_thread ()
 
static void PauseAll ()
 
static void Print ()
 
static void ResumeAll ()
 
static void SendStop ()
 
static void start_status_thread ()
 
static void status_out ()
 
static void status_out_loop ()
 
static void StatusWidth (size_t val)
 
static size_t StatusWidth ()
 
static void stop_status_thread ()
 
static void StopAll ()
 

Static Public Attributes

static std::thread fStatusThread
 
static bool fStatusThreadOn = false
 

Protected Attributes

std::atomic_long fInputSize {0}
 
std::atomic_size_t fItemsPopped {0}
 
std::string fName
 

Static Protected Attributes

static std::map< std::string, StoppableThread * > fThreadMap
 

Private Member Functions

 TDataLoop (std::string name, TRawFile *source)
 
 TDataLoop ()
 
 TDataLoop (const TDataLoop &other)
 
 ClassDefOverride (TDataLoop, 0)
 
TDataLoopoperator= (const TDataLoop &other)
 

Private Attributes

size_t fEventsRead
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< TRawEvent > > > fOutputQueue
 
bool fSelfStopping
 
TRawFilefSource
 
std::mutex fSourceMutex
 

#include <TDataLoop.h>

+ Inheritance diagram for TDataLoop:
+ Collaboration diagram for TDataLoop:

Constructor & Destructor Documentation

◆ ~TDataLoop()

TDataLoop::~TDataLoop ( )
override

Definition at line 21 of file TDataLoop.cxx.

◆ TDataLoop() [1/3]

TDataLoop::TDataLoop ( std::string  name,
TRawFile source 
)
private

Definition at line 15 of file TDataLoop.cxx.

◆ TDataLoop() [2/3]

TDataLoop::TDataLoop ( )
private

Referenced by Get().

◆ TDataLoop() [3/3]

TDataLoop::TDataLoop ( const TDataLoop other)
private

Member Function Documentation

◆ AllThreadHeader()

std::string StoppableThread::AllThreadHeader ( )
staticinherited

◆ AllThreadProgress()

std::string StoppableThread::AllThreadProgress ( )
staticinherited

◆ AllThreadStatus()

std::string StoppableThread::AllThreadStatus ( )
staticinherited

◆ AnyThreadRunning()

bool StoppableThread::AnyThreadRunning ( )
staticinherited

◆ AnyThreadStatus()

std::string StoppableThread::AnyThreadStatus ( )
staticinherited

Definition at line 47 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

◆ ClassDefOverride()

TDataLoop::ClassDefOverride ( TDataLoop  ,
 
)
private

◆ ClearAllQueues()

void StoppableThread::ClearAllQueues ( )
staticinherited

Definition at line 166 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by TGRSIInterruptHandler::Notify().

◆ ClearQueue()

void TDataLoop::ClearQueue ( )
overridevirtual

Reimplemented from StoppableThread.

Definition at line 38 of file TDataLoop.cxx.

References fOutputQueue.

◆ ColumnWidth() [1/2]

static void StoppableThread::ColumnWidth ( size_t  val)
inlinestaticinherited

Definition at line 75 of file StoppableThread.h.

References StoppableThread::fColumnWidth.

◆ ColumnWidth() [2/2]

static size_t StoppableThread::ColumnWidth ( )
inlinestaticinherited

Definition at line 77 of file StoppableThread.h.

References StoppableThread::fColumnWidth.

Referenced by TGRSIint::SetupPipeline().

◆ EndStatus()

virtual std::string StoppableThread::EndStatus ( )
inlinevirtualinherited

◆ Get() [1/2]

TDataLoop * TDataLoop::Get ( std::string  name = "",
TRawFile source = nullptr 
)
static

Definition at line 26 of file TDataLoop.cxx.

References StoppableThread::Get(), and TDataLoop().

Referenced by TGRSIint::SetupPipeline().

◆ Get() [2/2]

◆ GetAll()

std::vector< StoppableThread * > StoppableThread::GetAll ( )
staticinherited

Definition at line 315 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

◆ GetItemsCurrent()

size_t TDataLoop::GetItemsCurrent ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 50 of file TDataLoop.h.

References fOutputQueue.

◆ GetItemsPopped()

size_t TDataLoop::GetItemsPopped ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 49 of file TDataLoop.h.

References fOutputQueue.

◆ GetItemsPushed()

size_t TDataLoop::GetItemsPushed ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 48 of file TDataLoop.h.

References fOutputQueue.

◆ GetNThreads()

int StoppableThread::GetNThreads ( )
staticinherited

Definition at line 21 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by StoppableThread::Print().

◆ GetRate()

size_t TDataLoop::GetRate ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 51 of file TDataLoop.h.

◆ GetSelfStopping()

bool TDataLoop::GetSelfStopping ( ) const
inline

Definition at line 57 of file TDataLoop.h.

References fSelfStopping.

◆ GetSource()

const TRawFile& TDataLoop::GetSource ( ) const
inline

Definition at line 41 of file TDataLoop.h.

References fSource.

◆ IsPaused()

bool StoppableThread::IsPaused ( )
inherited

Definition at line 224 of file StoppableThread.cxx.

References StoppableThread::fPaused.

◆ IsRunning()

bool StoppableThread::IsRunning ( )
inherited

Definition at line 219 of file StoppableThread.cxx.

References StoppableThread::fRunning.

Referenced by StoppableThread::status_out().

◆ Iteration()

◆ Join()

void StoppableThread::Join ( )
inherited

◆ join_status_thread()

void StoppableThread::join_status_thread ( )
staticinherited

◆ Name()

std::string StoppableThread::Name ( ) const
inlineinherited

◆ OnEnd()

void TDataLoop::OnEnd ( )
overridevirtual

Reimplemented from StoppableThread.

Definition at line 60 of file TDataLoop.cxx.

References fOutputQueue.

◆ operator=()

TDataLoop& TDataLoop::operator= ( const TDataLoop other)
private

◆ OutputQueue()

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<TRawEvent> > >& TDataLoop::OutputQueue ( )
inline

Definition at line 38 of file TDataLoop.h.

References fOutputQueue.

Referenced by TGRSIint::SetupPipeline().

◆ Pause()

void StoppableThread::Pause ( )
inherited

Definition at line 202 of file StoppableThread.cxx.

References StoppableThread::fPaused, and StoppableThread::fRunning.

◆ PauseAll()

void StoppableThread::PauseAll ( )
staticinherited

Definition at line 97 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

◆ Print()

void StoppableThread::Print ( )
staticinherited

◆ Progress()

std::string StoppableThread::Progress ( )
virtualinherited

◆ ReplaceSource()

void TDataLoop::ReplaceSource ( TRawFile new_source)

Definition at line 46 of file TDataLoop.cxx.

References fSource, and fSourceMutex.

◆ ResetSource()

void TDataLoop::ResetSource ( )

Definition at line 53 of file TDataLoop.cxx.

◆ Resume()

void StoppableThread::Resume ( )
inherited

◆ ResumeAll()

void StoppableThread::ResumeAll ( )
staticinherited

Definition at line 104 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by TGRSIint::SetupPipeline().

◆ SendStop()

void StoppableThread::SendStop ( )
staticinherited

◆ SetSelfStopping()

void TDataLoop::SetSelfStopping ( bool  self_stopping)
inline

Definition at line 56 of file TDataLoop.h.

References fSelfStopping.

Referenced by TGRSIint::SetupPipeline().

◆ start_status_thread()

void StoppableThread::start_status_thread ( )
staticinherited

◆ Status()

std::string StoppableThread::Status ( )
virtualinherited

◆ status_out()

◆ status_out_loop()

void StoppableThread::status_out_loop ( )
staticinherited

◆ StatusWidth() [1/2]

static void StoppableThread::StatusWidth ( size_t  val)
inlinestaticinherited

Definition at line 76 of file StoppableThread.h.

References StoppableThread::fStatusWidth.

◆ StatusWidth() [2/2]

static size_t StoppableThread::StatusWidth ( )
inlinestaticinherited

Definition at line 78 of file StoppableThread.h.

References StoppableThread::fStatusWidth.

Referenced by TGRSIint::SetupPipeline().

◆ Stop()

◆ stop_status_thread()

void StoppableThread::stop_status_thread ( )
staticinherited

◆ StopAll()

void StoppableThread::StopAll ( )
staticinherited

Member Data Documentation

◆ fEventsRead

size_t TDataLoop::fEventsRead
private

Definition at line 67 of file TDataLoop.h.

Referenced by Iteration().

◆ fInputSize

◆ fItemsPopped

◆ fName

std::string StoppableThread::fName
protectedinherited

◆ fOutputQueue

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<TRawEvent> > > TDataLoop::fOutputQueue
private

◆ fSelfStopping

bool TDataLoop::fSelfStopping
private

Definition at line 66 of file TDataLoop.h.

Referenced by GetSelfStopping(), Iteration(), and SetSelfStopping().

◆ fSource

TRawFile* TDataLoop::fSource
private

Definition at line 65 of file TDataLoop.h.

Referenced by GetSource(), Iteration(), and ReplaceSource().

◆ fSourceMutex

std::mutex TDataLoop::fSourceMutex
private

Definition at line 71 of file TDataLoop.h.

Referenced by Iteration(), and ReplaceSource().

◆ fStatusThread

std::thread StoppableThread::fStatusThread
staticinherited

◆ fStatusThreadOn

◆ fThreadMap