Public Types | Public Member Functions | Private Attributes | List of all members
FclIndexVectorMapTool Class Reference

#include <FclIndexVectorMapTool.h>

Inheritance diagram for FclIndexVectorMapTool:
IndexVectorMapTool

Public Types

using Index = IndexVectorMapTool::Index
 
using IndexVector = std::vector< Index >
 
using IndexVectorVector = std::vector< IndexVector >
 
using IndexVectorMap = std::map< Index, IndexVector >
 
- Public Types inherited from IndexVectorMapTool
using Index = unsigned int
 
using IndexVector = std::vector< Index >
 

Public Member Functions

 FclIndexVectorMapTool (fhicl::ParameterSet const &ps)
 
 ~FclIndexVectorMapTool () override=default
 
IndexVector get (Index ient) const override
 
- Public Member Functions inherited from IndexVectorMapTool
virtual ~IndexVectorMapTool ()=default
 
virtual bool contains (Index idx, Index val)
 

Private Attributes

Index m_LogLevel
 
IndexVectorVector m_Entries
 
IndexVectorMap m_entryMap
 

Additional Inherited Members

- Static Public Member Functions inherited from IndexVectorMapTool
static Index badIndex ()
 

Detailed Description

Definition at line 24 of file FclIndexVectorMapTool.h.

Member Typedef Documentation

Definition at line 28 of file FclIndexVectorMapTool.h.

Definition at line 29 of file FclIndexVectorMapTool.h.

Definition at line 31 of file FclIndexVectorMapTool.h.

Definition at line 30 of file FclIndexVectorMapTool.h.

Constructor & Destructor Documentation

FclIndexVectorMapTool::FclIndexVectorMapTool ( fhicl::ParameterSet const &  ps)

Definition at line 17 of file FclIndexVectorMapTool_tool.cc.

18 : m_LogLevel(ps.get<Index>("LogLevel")),
19  m_Entries(ps.get<IndexVectorVector>("Entries")) {
20  const Name myname = "FclIndexVectorMapTool::ctor: ";
21  for ( const IndexVector ent : m_Entries ) {
22  if ( ent.size() == 0 ) continue;
23  Index ient = ent.front();
24  IndexVector& vals = m_entryMap[ient];
25  vals.insert(vals.end(), ++ent.begin(), ent.end());
26  }
27  Index vecCount = m_entryMap.size();
28  Index valCount = 0;
29  for ( const IndexVectorMap::value_type& ent : m_entryMap ) valCount += ent.second.size();
30  if ( m_LogLevel >= 1 ) {
31  cout << myname << " LogLevel: " << m_LogLevel << endl;
32  cout << myname << " Entries: " << vecCount << " vectors with "
33  << valCount << " values";
34  if ( m_LogLevel > 1 ) {
35  cout << ":" << endl;
36  for ( const IndexVectorMap::value_type& ent : m_entryMap ) {
37  cout << myname << " " << ent.first << ": [";
38  bool first = true;
39  for ( Index val : ent.second ) {
40  if ( first ) first = false;
41  else cout << ", ";
42  cout << val;
43  }
44  cout << "]" << endl;
45  }
46  } else {
47  cout << "." << endl;
48  }
49  }
50 }
std::vector< Index > IndexVector
ChannelGroupService::Name Name
unsigned int Index
static constexpr double ps
Definition: Units.h:99
IndexVectorVector m_Entries
std::vector< IndexVector > IndexVectorVector
QTextStream & endl(QTextStream &s)
FclIndexVectorMapTool::~FclIndexVectorMapTool ( )
overridedefault

Member Function Documentation

IndexVectorMapTool::IndexVector FclIndexVectorMapTool::get ( Index  ient) const
overridevirtual

Implements IndexVectorMapTool.

Definition at line 54 of file FclIndexVectorMapTool_tool.cc.

54  {
55  const Name myname = "FclIndexVectorMapTool::get: ";
57  static const IndexVector empty;
58  if ( ient == m_entryMap.end() ) return empty;
59  return ient->second;
60 }
std::vector< Index > IndexVector
ChannelGroupService::Name Name
intermediate_table::const_iterator const_iterator
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97

Member Data Documentation

IndexVectorVector FclIndexVectorMapTool::m_Entries
private

Definition at line 46 of file FclIndexVectorMapTool.h.

IndexVectorMap FclIndexVectorMapTool::m_entryMap
private

Definition at line 47 of file FclIndexVectorMapTool.h.

Index FclIndexVectorMapTool::m_LogLevel
private

Definition at line 45 of file FclIndexVectorMapTool.h.


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