CMS 3D CMS Logo

IgDataStorage Class Reference

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

List of all members.

Public Types

typedef std::vector< std::string > AssociationSetNames
typedef std::vector
< IgAssociationSet * > 
AssociationSets
typedef std::vector< std::string > CollectionNames
typedef std::vector
< IgCollection * > 
Collections

Public Member Functions

AssociationSetNamesassociationSetNames (void)
CollectionNamescollectionNames (void)
IgCollectionItem deref (const IgRef &ref)
bool empty (void)
IgAssociatedSet getAssociatedSet (const char *name, IgCollectionItem &item, AssociatedType which=BOTH_ASSOCIATED)
IgAssociatedSet getAssociatedSetPtr (IgAssociationSet *associations, IgCollectionItem &item, AssociatedType which=BOTH_ASSOCIATED)
IgAssociationSetgetAssociationSet (const char *label)
IgAssociationSetgetAssociationSetPtr (const char *label)
IgCollectiongetCollection (const char *label)
IgCollectiongetCollectionByIndex (unsigned int index)
IgCollectiongetCollectionPtr (const char *label)
bool hasCollection (const char *name)
 ~IgDataStorage (void)

Private Attributes

AssociationSetNames m_associationSetNames
AssociationSets m_associationSets
CollectionNames m_collectionNames
Collections m_collections


Detailed Description

Definition at line 979 of file IgCollection.h.


Member Typedef Documentation

typedef std::vector<std::string> IgDataStorage::AssociationSetNames

Definition at line 984 of file IgCollection.h.

typedef std::vector<IgAssociationSet *> IgDataStorage::AssociationSets

Definition at line 986 of file IgCollection.h.

typedef std::vector<std::string> IgDataStorage::CollectionNames

Definition at line 983 of file IgCollection.h.

typedef std::vector<IgCollection *> IgDataStorage::Collections

Definition at line 985 of file IgCollection.h.


Constructor & Destructor Documentation

IgDataStorage::~IgDataStorage ( void   )  [inline]

Definition at line 990 of file IgCollection.h.

References i, j, m_associationSets, and m_collections.

00991   {
00992     for (AssociationSets::iterator i = m_associationSets.begin();
00993         i != m_associationSets.end();
00994         i++)
00995     {
00996       delete *i;
00997     }
00998     
00999     for (Collections::iterator i = m_collections.begin();
01000          i != m_collections.end();
01001          i++)
01002     {
01003       for (IgCollection::Properties::iterator j = (*i)->properties().begin();
01004            j != (*i)->properties().end();
01005            j++)
01006       {
01007         j->handle().destroy();
01008       }
01009       delete *i;
01010     }
01011   }


Member Function Documentation

AssociationSetNames& IgDataStorage::associationSetNames ( void   )  [inline]

Definition at line 1084 of file IgCollection.h.

References m_associationSetNames.

Referenced by operator<<().

01085   {
01086     return m_associationSetNames; 
01087   }

CollectionNames& IgDataStorage::collectionNames ( void   )  [inline]

Definition at line 1079 of file IgCollection.h.

References m_collectionNames.

Referenced by operator<<().

01080   {
01081     return m_collectionNames; 
01082   }

IgCollectionItem IgDataStorage::deref ( const IgRef ref  )  [inline]

Definition at line 1073 of file IgCollection.h.

References IgRef::collectionId(), m_collections, and IgRef::objectId().

Referenced by IgAssociatedSet::Iterator::operator *().

01074   {
01075     return IgCollectionItem(m_collections[ref.collectionId()], 
01076                             ref.objectId());
01077   }

bool IgDataStorage::empty ( void   )  [inline]

Definition at line 1089 of file IgCollection.h.

References m_collectionNames.

01090   {
01091     return m_collectionNames.empty();
01092   }

IgAssociatedSet IgDataStorage::getAssociatedSet ( const char *  name,
IgCollectionItem item,
AssociatedType  which = BOTH_ASSOCIATED 
)

Definition at line 70 of file IgCollection.cc.

References getAssociatedSetPtr().

00073 {
00074   return this->getAssociatedSetPtr(this->getAssociationSetPtr(name), item, type);
00075 }

IgAssociatedSet IgDataStorage::getAssociatedSetPtr ( IgAssociationSet associations,
IgCollectionItem item,
AssociatedType  which = BOTH_ASSOCIATED 
)

Definition at line 62 of file IgCollection.cc.

Referenced by getAssociatedSet().

00065 {
00066   return IgAssociatedSet(this, associations, &item, type);
00067 }

IgAssociationSet& IgDataStorage::getAssociationSet ( const char *  label  )  [inline]

Definition at line 1053 of file IgCollection.h.

References getAssociationSetPtr().

Referenced by VisMuon::analyze(), VisPFRecTrack::analyze(), VisPFRecHit::analyze(), VisBasicCluster::analyze(), VisPFCluster::analyze(), VisTrack::analyze(), and operator<<().

01054   {
01055     return *getAssociationSetPtr(label);
01056   }

IgAssociationSet* IgDataStorage::getAssociationSetPtr ( const char *  label  )  [inline]

Definition at line 1058 of file IgCollection.h.

References find(), m_associationSetNames, m_associationSets, and n.

Referenced by getAssociationSet(), and IgParser::parseAssociationSet().

01059   {
01060     AssociationSetNames::iterator n = std::find(m_associationSetNames.begin(),
01061                                                 m_associationSetNames.end(),
01062                                                 label);
01063     if (n == m_associationSetNames.end())
01064     {
01065       IgAssociationSet *associationSet = new IgAssociationSet(label);
01066       m_associationSetNames.push_back(label);
01067       m_associationSets.push_back(associationSet);
01068       return associationSet;
01069     }
01070     return m_associationSets[std::distance(m_associationSetNames.begin(), n)];
01071   }

IgCollection& IgDataStorage::getCollection ( const char *  label  )  [inline]

Definition at line 1017 of file IgCollection.h.

References getCollectionPtr().

Referenced by VisEBRecHit::analyze(), VisMuon::analyze(), VisHORecHit::analyze(), VisSiPixelCluster::analyze(), VisCaloTower::analyze(), VisEcalRecHit::analyze(), VisHBRecHit::analyze(), VisMET::analyze(), VisJet::analyze(), VisRPCRecHit::analyze(), VisDTDigi::analyze(), VisTrackingRecHit::analyze(), VisDTRecHit::analyze(), VisDTRecSegment4D::analyze(), VisSiStripCluster::analyze(), VisEERecHit::analyze(), VisPFRecTrack::analyze(), VisSiStripDigi::analyze(), VisCSCSegment::analyze(), VisPFRecHit::analyze(), VisSiPixelRecHit::analyze(), VisBasicCluster::analyze(), VisHERecHit::analyze(), VisHFRecHit::analyze(), VisPFCluster::analyze(), VisTrack::analyze(), VisEvent::analyze(), VisPixelDigi::analyze(), VisEventSetup::build(), VisEventSetup::buildCSC(), VisEventSetup::buildDriftTubes(), VisEventSetup::buildRPC(), VisEventSetup::buildTracker(), operator<<(), and VisMuon::refitTrack().

01018   {
01019     return *getCollectionPtr(label);
01020   }

IgCollection& IgDataStorage::getCollectionByIndex ( unsigned int  index  )  [inline]

Definition at line 1030 of file IgCollection.h.

References m_collections.

01031   {
01032     assert(index >= 0);
01033     assert(index < m_collections.size());
01034     return *(m_collections[index]);
01035   }

IgCollection* IgDataStorage::getCollectionPtr ( const char *  label  )  [inline]

Definition at line 1037 of file IgCollection.h.

References collection, find(), m_collectionNames, m_collections, and n.

Referenced by getCollection(), IgParser::parseCollection(), and IgParser::parseTypes().

01038   {
01039     CollectionNames::iterator n = std::find (m_collectionNames.begin(), 
01040                                              m_collectionNames.end(), 
01041                                              label);
01042     
01043     if (n == m_collectionNames.end())
01044     {
01045       IgCollection *collection = new IgCollection(label, m_collections.size ());
01046       m_collectionNames.push_back(label);
01047       m_collections.push_back(collection);
01048       return collection;
01049     }
01050     return m_collections[std::distance(m_collectionNames.begin(), n)];
01051   }

bool IgDataStorage::hasCollection ( const char *  name  )  [inline]

Definition at line 1094 of file IgCollection.h.

References find(), and m_collectionNames.

01095   {
01096     return std::find (m_collectionNames.begin(), m_collectionNames.end(), name) != m_collectionNames.end();
01097   }


Member Data Documentation

AssociationSetNames IgDataStorage::m_associationSetNames [private]

Definition at line 1100 of file IgCollection.h.

Referenced by associationSetNames(), and getAssociationSetPtr().

AssociationSets IgDataStorage::m_associationSets [private]

Definition at line 1102 of file IgCollection.h.

Referenced by getAssociationSetPtr(), and ~IgDataStorage().

CollectionNames IgDataStorage::m_collectionNames [private]

Definition at line 1099 of file IgCollection.h.

Referenced by collectionNames(), empty(), getCollectionPtr(), and hasCollection().

Collections IgDataStorage::m_collections [private]

Definition at line 1101 of file IgCollection.h.

Referenced by deref(), getCollectionByIndex(), getCollectionPtr(), and ~IgDataStorage().


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