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

Collect information about the dependencies between modules. More...

#include <DependencyMap.h>

Collaboration diagram for DependencyMap:

Classes

struct  ModuleInfo
 Stores information on inputs/outputs of a module, as obtained by requireInput()/optionalInput()/registerEntry();. More...
 

Public Types

enum  EEntryType {
  c_Input ,
  c_OptionalInput ,
  c_Output ,
  c_NEntryTypes
}
 Possible types of entries/relations for a module. More...
 

Public Member Functions

bool isUsedAs (const std::string &branchName, EEntryType type) const
 Is the object/array/relation with given name used as specified input/output type (in any module)? More...
 
void setModule (const Module &mod)
 Set the current module (for getCurrentModuleInfo())
 
ModuleInfogetCurrentModuleInfo ()
 Get info for current module.
 
const std::map< std::string, ModuleInfo > & getModuleInfoMap () const
 return information on inputs/outputs of each module, as obtained by requireInput()/optionalInput()/registerEntry();
 
void clear ()
 Reset all collected data.
 

Static Public Member Functions

static std::string getModuleID (const Module &mod)
 Return unique ID for given module.
 

Private Attributes

std::map< std::string, ModuleInfom_moduleInfo
 Stores information on inputs/outputs of each module, as obtained by requireInput()/optionalInput()/registerEntry();.
 
std::string m_currentModule
 Stores the current module, used to fill m_moduleInfo.
 

Detailed Description

Collect information about the dependencies between modules.

Filled inside DataStore during register/require/optional, and used by the –visualize-dataflow and –module-io arguments to basf2 to create graphs of data dependencies.

See also
DataFlowVisualization

Definition at line 29 of file DependencyMap.h.

Member Enumeration Documentation

◆ EEntryType

enum EEntryType

Possible types of entries/relations for a module.

Enumerator
c_Input 

required input.

c_OptionalInput 

optional input.

c_Output 

registered output.

c_NEntryTypes 

size of this enum.

Definition at line 32 of file DependencyMap.h.

32  {
33  c_Input,
35  c_Output,
38  };
@ c_Input
required input.
Definition: DependencyMap.h:33
@ c_NEntryTypes
size of this enum.
Definition: DependencyMap.h:37
@ c_Output
registered output.
Definition: DependencyMap.h:35
@ c_OptionalInput
optional input.
Definition: DependencyMap.h:34

Member Function Documentation

◆ isUsedAs()

bool isUsedAs ( const std::string &  branchName,
EEntryType  type 
) const

Is the object/array/relation with given name used as specified input/output type (in any module)?

E.g. is('EventMetaData', c_Output) asks if EventMetaData was registered, is('EventMetaData', c_Input) asks if any module has it as required input.

Definition at line 29 of file DependencyMap.cc.

30 {
31  return any_of(m_moduleInfo.begin(), m_moduleInfo.end(),
32  [branchName, type](const pair<string, ModuleInfo>& info) {
33  if (info.second.entries[type].count(branchName))
34  return true;
35  return (bool)info.second.relations[type].count(branchName);
36  });
37 }
std::map< std::string, ModuleInfo > m_moduleInfo
Stores information on inputs/outputs of each module, as obtained by requireInput()/optionalInput()/re...
Definition: DependencyMap.h:73

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