diff --git a/src/utils/proteinstore.cpp b/src/utils/proteinstore.cpp index ba8ff7df31db6aea399ad73eb4e848b36712b028..2479cfc0dbe10bd63472004260e89881456553b2 100644 --- a/src/utils/proteinstore.cpp +++ b/src/utils/proteinstore.cpp @@ -28,3 +28,18 @@ ******************************************************************************/ #include "proteinstore.h" + + +ProteinXtpSp & ProteinStore::getInstance(ProteinXtpSp & peptide_in) { + + std::pair<std::unordered_map< QString, ProteinXtpSp>::iterator,bool> ret = _map_accession_protein_list.insert(std::pair<QString, ProteinXtpSp>(peptide_in.get()->getAccession(),peptide_in)); + + if (ret.second) { + setProteinInformations(ret.first->second); + } + return ret.first->second; + +} + +void ProteinStore::setProteinInformations(ProteinXtpSp & peptide_in) { +} diff --git a/src/utils/proteinstore.h b/src/utils/proteinstore.h index eec6afdb62796ff17b1332c8e1fe4abd4a9e2b8a..081986aa0b482a1ff94753b4195cb29d8d671cc6 100644 --- a/src/utils/proteinstore.h +++ b/src/utils/proteinstore.h @@ -32,8 +32,21 @@ #ifndef PROTEINSTORE_H #define PROTEINSTORE_H +#include "../core/proteinxtp.h" +#include <QString> +#include <unordered_map> + class ProteinStore { + + ProteinXtpSp & getInstance(ProteinXtpSp & protein_in); + +private : + void setProteinInformations(ProteinXtpSp & protein_in); +private : + + std::unordered_map<QString, ProteinXtpSp> _map_accession_protein_list; + }; #endif // PROTEINSTORE_H