Salome HOME
Fix bug in test on 24 cores CPU test
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeStudyProperties.hxx
index 19fc22d0ee98dc547b5cd3f7f6b466a0d877d177..e357bf9459494ca617da14a2006999efbc7b69ab 100644 (file)
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 //  File   : SALOMEDSImpl_AttributeStudyProperties.hxx
 //  Author : Sergey RUIN
 //  Module : SALOME
-
+//
 #ifndef _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
 #define _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
 
-#include <Standard_DefineHandle.hxx>
-#include <Standard.hxx>
-#include <TDF_Attribute.hxx>
-#include <TDF_Label.hxx>
-#include <TCollection_AsciiString.hxx>
+#include "SALOMEDSImpl_Defines.hxx"
+#include "DF_Attribute.hxx"
+#include "DF_Label.hxx"
+#include <string>
+#include <vector>
+#include <map>
 #include "SALOMEDSImpl_GenericAttribute.hxx"
 
-class Standard_GUID;
-class Handle(TDF_Attribute);
-class Handle(TDF_RelocationTable);
-
-
-DEFINE_STANDARD_HANDLE( SALOMEDSImpl_AttributeStudyProperties, SALOMEDSImpl_GenericAttribute )
-
-#include <TColStd_HSequenceOfExtendedString.hxx>
-#include <TColStd_HSequenceOfInteger.hxx>
-
-class SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute
+class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute
 {
 public:
-Standard_EXPORT SALOMEDSImpl_AttributeStudyProperties();
-Standard_EXPORT ~SALOMEDSImpl_AttributeStudyProperties() {}
+  SALOMEDSImpl_AttributeStudyProperties();
+  ~SALOMEDSImpl_AttributeStudyProperties() {}
 
-Standard_EXPORT static const Standard_GUID& GetID();
-Standard_EXPORT        const Standard_GUID&    ID() const;
+  static const std::string& GetID();
+  const std::string&    ID() const;
 
-Standard_EXPORT static  Handle_SALOMEDSImpl_AttributeStudyProperties Set(const TDF_Label& label);
+  static  SALOMEDSImpl_AttributeStudyProperties* Set(const DF_Label& label);
 
-Standard_EXPORT void Init();
+  void Init();
 
-Standard_EXPORT virtual TCollection_AsciiString Save();
-Standard_EXPORT virtual void Load(const TCollection_AsciiString&);
+  virtual std::string Save();
+  virtual void Load(const std::string&);
 
-Standard_EXPORT   void SetModification(const TCollection_ExtendedString& theUserName,
-                                       const Standard_Integer            theMinute,
-                                       const Standard_Integer            theHour,
-                                       const Standard_Integer            theDay,
-                                       const Standard_Integer            theMonth,
-                                       const Standard_Integer            theYear);
-Standard_EXPORT   void GetModifications(Handle(TColStd_HSequenceOfExtendedString)& theUserNames,
-                                        Handle(TColStd_HSequenceOfInteger)&        theMinutes,
-                                        Handle(TColStd_HSequenceOfInteger)&        theHours,
-                                        Handle(TColStd_HSequenceOfInteger)&        theDays,
-                                        Handle(TColStd_HSequenceOfInteger)&        theMonths,
-                                        Handle(TColStd_HSequenceOfInteger)&        theYears) const;
+  void SetModification(const std::string& theUserName,
+    const int          theMinute,
+    const int          theHour,
+    const int          theDay,
+    const int          theMonth,
+    const int          theYear);
+  void GetModifications(std::vector<std::string>& theUserNames,
+    std::vector<int>&         theMinutes,
+    std::vector<int>&         theHours,
+    std::vector<int>&         theDays,
+    std::vector<int>&         theMonths,
+    std::vector<int>&         theYears) const;
 
-Standard_EXPORT   TCollection_ExtendedString GetCreatorName() const;
-Standard_EXPORT   Standard_Boolean GetCreationDate(Standard_Integer&           theMinute,
-                                                  Standard_Integer&           theHour,
-                                                  Standard_Integer&           theDay,
-                                                  Standard_Integer&           theMonth,
-                                                  Standard_Integer&           theYear) const;
+  std::string GetCreatorName() const;
+  bool GetCreationDate(int&           theMinute,
+    int&           theHour,
+    int&           theDay,
+    int&           theMonth,
+    int&           theYear) const;
 
-Standard_EXPORT   void ChangeCreatorName(const TCollection_ExtendedString& theUserName);
+  void ChangeCreatorName(const std::string& theUserName);
 
-Standard_EXPORT   void SetCreationMode(const Standard_Integer theMode);
-Standard_EXPORT   Standard_Integer GetCreationMode() const;
+  void SetUnits(const std::string& theUnits);
+  std::string GetUnits() const;
 
-Standard_EXPORT   void SetModified(const Standard_Integer theModified);
-Standard_EXPORT   Standard_Boolean IsModified() const;
-Standard_EXPORT   Standard_Integer GetModified() const;
+  void SetComment(const std::string& theComment);
+  std::string GetComment() const;
 
-Standard_EXPORT   void SetLocked(const Standard_Boolean theLocked);
-Standard_EXPORT   Standard_Boolean IsLocked() const;
-Standard_EXPORT   Standard_Boolean IsLockChanged(const Standard_Boolean theErase);
+  void SetCreationMode(const int theMode);
+  int GetCreationMode() const;
 
-Standard_EXPORT   void Restore(const Handle(TDF_Attribute)& with);
-Standard_EXPORT   Handle_TDF_Attribute NewEmpty() const;
-Standard_EXPORT   void Paste(const Handle(TDF_Attribute)& into,
-                             const Handle(TDF_RelocationTable)& RT) const;
+  void SetModified(const int theModified);
+  bool IsModified() const;
+  int GetModified() const;
 
-private:
+  void SetLocked(const bool theLocked);
+  bool IsLocked() const;
+  bool IsLockChanged(const bool theErase);
 
-Handle_TColStd_HSequenceOfExtendedString myUserName;
-Handle_TColStd_HSequenceOfInteger myMinute;
-Handle_TColStd_HSequenceOfInteger myHour;
-Handle_TColStd_HSequenceOfInteger myDay;
-Handle_TColStd_HSequenceOfInteger myMonth;
-Handle_TColStd_HSequenceOfInteger myYear;
-Standard_Integer myMode;
-Standard_Integer myModified;
-Standard_Boolean myLocked;
-Standard_Boolean myLockChanged;
+  void SetComponentsVersions( const std::map< std::string, std::vector<std::string> >& theVersions );
+  void SetComponentVersion(const std::string& theComponent, const std::string& theVersion);
+  std::vector<std::string> GetStoredComponents() const;
+  std::string GetComponentVersion(const std::string& theComponent) const;
+  std::vector<std::string> GetComponentVersions(const std::string& theComponent) const;
+  std::map< std::string, std::vector<std::string> > GetComponentsVersions() const;
 
-public:
-  DEFINE_STANDARD_RTTI( SALOMEDSImpl_AttributeStudyProperties )
+  void Restore(DF_Attribute* with);
+  DF_Attribute* NewEmpty() const;
+  void Paste(DF_Attribute* into);
 
+private:
+  typedef std::vector<std::string> versionList;
+  typedef std::map<std::string, versionList> versionMap;
+
+  std::vector<std::string> myUserName;
+  std::vector<int> myMinute;
+  std::vector<int> myHour;
+  std::vector<int> myDay;
+  std::vector<int> myMonth;
+  std::vector<int> myYear;
+  std::string      myUnits;
+  std::string      myComment;
+  int              myMode;
+  int              myModified;
+  bool             myLocked;
+  bool             myLockChanged;
+  versionMap       myComponentVersions;
 };
 
 #endif