Belle II Software  release-08-01-10
Path Class Reference

Implements a path consisting of Module and/or Path objects. More...

#include <Path.h>

Inheritance diagram for Path:
Collaboration diagram for Path:

Public Member Functions

 Path ()
 Constructor.
 
 ~Path ()
 Destructor.
 
void addModule (const std::shared_ptr< Module > &module)
 Adds a module to the path. More...
 
bool isEmpty () const
 Returns true if this Path doesn't contain any elements.
 
std::list< std::shared_ptr< Module > > getModules () const override
 Returns a list of the modules in this path. More...
 
std::list< std::shared_ptr< Module > > buildModulePathList (bool unique=true) const
 Builds a list of all modules which could be executed during the data processing. More...
 
void putModules (const std::list< std::shared_ptr< Module > > &mlist)
 Replaces all Modules and sub-Paths with the specified Module list.
 
bool contains (const std::string &moduleType) const
 Does this Path contain a module of the given type? More...
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this path, recreating all contained modules with the same parameters. More...
 
void addPath (const PathPtr &path)
 See 'pydoc3 basf2.Path'.
 
void forEach (const std::string &loopObjectName, const std::string &arrayName, PathPtr path)
 See 'pydoc3 basf2.Path'.
 
void doWhile (PathPtr path, const std::string &condition, unsigned int maxIterations)
 See 'pydoc3 basf2.Path'.
 
void addIndependentPath (const PathPtr &independent_path, std::string ds_ID, const boost::python::list &merge_back)
 See 'pydoc3 basf2.Path'.
 
void addIndependentMergePath (const PathPtr &independent_path, std::string ds_ID, const boost::python::list &merge_back, std::string consistency_check, bool event_mixing, bool mergeSameFile)
 See 'pydoc3 basf2.Path'.
 
std::string getPathString () const override
 return a string of the form [module a -> module b -> [another path]] More...
 

Static Public Member Functions

static void exposePythonAPI ()
 Exposes methods of the Path class to Python.
 

Private Attributes

std::list< std::shared_ptr< PathElement > > m_elements
 The list of path elements (Modules and sub-Paths)
 

Friends

class PathIterator
 

Detailed Description

Implements a path consisting of Module and/or Path objects.

The modules are arranged in a linear order.

Definition at line 38 of file Path.h.

Member Function Documentation

◆ addModule()

void addModule ( const std::shared_ptr< Module > &  module)

Adds a module to the path.

The module is added to the path by inserting it to the end of the list of modules.

See 'pydoc3 basf2.Path' for the complete documentation.

Parameters
moduleModule that should be added to the path.

Definition at line 32 of file Path.cc.

33 {
34  m_elements.push_back(module);
35 }
std::list< std::shared_ptr< PathElement > > m_elements
The list of path elements (Modules and sub-Paths)
Definition: Path.h:137

◆ buildModulePathList()

ModulePtrList buildModulePathList ( bool  unique = true) const

Builds a list of all modules which could be executed during the data processing.

The method starts with the current path, iterates over the modules in the path and follows recursively module conditions to make sure the final list contains all modules which could be executed while preserving their correct order.

Parameters
uniqueIf true, the list will be unique.
Returns
A list containing all modules which could be executed during the data processing.

Definition at line 67 of file Path.cc.

◆ clone()

std::shared_ptr< PathElement > clone ( ) const
overridevirtual

Create an independent copy of this path, recreating all contained modules with the same parameters.

Note that parameters are shared, so changing them on a module in the cloned path will also affect the module in the original path.

Implements PathElement.

Definition at line 186 of file Path.cc.

◆ contains()

bool contains ( const std::string &  moduleType) const

Does this Path contain a module of the given type?

Useable in Python via '"ModuleType" in path' syntax.

Definition at line 178 of file Path.cc.

◆ getModules()

std::list< ModulePtr > getModules ( ) const
overridevirtual

Returns a list of the modules in this path.

(Recursively searches sub-paths)

Implements PathElement.

Definition at line 50 of file Path.cc.

◆ getPathString()

std::string getPathString ( ) const
overridevirtual

return a string of the form [module a -> module b -> [another path]]

can be used to 'print' a path in a steering file.

Implements PathElement.

Definition at line 206 of file Path.cc.


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