Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ActsExamples::WhiteBoard Class Reference

#include <acts/blob/sPHENIX/Examples/Framework/include/ActsExamples/Framework/WhiteBoard.hpp>

+ Collaboration diagram for ActsExamples::WhiteBoard:

Classes

struct  HolderT
 
struct  IHolder
 

Public Member Functions

 WhiteBoard (std::unique_ptr< const Acts::Logger > logger=Acts::getDefaultLogger("WhiteBoard", Acts::Logging::INFO), std::unordered_map< std::string, std::string > objectAliases={})
 
 WhiteBoard (const WhiteBoard &other)=delete
 
WhiteBoardoperator= (const WhiteBoard &)=delete
 
bool exists (const std::string &name) const
 

Private Member Functions

template<typename T >
void add (const std::string &name, T &&object)
 
template<typename T >
const Tget (const std::string &name) const
 
std::vector< std::string_view > similarNames (const std::string_view &name, int distThreshold, std::size_t maxNumber) const
 Find similar names for suggestions with levenshtein-distance.
 
const Acts::Loggerlogger () const
 

Static Private Member Functions

static std::string typeMismatchMessage (const std::string &name, const char *req, const char *act)
 

Private Attributes

std::unique_ptr< const
Acts::Logger
m_logger
 
std::unordered_map
< std::string, std::shared_ptr
< IHolder > > 
m_store
 
std::unordered_map
< std::string, std::string > 
m_objectAliases
 

Friends

template<typename T >
class WriteDataHandle
 
template<typename T >
class ReadDataHandle
 

Detailed Description

A container to store arbitrary objects with ownership transfer.

This is an append-only container that takes ownership of the objects added to it. Once an object has been added, it can only be read but not be modified. Trying to replace an existing object is considered an error. Its lifetime is bound to the lifetime of the white board.

Definition at line 34 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 34 of file WhiteBoard.hpp

Constructor & Destructor Documentation

ActsExamples::WhiteBoard::WhiteBoard ( std::unique_ptr< const Acts::Logger logger = Acts::getDefaultLogger("WhiteBoard", Acts::Logging::INFO),
std::unordered_map< std::string, std::string >  objectAliases = {} 
)
inline

Definition at line 102 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 102 of file WhiteBoard.hpp

ActsExamples::WhiteBoard::WhiteBoard ( const WhiteBoard other)
delete

Member Function Documentation

template<typename T >
void ActsExamples::WhiteBoard::add ( const std::string &  name,
T &&  object 
)
inlineprivate

Store an object on the white board and transfer ownership.

Parameters
nameNon-empty identifier to store it under
objectMovable reference to the transferable object
Exceptions
std::invalid_argumenton empty or duplicate name

Definition at line 108 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 108 of file WhiteBoard.hpp

References ACTS_VERBOSE, it, perf_headwind::name, and Acts::UnitConstants::T.

Referenced by ActsExamples::WriteDataHandle< std::vector< Acts::BoundTrackParameters > >::operator()().

+ Here is the caller graph for this function:

bool ActsExamples::WhiteBoard::exists ( const std::string &  name) const
inline

Definition at line 156 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 156 of file WhiteBoard.hpp

Referenced by Acts::Python::addFramework().

+ Here is the caller graph for this function:

template<typename T >
const T & ActsExamples::WhiteBoard::get ( const std::string &  name) const
inlineprivate

Get access to a stored object.

Parameters
[in]nameIdentifier for the object
Returns
reference to the stored object
Exceptions
std::out_of_rangeif no object is stored under the requested name

Definition at line 125 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 125 of file WhiteBoard.hpp

References ACTS_VERBOSE, i, it, Acts::UnitConstants::min, perf_headwind::name, TauVsDIS_MachineLearning_Differentiation::names, Acts::UnitConstants::T, and ActsExamples::WhiteBoard::IHolder::type().

Referenced by ActsExamples::ReadDataHandle< std::vector< Acts::BoundTrackParameters > >::operator()().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Acts::Logger& ActsExamples::WhiteBoard::logger ( ) const
inlineprivate

Definition at line 88 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 88 of file WhiteBoard.hpp

References m_logger.

WhiteBoard& ActsExamples::WhiteBoard::operator= ( const WhiteBoard )
delete
std::vector< std::string_view > ActsExamples::WhiteBoard::similarNames ( const std::string_view &  name,
int  distThreshold,
std::size_t  maxNumber 
) const
private

Find similar names for suggestions with levenshtein-distance.

Definition at line 60 of file WhiteBoard.cpp.

View newest version in sPHENIX GitHub at line 60 of file WhiteBoard.cpp

References KFPMath::a, KFPMath::b, h, i, m_store, Acts::UnitConstants::min, n, TauVsDIS_MachineLearning_Differentiation::names, and Acts::Experimental::detail::BlueprintHelper::sort().

+ Here is the call graph for this function:

std::string ActsExamples::WhiteBoard::typeMismatchMessage ( const std::string &  name,
const char *  req,
const char *  act 
)
staticprivate

Definition at line 81 of file WhiteBoard.cpp.

View newest version in sPHENIX GitHub at line 81 of file WhiteBoard.cpp

Friends And Related Function Documentation

template<typename T >
friend class ReadDataHandle
friend

Definition at line 97 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 97 of file WhiteBoard.hpp

template<typename T >
friend class WriteDataHandle
friend

Definition at line 94 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 94 of file WhiteBoard.hpp

Member Data Documentation

std::unique_ptr<const Acts::Logger> ActsExamples::WhiteBoard::m_logger
private

Definition at line 84 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 84 of file WhiteBoard.hpp

Referenced by logger().

std::unordered_map<std::string, std::string> ActsExamples::WhiteBoard::m_objectAliases
private

Definition at line 86 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 86 of file WhiteBoard.hpp

std::unordered_map<std::string, std::shared_ptr<IHolder> > ActsExamples::WhiteBoard::m_store
private

Definition at line 85 of file WhiteBoard.hpp.

View newest version in sPHENIX GitHub at line 85 of file WhiteBoard.hpp

Referenced by similarNames().


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