From daf74d0161f81da1e426b1e3bdc969d19e7df723 Mon Sep 17 00:00:00 2001
From: Olivier Langella <Olivier.Langella@moulon.inra.fr>
Date: Thu, 23 Mar 2017 16:02:47 +0100
Subject: [PATCH] wip : protein store

---
 src/utils/proteinstore.cpp | 15 +++++++++++++++
 src/utils/proteinstore.h   | 13 +++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/src/utils/proteinstore.cpp b/src/utils/proteinstore.cpp
index ba8ff7df..2479cfc0 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 eec6afdb..081986aa 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
-- 
GitLab