ATLAS Offline Software
Loading...
Searching...
No Matches
BadChanContainerHashed< Chan, State, Hasher > Class Template Reference

#include <BadChanContainerHashed.h>

Collaboration diagram for BadChanContainerHashed< Chan, State, Hasher >:

Public Types

typedef std::pair< Chan, State > BadChanEntry
typedef std::vector< BadChanEntryBadChanVec
typedef BadChanVec::const_iterator const_iterator
typedef BadChanVec::size_type size_type

Public Member Functions

 BadChanContainerHashed ()
 BadChanContainerHashed (const Hasher &h)
 BadChanContainerHashed (const BadChanVec &vec)
State status (const Chan &channel) const
State status (const Chan &feb, int ch) const
const_iterator begin () const
const_iterator end () const
size_type size () const
void clear ()
 Deletes the contents and sets size to 0 (same as stl::vector<T>::clear())
void set (const BadChanVec &cont)
void setHasher (const Hasher &hasher)

Private Types

typedef unsigned int HashType

Private Member Functions

HashType hash (Chan ch) const
HashType maxHash () const

Private Attributes

std::vector< State > m_vec
Hasher m_hasher
BadChanVec m_bcv

Detailed Description

template<class Chan, class State, class Hasher>
class BadChanContainerHashed< Chan, State, Hasher >

Definition at line 9 of file BadChanContainerHashed.h.

Member Typedef Documentation

◆ BadChanEntry

template<class Chan, class State, class Hasher>
typedef std::pair<Chan,State> BadChanContainerHashed< Chan, State, Hasher >::BadChanEntry

Definition at line 12 of file BadChanContainerHashed.h.

◆ BadChanVec

template<class Chan, class State, class Hasher>
typedef std::vector<BadChanEntry> BadChanContainerHashed< Chan, State, Hasher >::BadChanVec

Definition at line 13 of file BadChanContainerHashed.h.

◆ const_iterator

template<class Chan, class State, class Hasher>
typedef BadChanVec::const_iterator BadChanContainerHashed< Chan, State, Hasher >::const_iterator

Definition at line 14 of file BadChanContainerHashed.h.

◆ HashType

template<class Chan, class State, class Hasher>
typedef unsigned int BadChanContainerHashed< Chan, State, Hasher >::HashType
private

Definition at line 42 of file BadChanContainerHashed.h.

◆ size_type

template<class Chan, class State, class Hasher>
typedef BadChanVec::size_type BadChanContainerHashed< Chan, State, Hasher >::size_type

Definition at line 15 of file BadChanContainerHashed.h.

Constructor & Destructor Documentation

◆ BadChanContainerHashed() [1/3]

template<class Chan, class State, class Hasher>
BadChanContainerHashed< Chan, State, Hasher >::BadChanContainerHashed ( )
inline

Definition at line 19 of file BadChanContainerHashed.h.

19{}

◆ BadChanContainerHashed() [2/3]

template<class Chan, class State, class Hasher>
BadChanContainerHashed< Chan, State, Hasher >::BadChanContainerHashed ( const Hasher & h)
inlineexplicit

◆ BadChanContainerHashed() [3/3]

template<class Chan, class State, class Hasher>
BadChanContainerHashed< Chan, State, Hasher >::BadChanContainerHashed ( const BadChanVec & vec)
inline

Definition at line 23 of file BadChanContainerHashed.h.

23{ set(vec);}
void set(const BadChanVec &cont)

Member Function Documentation

◆ begin()

template<class Chan, class State, class Hasher>
const_iterator BadChanContainerHashed< Chan, State, Hasher >::begin ( ) const
inline

Definition at line 29 of file BadChanContainerHashed.h.

29{return m_bcv.begin();}

◆ clear()

template<class Chan, class State, class Hasher>
void BadChanContainerHashed< Chan, State, Hasher >::clear ( )
inline

Deletes the contents and sets size to 0 (same as stl::vector<T>::clear())

Definition at line 34 of file BadChanContainerHashed.h.

34{m_vec.clear(); m_bcv.clear();}

◆ end()

template<class Chan, class State, class Hasher>
const_iterator BadChanContainerHashed< Chan, State, Hasher >::end ( ) const
inline

Definition at line 30 of file BadChanContainerHashed.h.

30{return m_bcv.end();}

◆ hash()

template<class Chan, class State, class Hasher>
HashType BadChanContainerHashed< Chan, State, Hasher >::hash ( Chan ch) const
inlineprivate

Definition at line 49 of file BadChanContainerHashed.h.

49{return m_hasher.hash(ch);}

◆ maxHash()

template<class Chan, class State, class Hasher>
HashType BadChanContainerHashed< Chan, State, Hasher >::maxHash ( ) const
inlineprivate

Definition at line 51 of file BadChanContainerHashed.h.

51{return m_hasher.maxHash();}

◆ set()

template<class Chan, class State, class Hasher>
void BadChanContainerHashed< Chan, State, Hasher >::set ( const BadChanVec & cont)
inline

Definition at line 62 of file BadChanContainerHashed.h.

63{
64 State good; // default constructed state is good
65 if (m_vec.size() == maxHash()) {
66 for (typename std::vector<State>::iterator i=m_vec.begin(); i!=m_vec.end(); ++i) {
67 *i = good; // reset all channels to good
68 }
69 }
70 else {
71 std::vector<State> tmp( maxHash(), good); // all channels good
72 m_vec.swap(tmp);
73 }
74 for (typename BadChanVec::const_iterator i=cont.begin(); i!=cont.end(); ++i) {
75 // m_vec.at( hash( i->first)) = i->second; // skip invalid hash values
76 HashType h = hash( i->first);
77 if (h < maxHash()) m_vec[h] = i->second;
78 }
79
80 m_bcv = cont;
81}
const_iterator begin() const
const_iterator end() const
HashType hash(Chan ch) const

◆ setHasher()

template<class Chan, class State, class Hasher>
void BadChanContainerHashed< Chan, State, Hasher >::setHasher ( const Hasher & hasher)
inline

Definition at line 38 of file BadChanContainerHashed.h.

38{ m_hasher = hasher;}

◆ size()

template<class Chan, class State, class Hasher>
size_type BadChanContainerHashed< Chan, State, Hasher >::size ( ) const
inline

Definition at line 31 of file BadChanContainerHashed.h.

31{return m_bcv.size();}

◆ status() [1/2]

template<class Chan, class State, class Hasher>
State BadChanContainerHashed< Chan, State, Hasher >::status ( const Chan & channel) const
inline

Definition at line 56 of file BadChanContainerHashed.h.

57{
58 return m_vec[ hash( channel)];
59}

◆ status() [2/2]

template<class Chan, class State, class Hasher>
State BadChanContainerHashed< Chan, State, Hasher >::status ( const Chan & feb,
int ch ) const
inline

Definition at line 27 of file BadChanContainerHashed.h.

27{return m_vec.at( m_hasher.hash( feb, ch));}

Member Data Documentation

◆ m_bcv

template<class Chan, class State, class Hasher>
BadChanVec BadChanContainerHashed< Chan, State, Hasher >::m_bcv
private

Definition at line 46 of file BadChanContainerHashed.h.

◆ m_hasher

template<class Chan, class State, class Hasher>
Hasher BadChanContainerHashed< Chan, State, Hasher >::m_hasher
private

Definition at line 45 of file BadChanContainerHashed.h.

◆ m_vec

template<class Chan, class State, class Hasher>
std::vector<State> BadChanContainerHashed< Chan, State, Hasher >::m_vec
private

Definition at line 44 of file BadChanContainerHashed.h.


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