CbmRoot
Loading...
Searching...
No Matches
L1AlgoFunctions.h File Reference
#include <iomanip>
#include <map>
#include <sstream>
#include <string>
#include <unordered_map>
Include dependency graph for L1AlgoFunctions.h:

Go to the source code of this file.

Functions

template<class Key , class T , class Hash = std::hash<Key>>
void SetSingleValueToMap (Key key, T value, std::unordered_map< Key, T, Hash > &aMap)
 
template<class Key , class T , class Hash = std::hash<Key>>
void SetSameValueToMap (T value, std::unordered_map< Key, T, Hash > &aMap)
 
template<class Key , class T , class Hash = std::hash<Key>>
void SetMappedValuesToMap (const std::unordered_map< Key, T, Hash > &inMap, std::unordered_map< Key, T, Hash > &aMap)
 
template<class Key , class T , class Hash = std::hash<Key>>
std::string RepresentMapWithString (const std::unordered_map< Key, T, Hash > &aMap, int entryWidth=15)
 

Function Documentation

◆ RepresentMapWithString()

template<class Key , class T , class Hash = std::hash<Key>>
std::string RepresentMapWithString ( const std::unordered_map< Key, T, Hash > & aMap,
int entryWidth = 15 )

Template function to represent mapped contents into std::string NOTE: operator<< must be defined for value of the map

Definition at line 54 of file L1AlgoFunctions.h.

◆ SetMappedValuesToMap()

template<class Key , class T , class Hash = std::hash<Key>>
void SetMappedValuesToMap ( const std::unordered_map< Key, T, Hash > & inMap,
std::unordered_map< Key, T, Hash > & aMap )

Template function, which resets the elements of one map with the values defined in another map

Parameters
inMapA constant reference to the map containing new parameters
aMapA reference to the map, which is going to be modified

Definition at line 42 of file L1AlgoFunctions.h.

◆ SetSameValueToMap()

template<class Key , class T , class Hash = std::hash<Key>>
void SetSameValueToMap ( T value,
std::unordered_map< Key, T, Hash > & aMap )

Template function, which sets a value to ALL elements of the map

Parameters
valueNew value of the element under the selected key
aMapA reference to the map, which element is to be modified

Definition at line 31 of file L1AlgoFunctions.h.

◆ SetSingleValueToMap()

template<class Key , class T , class Hash = std::hash<Key>>
void SetSingleValueToMap ( Key key,
T value,
std::unordered_map< Key, T, Hash > & aMap )

Template function, which sets a value to an element of the map with a particular key

Parameters
keyKey of the element to be modified
valueNew value of the element under the selected key
aMapA reference to the map, which element is to be modified

Definition at line 22 of file L1AlgoFunctions.h.