Project
Loading...
Searching...
No Matches
o2::framework::AlgorithmSpec Struct Reference

#include <AlgorithmSpec.h>

Public Types

using ProcessCallback = std::function< void(ProcessingContext &)>
 
using InitCallback = std::function< ProcessCallback(InitContext &)>
 
using ErrorCallback = std::function< void(ErrorContext &)>
 
using InitErrorCallback = std::function< void(InitErrorContext &)>
 

Public Member Functions

 AlgorithmSpec ()=default
 
 AlgorithmSpec (AlgorithmSpec &&)=default
 
 AlgorithmSpec (const AlgorithmSpec &)=default
 
 AlgorithmSpec (AlgorithmSpec &)=default
 
AlgorithmSpecoperator= (const AlgorithmSpec &)=default
 
 AlgorithmSpec (ProcessCallback process, ErrorCallback &error=emptyErrorCallback())
 
 AlgorithmSpec (InitCallback init, ErrorCallback &error=emptyErrorCallback(), InitErrorCallback &initError=emptyInitErrorCallback())
 

Static Public Member Functions

static AlgorithmSpec dummyAlgorithm ()
 
static ErrorCallbackemptyErrorCallback ()
 
static InitErrorCallbackemptyInitErrorCallback ()
 

Public Attributes

InitCallback onInit = nullptr
 
ProcessCallback onProcess = nullptr
 
ErrorCallback onError = nullptr
 
InitErrorCallback onInitError = nullptr
 

Detailed Description

This is the class holding the actual algorithm to be used. Notice that the InitCallback can be used to define stateful data as it returns a ProcessCallback which will be invoked to do the data processing. For example if you want to have some geometry available at process time, but of course you do not want to initialise it at every creation, you can do:

AlgorithmSpec{InitCallback{
  static Geometry geo; // this will last like the whole job
  return [&geo] {
      /// Do something with the geometry
      ///
  }
}
}

FIXME: we should probably return also a function to handle EXIT transition...

Definition at line 43 of file AlgorithmSpec.h.

Member Typedef Documentation

◆ ErrorCallback

Definition at line 46 of file AlgorithmSpec.h.

◆ InitCallback

Definition at line 45 of file AlgorithmSpec.h.

◆ InitErrorCallback

Definition at line 47 of file AlgorithmSpec.h.

◆ ProcessCallback

Definition at line 44 of file AlgorithmSpec.h.

Constructor & Destructor Documentation

◆ AlgorithmSpec() [1/6]

o2::framework::AlgorithmSpec::AlgorithmSpec ( )
default

◆ AlgorithmSpec() [2/6]

o2::framework::AlgorithmSpec::AlgorithmSpec ( AlgorithmSpec &&  )
default

◆ AlgorithmSpec() [3/6]

o2::framework::AlgorithmSpec::AlgorithmSpec ( const AlgorithmSpec )
default

◆ AlgorithmSpec() [4/6]

o2::framework::AlgorithmSpec::AlgorithmSpec ( AlgorithmSpec )
default

◆ AlgorithmSpec() [5/6]

o2::framework::AlgorithmSpec::AlgorithmSpec ( ProcessCallback  process,
ErrorCallback error = emptyErrorCallback() 
)
inline

Definition at line 60 of file AlgorithmSpec.h.

◆ AlgorithmSpec() [6/6]

o2::framework::AlgorithmSpec::AlgorithmSpec ( InitCallback  init,
ErrorCallback error = emptyErrorCallback(),
InitErrorCallback initError = emptyInitErrorCallback() 
)
inline

Definition at line 68 of file AlgorithmSpec.h.

Member Function Documentation

◆ dummyAlgorithm()

AlgorithmSpec o2::framework::AlgorithmSpec::dummyAlgorithm ( )
static

Definition at line 16 of file AlgorithmSpec.cxx.

◆ emptyErrorCallback()

AlgorithmSpec::ErrorCallback & o2::framework::AlgorithmSpec::emptyErrorCallback ( )
static

Definition at line 21 of file AlgorithmSpec.cxx.

◆ emptyInitErrorCallback()

AlgorithmSpec::InitErrorCallback & o2::framework::AlgorithmSpec::emptyInitErrorCallback ( )
static

Definition at line 27 of file AlgorithmSpec.cxx.

◆ operator=()

AlgorithmSpec & o2::framework::AlgorithmSpec::operator= ( const AlgorithmSpec )
default

Member Data Documentation

◆ onError

ErrorCallback o2::framework::AlgorithmSpec::onError = nullptr

Definition at line 78 of file AlgorithmSpec.h.

◆ onInit

InitCallback o2::framework::AlgorithmSpec::onInit = nullptr

Definition at line 76 of file AlgorithmSpec.h.

◆ onInitError

InitErrorCallback o2::framework::AlgorithmSpec::onInitError = nullptr

Definition at line 79 of file AlgorithmSpec.h.

◆ onProcess

ProcessCallback o2::framework::AlgorithmSpec::onProcess = nullptr

Definition at line 77 of file AlgorithmSpec.h.


The documentation for this struct was generated from the following files: