ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HLT::NestedUniqueCombinationGenerator Class Reference

An ensemble of UniqueCombinationGenerator API description. More...

#include <Combinators.h>

Collaboration diagram for HLT::NestedUniqueCombinationGenerator:

Public Member Functions

void add (const UniqueCombinationGenerator &gen)
 
void reset ()
 
size_t size () const
 
const std::vector< size_t > & operator() () const
 
const std::vector< size_t > & current () const
 
void operator++ ()
 
 operator bool () const
 

Private Member Functions

void cache ()
 

Private Attributes

std::vector< UniqueCombinationGeneratorm_generators
 
std::vector< size_t > m_current
 

Detailed Description

An ensemble of UniqueCombinationGenerator API description.

See also
CombinationGenerator

Definition at line 72 of file TrigCompositeUtils/TrigCompositeUtils/Combinators.h.

Member Function Documentation

◆ add()

void NestedUniqueCombinationGenerator::add ( const UniqueCombinationGenerator gen)

Definition at line 83 of file Combinators.cxx.

83  {
84  m_generators.push_back(gen);
85  reset();
86 }

◆ cache()

void NestedUniqueCombinationGenerator::cache ( )
private

Definition at line 120 of file Combinators.cxx.

120  {
121  m_current.clear();
122  for ( auto& gen: m_generators) {
123  m_current.insert(m_current.end(), gen.current().begin(), gen.current().end());
124  }
125 }

◆ current()

const std::vector<size_t>& HLT::NestedUniqueCombinationGenerator::current ( ) const
inline

Definition at line 78 of file TrigCompositeUtils/TrigCompositeUtils/Combinators.h.

78 { return m_current; }

◆ operator bool()

NestedUniqueCombinationGenerator::operator bool ( ) const

Definition at line 116 of file Combinators.cxx.

116  {
117  return not m_current.empty();
118 }

◆ operator()()

const std::vector<size_t>& HLT::NestedUniqueCombinationGenerator::operator() ( ) const
inline

Definition at line 77 of file TrigCompositeUtils/TrigCompositeUtils/Combinators.h.

77 { return current(); }

◆ operator++()

void NestedUniqueCombinationGenerator::operator++ ( )

Definition at line 102 of file Combinators.cxx.

102  {
103  m_current.clear();
104  for ( auto& gen: m_generators ) {
105  ++gen;
106  if ( gen ) {
107  cache();
108  return;
109  } else if ( &gen != &m_generators.back()) {
110  gen.reset();
111  }
112  }
113  m_current.clear();
114 }

◆ reset()

void NestedUniqueCombinationGenerator::reset ( )

Definition at line 87 of file Combinators.cxx.

87  {
88  m_current.clear();
89  for ( auto& gen: m_generators) {
90  gen.reset();
91  }
92  cache();
93 }

◆ size()

size_t NestedUniqueCombinationGenerator::size ( ) const

Definition at line 95 of file Combinators.cxx.

95  {
96  size_t sz = 0;
97  for ( const auto& gen: m_generators) { sz += gen.size(); }
98  return sz;
99 }

Member Data Documentation

◆ m_current

std::vector<size_t> HLT::NestedUniqueCombinationGenerator::m_current
private

◆ m_generators

std::vector<UniqueCombinationGenerator> HLT::NestedUniqueCombinationGenerator::m_generators
private

The documentation for this class was generated from the following files:
HLT::NestedUniqueCombinationGenerator::m_current
std::vector< size_t > m_current
Definition: TrigCompositeUtils/TrigCompositeUtils/Combinators.h:86
fitman.sz
sz
Definition: fitman.py:527
HLT::NestedUniqueCombinationGenerator::reset
void reset()
Definition: Combinators.cxx:87
master.gen
gen
Definition: master.py:32
HLT::NestedUniqueCombinationGenerator::current
const std::vector< size_t > & current() const
Definition: TrigCompositeUtils/TrigCompositeUtils/Combinators.h:78
HLT::NestedUniqueCombinationGenerator::cache
void cache()
Definition: Combinators.cxx:120
HLT::NestedUniqueCombinationGenerator::m_generators
std::vector< UniqueCombinationGenerator > m_generators
Definition: TrigCompositeUtils/TrigCompositeUtils/Combinators.h:85