CMS 3D CMS Logo

edm::MultiAssociation< C > Class Template Reference

#include <DataFormats/Common/interface/MultiAssociation.h>

List of all members.

Public Types

typedef C Collection
typedef boost::sub_range
< const Collection
const_range
typedef boost::sub_range
< Collection
range

Public Member Functions

bool contains (const edm::ProductID &id) const
 True if there are keys from this product id.
unsigned int dataSize () const
 Returns the number of values.
bool empty () const
 Returns true if there are no keys.
template<typename HandleType>
FastFiller fastFiller (const HandleType &handle)
range get (const edm::ProductID &id, unsigned int t)
 Get a range of values for this product id and index (fast).
const_range get (const edm::ProductID &id, unsigned int t) const
 Get a range of values for this product id and index (fast).
Collection getValues (const edm::ProductID &id, unsigned int t) const
 Get a copy of the values for this product id and index (slow!).
template<typename RefKey>
Collection getValues (const RefKey &r) const
 Get a copy of the values for this key (slow!).
template<typename HandleType>
LazyFiller lazyFiller (const HandleType &h, bool fillOnExit=false)
 MultiAssociation ()
template<typename RefKey>
range operator[] (const RefKey &r)
 Get a range of values for this key (fast).
template<typename RefKey>
const_range operator[] (const RefKey &r) const
 Get a range of values for this key (fast).
unsigned int size () const
 Returns the number of keys.
void swap (MultiAssociation &other)

Private Types

typedef
helper::IndexRangeAssociation 
Indices

Private Attributes

Collection data_
Indices indices_

Friends

class FastFiller
class LazyFiller

Classes

class  FastFiller
 FastFiller for the MultiAssociation. More...
class  LazyFiller
 LazyFiller for the MultiAssociation. More...


Detailed Description

template<typename C>
class edm::MultiAssociation< C >

Definition at line 151 of file MultiAssociation.h.


Member Typedef Documentation

template<typename C>
typedef C edm::MultiAssociation< C >::Collection

Definition at line 153 of file MultiAssociation.h.

template<typename C>
typedef boost::sub_range<const Collection> edm::MultiAssociation< C >::const_range

Definition at line 154 of file MultiAssociation.h.

template<typename C>
typedef helper::IndexRangeAssociation edm::MultiAssociation< C >::Indices [private]

Definition at line 280 of file MultiAssociation.h.

template<typename C>
typedef boost::sub_range<Collection> edm::MultiAssociation< C >::range

Definition at line 155 of file MultiAssociation.h.


Constructor & Destructor Documentation

template<typename C>
edm::MultiAssociation< C >::MultiAssociation (  )  [inline]

Definition at line 157 of file MultiAssociation.h.

00157 {}


Member Function Documentation

template<typename C>
bool edm::MultiAssociation< C >::contains ( const edm::ProductID id  )  const [inline]

True if there are keys from this product id.

Definition at line 178 of file MultiAssociation.h.

References edm::helper::IndexRangeAssociation::contains(), and edm::MultiAssociation< C >::indices_.

00178 { return indices_.contains(id); }

template<typename C>
unsigned int edm::MultiAssociation< C >::dataSize (  )  const [inline]

Returns the number of values.

Definition at line 195 of file MultiAssociation.h.

References edm::MultiAssociation< C >::data_.

00195 { return data_.size();    }

template<typename C>
bool edm::MultiAssociation< C >::empty (  )  const [inline]

Returns true if there are no keys.

Definition at line 201 of file MultiAssociation.h.

References edm::helper::IndexRangeAssociation::empty(), and edm::MultiAssociation< C >::indices_.

00201 { return indices_.empty(); }

template<typename C>
template<typename HandleType>
FastFiller edm::MultiAssociation< C >::fastFiller ( const HandleType &  handle  )  [inline]

Definition at line 233 of file MultiAssociation.h.

References edm::MultiAssociation< C >::FastFiller.

00233 { return FastFiller(*this, handle); }

template<typename C>
MultiAssociation< C >::range edm::MultiAssociation< C >::get ( const edm::ProductID id,
unsigned int  t 
) [inline]

Get a range of values for this product id and index (fast).

Definition at line 300 of file MultiAssociation.h.

References edm::MultiAssociation< C >::data_, edm::helper::IndexRangeAssociation::get(), and edm::MultiAssociation< C >::indices_.

00300                                                                     {
00301     Indices::range idxrange = indices_.get(id,key);
00302     return range(data_.begin()+idxrange.first, data_.begin()+idxrange.second);
00303   }

template<typename C>
MultiAssociation< C >::const_range edm::MultiAssociation< C >::get ( const edm::ProductID id,
unsigned int  t 
) const [inline]

Get a range of values for this product id and index (fast).

Definition at line 293 of file MultiAssociation.h.

References edm::MultiAssociation< C >::data_, edm::helper::IndexRangeAssociation::get(), and edm::MultiAssociation< C >::indices_.

00293                                                                           {
00294     Indices::range idxrange = indices_.get(id,key);
00295     return const_range(data_.begin()+idxrange.first, data_.begin()+idxrange.second);
00296   }

template<typename C>
MultiAssociation< C >::Collection edm::MultiAssociation< C >::getValues ( const edm::ProductID id,
unsigned int  t 
) const [inline]

Get a copy of the values for this product id and index (slow!).

Definition at line 308 of file MultiAssociation.h.

References it, and values.

00308                                                                                 {
00309      Collection ret;
00310      const_range values = get(id,key);
00311      for (typename const_range::const_iterator it = values.begin(), ed = values.end(); it != ed; ++it) {
00312         ret.push_back(*it);
00313      }
00314      return ret;
00315   }

template<typename C>
template<typename RefKey>
Collection edm::MultiAssociation< C >::getValues ( const RefKey &  r  )  const [inline]

Get a copy of the values for this key (slow!).

Definition at line 173 of file MultiAssociation.h.

00173                                                 { 
00174         return getValues(r.id(), r.key()); 
00175     }

template<typename C>
template<typename HandleType>
LazyFiller edm::MultiAssociation< C >::lazyFiller ( const HandleType &  h,
bool  fillOnExit = false 
) [inline]

Definition at line 277 of file MultiAssociation.h.

References edm::MultiAssociation< C >::LazyFiller.

00277 { return LazyFiller(*this, h, fillOnExit); }

template<typename C>
template<typename RefKey>
range edm::MultiAssociation< C >::operator[] ( const RefKey &  r  )  [inline]

Get a range of values for this key (fast).

Definition at line 167 of file MultiAssociation.h.

00167                                       { 
00168         return get(r.id(), r.key()); 
00169     }

template<typename C>
template<typename RefKey>
const_range edm::MultiAssociation< C >::operator[] ( const RefKey &  r  )  const [inline]

Get a range of values for this key (fast).

Definition at line 161 of file MultiAssociation.h.

00161                                                   { 
00162         return get(r.id(), r.key()); 
00163     }

template<typename C>
unsigned int edm::MultiAssociation< C >::size ( void   )  const [inline]

Returns the number of keys.

Definition at line 198 of file MultiAssociation.h.

References edm::MultiAssociation< C >::indices_, and edm::helper::IndexRangeAssociation::size().

00198 { return indices_.size(); }

template<typename C>
void edm::MultiAssociation< C >::swap ( MultiAssociation< C > &  other  )  [inline]

Definition at line 189 of file MultiAssociation.h.

References edm::MultiAssociation< C >::data_, edm::MultiAssociation< C >::indices_, and edm::helper::IndexRangeAssociation::swap().

Referenced by edm::swap().

00189                                        {
00190         indices_.swap(other.indices_);
00191         data_.swap(other.data_);
00192     }


Friends And Related Function Documentation

template<typename C>
friend class FastFiller [friend]

Definition at line 230 of file MultiAssociation.h.

Referenced by edm::MultiAssociation< C >::fastFiller().

template<typename C>
friend class LazyFiller [friend]

Definition at line 274 of file MultiAssociation.h.

Referenced by edm::MultiAssociation< C >::lazyFiller().


Member Data Documentation

template<typename C>
Collection edm::MultiAssociation< C >::data_ [private]

Definition at line 282 of file MultiAssociation.h.

Referenced by edm::MultiAssociation< C >::dataSize(), edm::MultiAssociation< C >::get(), edm::MultiAssociation< C >::FastFiller::setValues(), and edm::MultiAssociation< C >::swap().

template<typename C>
Indices edm::MultiAssociation< C >::indices_ [private]

Definition at line 281 of file MultiAssociation.h.

Referenced by edm::MultiAssociation< C >::contains(), edm::MultiAssociation< C >::empty(), edm::MultiAssociation< C >::get(), edm::MultiAssociation< C >::size(), and edm::MultiAssociation< C >::swap().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:41:53 2009 for CMSSW by  doxygen 1.5.4