CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
SiStripFedCabling::ConnsRange Class Reference

Builds range of iterators from pair of offsets. More...

#include <SiStripFedCabling.h>

Public Member Functions

ConnsConstIter begin () const
 
ConnsPair connsPair () const
 
 ConnsRange (const Conns &, ConnsPair)
 
 ConnsRange (const Conns &)
 
 ConnsRange ()
 
bool empty () const
 
ConnsConstIter end () const
 
ConnsConstIterRange invalid () const
 
void print (std::stringstream &) const
 
ConnsConstIterRange range () const
 
uint32_t size () const
 

Static Public Member Functions

static ConnsPair emptyPair ()
 

Private Attributes

ConnsConstIterRange range_
 
ConnsConstIterRange vector_
 

Detailed Description

Builds range of iterators from pair of offsets.

Definition at line 110 of file SiStripFedCabling.h.

Constructor & Destructor Documentation

SiStripFedCabling::ConnsRange::ConnsRange ( const Conns c,
ConnsPair  p 
)

Definition at line 134 of file SiStripFedCabling.cc.

References sistrip::invalid32_, and range_.

134  :
135  vector_( c.begin(), c.end() ),
136  range_( c.begin()+p.first, c.begin()+p.second )
137 {
138  if ( p.first > p.second ||
139  p.first == sistrip::invalid32_ ||
140  p.second == sistrip::invalid32_ ||
141  p.first > c.size() ||
142  p.second > c.size() ) {
143  range_ = ConnsConstIterRange( c.end(), c.end() );
144  }
145 }
static const uint32_t invalid32_
Definition: Constants.h:15
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
SiStripFedCabling::ConnsRange::ConnsRange ( const Conns c)

Definition at line 149 of file SiStripFedCabling.cc.

149  :
150  vector_( c.begin(), c.end() ),
151  range_( c.end(), c.end() )
152 {;}
SiStripFedCabling::ConnsRange::ConnsRange ( )
inline

Definition at line 116 of file SiStripFedCabling.h.

References begin(), connsPair(), empty(), emptyPair(), end(), invalid(), print(), range(), and size().

Referenced by SiStripFedCabling::range().

116 {;}

Member Function Documentation

SiStripFedCabling::ConnsConstIter SiStripFedCabling::ConnsRange::begin ( void  ) const
inline
SiStripFedCabling::ConnsPair SiStripFedCabling::ConnsRange::connsPair ( ) const
inline

Definition at line 202 of file SiStripFedCabling.h.

References SoftLeptonByDistance_cfi::distance, sistrip::invalid32_, range_, and vector_.

Referenced by ConnsRange(), and print().

202  {
203  return ( ( range_.begin() == vector_.end() &&
204  range_.end() == vector_.end() ) ?
206  ConnsPair( std::distance( vector_.begin(), range_.begin() ),
207  std::distance( vector_.begin(), range_.end() ) ) );
208 }
std::pair< uint32_t, uint32_t > ConnsPair
static const uint32_t invalid32_
Definition: Constants.h:15
bool SiStripFedCabling::ConnsRange::empty ( ) const
inline

Definition at line 194 of file SiStripFedCabling.h.

References range_.

Referenced by ConnsRange(), Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

194  {
195  return ( range_.begin() == range_.end() );
196 }
SiStripFedCabling::ConnsPair SiStripFedCabling::ConnsRange::emptyPair ( )
inlinestatic

Definition at line 210 of file SiStripFedCabling.h.

References sistrip::invalid32_.

Referenced by SiStripFedCabling::buildFedCabling(), and ConnsRange().

210  {
212 }
std::pair< uint32_t, uint32_t > ConnsPair
static const uint32_t invalid32_
Definition: Constants.h:15
SiStripFedCabling::ConnsConstIter SiStripFedCabling::ConnsRange::end ( void  ) const
inline
SiStripFedCabling::ConnsConstIterRange SiStripFedCabling::ConnsRange::invalid ( ) const
inline

Definition at line 190 of file SiStripFedCabling.h.

References vector_.

Referenced by ConnsRange().

190  {
191  return ConnsConstIterRange( vector_.end(), vector_.end() );
192 }
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
void SiStripFedCabling::ConnsRange::print ( std::stringstream &  ss) const

Definition at line 156 of file SiStripFedCabling.cc.

References connsPair(), TauDecayModes::dec, SoftLeptonByDistance_cfi::distance, range_, and vector_.

Referenced by ConnsRange(), and operator<<().

156  {
157  ss << "[SiStripFedCabling::ConnsRange::" << __func__ << "] Debug info:" << std::endl
158  << " Vector : " << std::endl
159  << " size : " << vector_.size() << std::endl
160  << " begin : "
161  << std::hex << std::setfill('0') << std::setw(8)
162  << &*vector_.begin()
163  << std::dec << std::endl
164  << " end : "
165  << std::hex << std::setfill('0') << std::setw(8)
166  << &*vector_.end()
167  << std::dec << std::endl
168  << " Range : " << std::endl
169  << " size : " << range_.size() << std::endl
170  << " begin : "
171  << std::hex << std::setfill('0') << std::setw(8)
172  << &*range_.begin()
173  << std::dec
174  << " (dist=" << std::distance( vector_.begin(), range_.begin() ) << ")"
175  << std::endl
176  << " end : "
177  << std::hex << std::setfill('0') << std::setw(8)
178  << &*range_.end()
179  << std::dec
180  << " (dist=" << std::distance( vector_.begin(), range_.end() ) << ")"
181  << std::endl
182  << " Offsets : " << std::endl
183  << " first : " << connsPair().first << std::endl
184  << " second : " << connsPair().second << std::endl;
185 }
SiStripFedCabling::ConnsConstIterRange SiStripFedCabling::ConnsRange::range ( ) const
inline
uint32_t SiStripFedCabling::ConnsRange::size ( void  ) const
inline

Member Data Documentation

ConnsConstIterRange SiStripFedCabling::ConnsRange::range_
private

Definition at line 134 of file SiStripFedCabling.h.

Referenced by begin(), connsPair(), ConnsRange(), empty(), end(), print(), range(), and size().

ConnsConstIterRange SiStripFedCabling::ConnsRange::vector_
private

Definition at line 133 of file SiStripFedCabling.h.

Referenced by connsPair(), invalid(), and print().