00001 //<<<<<< INCLUDES >>>>>> 00002 00003 #include "Iguana/Models/interface/IgUIDModel.h" 00004 #include "Iguana/Models/interface/IgUIDRep.h" 00005 00006 //<<<<<< PRIVATE DEFINES >>>>>> 00007 //<<<<<< PRIVATE CONSTANTS >>>>>> 00008 //<<<<<< PRIVATE TYPES >>>>>> 00009 //<<<<<< PRIVATE VARIABLE DEFINITIONS >>>>>> 00010 //<<<<<< PUBLIC VARIABLE DEFINITIONS >>>>>> 00011 //<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> 00012 //<<<<<< PRIVATE FUNCTION DEFINITIONS >>>>>> 00013 //<<<<<< PUBLIC FUNCTION DEFINITIONS >>>>>> 00014 //<<<<<< MEMBER FUNCTION DEFINITIONS >>>>>> 00015 00016 IgUIDModel::IgUIDModel (void) 00017 { 00018 } 00019 00020 IgUIDModel::~IgUIDModel (void) 00021 { 00022 for (RepSet::iterator i = m_repSet.begin (); 00023 i != m_repSet.end (); 00024 i++) 00025 { 00026 delete this->lookup (*i); 00027 } 00028 } 00029 00030 IgUIDRep * 00031 IgUIDModel::lookup (IgUIDRep::IDType id) 00032 { 00033 // No need for a map<int, IgUIDRep*> if the id is an int! We also 00034 // get uniqueness for free!!!!! 00035 return (IgUIDRep *) (id); 00036 } 00037 00038 void 00039 IgUIDModel::add (IgUIDRep *rep) 00040 { 00041 m_repSet.insert (rep->id ()); 00042 } 00043 00044 IgUIDRep * 00045 IgUIDModel::remove (IgUIDRep::IDType id) 00046 { 00047 IgUIDRep *rep = this->lookup (id); 00048 m_repSet.erase (id); 00049 return rep; 00050 } 00051 00052 IgUIDModel::RepSet::iterator 00053 IgUIDModel::begin (void) 00054 { 00055 return m_repSet.begin (); 00056 } 00057 00058 IgUIDModel::RepSet::iterator 00059 IgUIDModel::end (void) 00060 { 00061 return m_repSet.end (); 00062 } 00063