CMS 3D CMS Logo

IgAssociatedSet::Iterator Class Reference

#include <Iguana/Framework/interface/IgCollection.h>

List of all members.

Public Member Functions

void find (void)
 Iterator (IgDataStorage *storage, IgAssociationSet::Iterator current, IgAssociationSet::Iterator end, const IgRef &item, enum AssociatedType associatedType=BOTH_ASSOCIATED)
IgCollectionItem operator * (void)
bool operator!= (const Iterator &other)
void operator++ (int)
bool operator== (const Iterator &other)

Private Attributes

enum AssociatedType m_associatedType
IgAssociationSet::Iterator m_cur
IgAssociationSet::Iterator m_end
int m_pos
const IgRef m_ref
IgDataStoragem_storage


Detailed Description

Definition at line 1108 of file IgCollection.h.


Constructor & Destructor Documentation

IgAssociatedSet::Iterator::Iterator ( IgDataStorage storage,
IgAssociationSet::Iterator  current,
IgAssociationSet::Iterator  end,
const IgRef item,
enum AssociatedType  associatedType = BOTH_ASSOCIATED 
) [inline]

Definition at line 1112 of file IgCollection.h.

References find().

01116      :m_storage(storage), 
01117       m_cur(current),
01118       m_end(end),
01119       m_ref(item),
01120       m_associatedType(associatedType)
01121     {
01122       find();
01123     }


Member Function Documentation

void IgAssociatedSet::Iterator::find ( void   )  [inline]

Definition at line 1131 of file IgCollection.h.

References IgRef::collectionId(), LEFT_ASSOCIATED, m_associatedType, m_cur, m_end, m_pos, m_ref, IgRef::objectId(), and RIGHT_ASSOCIATED.

Referenced by Iterator(), and operator++().

01132     {
01133       while(m_cur != m_end)
01134       {
01135         if ((m_associatedType & RIGHT_ASSOCIATED)
01136             && m_cur->first().objectId() == m_ref.objectId() 
01137             && m_cur->first().collectionId() == m_ref.collectionId())
01138         {
01139           m_pos = 0;
01140           return;
01141         } 
01142         if ((m_associatedType & LEFT_ASSOCIATED)
01143             && m_cur->second().objectId() == m_ref.objectId() 
01144             && m_cur->second().collectionId() == m_ref.collectionId())
01145         {
01146           m_pos = 1;
01147           return;
01148         }
01149         m_cur++;
01150       }      
01151     }

IgCollectionItem IgAssociatedSet::Iterator::operator * ( void   )  [inline]

Definition at line 1163 of file IgCollection.h.

References IgDataStorage::deref(), m_cur, m_pos, and m_storage.

01164     {
01165       return m_storage->deref(m_pos ? m_cur->first() : m_cur->second());
01166     }

bool IgAssociatedSet::Iterator::operator!= ( const Iterator other  )  [inline]

Definition at line 1158 of file IgCollection.h.

References m_cur.

01159     {
01160       return other.m_cur != this->m_cur;
01161     }

void IgAssociatedSet::Iterator::operator++ ( int   )  [inline]

Definition at line 1125 of file IgCollection.h.

References find(), and m_cur.

01126     {
01127       m_cur++;
01128       find();
01129     }

bool IgAssociatedSet::Iterator::operator== ( const Iterator other  )  [inline]

Definition at line 1153 of file IgCollection.h.

References m_cur.

01154     {
01155       return other.m_cur == this->m_cur;
01156     }


Member Data Documentation

enum AssociatedType IgAssociatedSet::Iterator::m_associatedType [private]

Definition at line 1174 of file IgCollection.h.

Referenced by find().

IgAssociationSet::Iterator IgAssociatedSet::Iterator::m_cur [private]

Definition at line 1170 of file IgCollection.h.

Referenced by find(), operator *(), operator!=(), operator++(), and operator==().

IgAssociationSet::Iterator IgAssociatedSet::Iterator::m_end [private]

Definition at line 1171 of file IgCollection.h.

Referenced by find().

int IgAssociatedSet::Iterator::m_pos [private]

Definition at line 1173 of file IgCollection.h.

Referenced by find(), and operator *().

const IgRef IgAssociatedSet::Iterator::m_ref [private]

Definition at line 1172 of file IgCollection.h.

Referenced by find().

IgDataStorage* IgAssociatedSet::Iterator::m_storage [private]

Definition at line 1169 of file IgCollection.h.

Referenced by operator *().


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