--- trunk/OOPSE/libmdtools/GenericData.cpp 2003/07/31 15:35:07 658 +++ trunk/OOPSE/libmdtools/GenericData.cpp 2004/06/04 03:15:31 1234 @@ -1,5 +1,7 @@ #include "GenericData.hpp" - +//////////////////////////////////////////////////////////////////////////////// +//Implementation of GenericData +//////////////////////////////////////////////////////////////////////////////// GenericData::GenericData(){ id = "undefined"; @@ -16,27 +18,35 @@ GenericData& GenericData::operator = (const GenericDat return *this; } -IndexData::IndexData(){ - - id = "IndexData"; - +//////////////////////////////////////////////////////////////////////////////// +//Implementation of ZConsParaData +//////////////////////////////////////////////////////////////////////////////// +ZConsParaData::ZConsParaData(){ + id = ZCONSPARADATA_ID; } -IndexData::IndexData(const IndexData& rhs) - : GenericData(rhs), indexData(rhs.indexData){ - +void ZConsParaData::sortByIndex(){ + sort(data.begin(), data.end(), ZConsParaSortCriterion()); } - -IndexData& IndexData::operator = (const IndexData& rhs){ +bool ZConsParaData::isIndexUnique(){ - if(this == &rhs) - return (*this); - - //chain to base class - GenericData::operator =(rhs); - - indexData = rhs.indexData; - - return (*this); + for(int i = 0; i < (int)(data.size() - 1); i++) + for(int j = i + 1; j < (int)(data.size()); j++) + if(data[i].zconsIndex == data[j].zconsIndex) + return false; + return true; } + +//////////////////////////////////////////////////////////////////////////////// +//Implementation of AtomData +//////////////////////////////////////////////////////////////////////////////// +AtomData::~AtomData(){ + vector::iterator i; + AtomInfo* atomInfo; + + for(atomInfo = beginAtomInfo(i); atomInfo; atomInfo = nextAtomInfo(i)) + delete atomInfo; + + data.clear(); +} \ No newline at end of file