Guest User

GQE - Object Properties - SOURCE

a guest
Jan 24th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.23 KB | None | 0 0
  1. #include "PropertyManager.hpp"
  2.  
  3. namespace GQE
  4. {
  5.   PropertyManager::PropertyManager()
  6.   {
  7.   }
  8.  
  9.   PropertyManager::~PropertyManager()
  10.   {
  11.     std::map<const std::string, IProperty*>::iterator anProptertyIter;
  12.     for(anProptertyIter = mList.begin();
  13.         anProptertyIter != mList.end();
  14.         ++anProptertyIter)
  15.     {
  16.       IProperty* anProperty = (anProptertyIter->second);
  17.       delete anProperty;
  18.       anProperty = NULL;
  19.     }
  20.   }
  21.  
  22.   bool PropertyManager::HasID(const std::string thePropertyID)
  23.   {
  24.     bool anResult = false;
  25.  
  26.     anResult = (mList.find(thePropertyID) != mList.end());
  27.  
  28.     return anResult;
  29.   }
  30.  
  31.  
  32.   void PropertyManager::Add(IProperty* theProperty)
  33.   {
  34.     if(mList.find(theProperty->GetID()) == mList.end())
  35.     {
  36.       mList[theProperty->GetID()] = theProperty;
  37.     }
  38.   }
  39.  
  40.   void PropertyManager::Clone(const PropertyManager& thePropertyManager)
  41.   {
  42.     std::map<const std::string, IProperty*>::const_iterator anProptertyIter;
  43.     for(anProptertyIter = thePropertyManager.mList.begin();
  44.         anProptertyIter != thePropertyManager.mList.end();
  45.         ++anProptertyIter)
  46.     {
  47.       IProperty* anProperty = (anProptertyIter->second);
  48.       Add(anProperty->MakeClone());
  49.     }
  50.   }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment