Salome HOME
Move MEDCALC tests into SSL mode
[modules/med.git] / src / MEDCalc / cmp / MEDDataManager_i.hxx
index 589f1be427b39f854d6d13d2ab401ade87acec91..eddba2f1c52d65031fec336af33d740191214702 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "MEDCouplingRemapper.hxx"
 #include "MEDCouplingUMesh.hxx"
 #include "MEDCouplingFieldDouble.hxx"
+#include "MEDCouplingFieldFloat.hxx"
 using namespace MEDCoupling;
 
 /*! This map is used for lifecycle management of fields used in this operator */
 #include <map>
 #include <string>
-using namespace std;
 
-typedef map<long,MEDCALC::DatasourceHandler*> DatasourceHandlerMap;
-typedef map<long,MEDCALC::DatasourceHandler*>::iterator DatasourceHandlerMapIterator;
+typedef std::map<long,MEDCALC::DatasourceHandler*> DatasourceHandlerMap;
+typedef std::map<long,MEDCALC::DatasourceHandler*>::iterator DatasourceHandlerMapIterator;
 
-typedef map<long,MEDCALC::MeshHandler*> MeshHandlerMap;
-typedef map<long,MEDCALC::MeshHandler*>::iterator MeshHandlerMapIterator;
+typedef std::map<long,MEDCALC::MeshHandler*> MeshHandlerMap;
+typedef std::map<long,MEDCALC::MeshHandler*>::iterator MeshHandlerMapIterator;
 
-typedef map<long,MEDCALC::FieldseriesHandler*> FieldseriesHandlerMap;
-typedef map<long,MEDCALC::FieldseriesHandler*>::iterator FieldseriesHandlerMapIterator;
+typedef std::map<long,MEDCALC::FieldseriesHandler*> FieldseriesHandlerMap;
+typedef std::map<long,MEDCALC::FieldseriesHandler*>::iterator FieldseriesHandlerMapIterator;
 
-typedef map<long,MEDCALC::FieldHandler*> FieldHandlerMap;
-typedef map<long,MEDCALC::FieldHandler*>::iterator FieldHandlerMapIterator;
-typedef map<long,bool> FieldPersistencyMap;
-typedef map<long,bool>::iterator FieldPersistencyMapIterator;
+typedef std::map<long,MEDCALC::FieldHandler*> FieldHandlerMap;
+typedef std::map<long,MEDCALC::FieldHandler*>::iterator FieldHandlerMapIterator;
+typedef std::map<long,bool> FieldPersistencyMap;
+typedef std::map<long,bool>::iterator FieldPersistencyMapIterator;
 
-typedef map<long,MEDCouplingFieldDouble*> FieldDoubleMap;
-typedef map<long,MEDCouplingFieldDouble*>::iterator FieldDoubleMapIterator;
+typedef std::map<long,MEDCouplingFieldDouble*> FieldDoubleMap;
+typedef std::map<long,MEDCouplingFieldDouble*>::iterator FieldDoubleMapIterator;
 
-typedef map<long,MEDCouplingUMesh*> MeshMap;
-typedef map<long,MEDCouplingUMesh*>::iterator MeshMapIterator;
+typedef std::map<long,MEDCouplingUMesh*> MeshMap;
+typedef std::map<long,MEDCouplingUMesh*>::iterator MeshMapIterator;
 
 #include "MEDCALC.hxx"
 class MEDDataManager_i: public POA_MEDCALC::MEDDataManager,
@@ -75,14 +75,16 @@ public:
 
   // -----------------------------------------------------------
   // Mesh management
-  MEDCALC_EXPORT MEDCALC::MeshHandlerList * getMeshList(CORBA::Long datasourceId);
-  MEDCALC_EXPORT MEDCALC::MeshHandler * getMesh(CORBA::Long meshId);
+  MEDCALC_EXPORT MEDCALC::MeshHandlerList * getMeshHandlerList(CORBA::Long datasourceId);
+  MEDCALC_EXPORT MEDCALC::MeshHandler * getMeshHandler(CORBA::Long meshId);
 
   // -----------------------------------------------------------
   // Field management
   MEDCALC_EXPORT MEDCALC::FieldseriesHandlerList * getFieldseriesListOnMesh(CORBA::Long meshId);
   MEDCALC_EXPORT MEDCALC::FieldHandlerList * getFieldListInFieldseries(CORBA::Long fieldseriesId);
 
+  MEDCALC_EXPORT CORBA::Long getFieldIdAtTimestamp(CORBA::Long fieldseriesId, double timestamp);
+
   MEDCALC_EXPORT MEDCALC::FieldHandler *     getFieldHandler(CORBA::Long fieldHandlerId);
   MEDCALC_EXPORT char *                    getFieldRepresentation(CORBA::Long fieldHandlerId);
   MEDCALC_EXPORT MEDCALC::FieldHandlerList * getFieldHandlerList();
@@ -107,16 +109,18 @@ public:
 
   MEDCALC_EXPORT void serverlog();
 
+  MEDCALC_EXPORT void cleanUp();
+
   //
   // ===========================================================
   // Other public functions (non available via CORBA)
   // ===========================================================
   //
   static long LONG_UNDEFINED;
-  static MEDDataManager_i * getInstance();
-  MEDCouplingFieldDouble *  getFieldDouble(const MEDCALC::FieldHandler * fieldHandler);
-  MEDCALC::FieldHandler *     addField(MEDCouplingFieldDouble * fieldDouble,
-                                       long meshHandlerId=LONG_UNDEFINED);
+  MEDCALC_EXPORT static MEDDataManager_i * getInstance();
+  MEDCALC_EXPORT MEDCouplingFieldDouble *  getFieldDouble(const MEDCALC::FieldHandler * fieldHandler);
+  MEDCALC_EXPORT MEDCALC::FieldHandler *     addField(MEDCouplingFieldDouble * fieldDouble,
+                                                      long meshHandlerId=LONG_UNDEFINED);
 
 private:
   MEDDataManager_i();
@@ -138,7 +142,7 @@ private:
   MeshMap _meshMap;
   FieldPersistencyMap _fieldPersistencyMap;
 
-  string _medEventListenerIOR;
+  std::string _medEventListenerIOR;
 
   MEDCALC::FieldHandler * newFieldHandler(const char * fieldname,
                                           const char * meshname,
@@ -155,11 +159,14 @@ private:
 
   std::string  file_to_source(const char * filepath);
   std::string  source_to_file(const char * source);
+  bool isSourceInFile(const char * sourceName);
   long getDatasourceId(const char *filepath);
 
   MEDCouplingUMesh * getUMesh(long meshHandlerId);
   long getUMeshId(const MEDCouplingMesh * mesh);
 
+  double getFieldTimestamp(CORBA::Long fieldHandlerId);
+
   INTERP_KERNEL::IntersectionType _getIntersectionType(const char* intersType);
   MEDCoupling::NatureOfField _getNatureOfField(const char* fieldNature);