Version: 9.15.0
SALOMEDSImpl_AttributeParameter.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2025 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // File : SALOMEDSImpl_AttributeIOR.hxx
24 // Author : Sergey RUIN
25 // Module : SALOME
26 //
27 #ifndef _SALOMEDSImpl_AttributeParameter_HeaderFile
28 #define _SALOMEDSImpl_AttributeParameter_HeaderFile
29 
30 #include "SALOMEDSImpl_Defines.hxx"
31 #include "DF_Attribute.hxx"
32 #include "DF_Label.hxx"
34 
35 #include <vector>
36 #include <string>
37 #include <map>
38 
40 
48 {
49 
50 private:
51 
52  std::map<std::string, int> _ints;
53  std::map<std::string, double> _reals;
54  std::map<std::string, std::string> _strings;
55  std::map<std::string, bool> _bools;
56  std::map< std::string, std::vector<double> > _realarrays;
57  std::map< std::string, std::vector<int> > _intarrays;
58  std::map< std::string, std::vector<std::string> > _strarrays;
59 
60 public:
61 
62  static const std::string& GetID() ;
63 
65  static SALOMEDSImpl_AttributeParameter* Set (const DF_Label& L);
66 
67  void SetInt(const std::string& theID, const int& theValue);
68  int GetInt(const std::string& theID);
69 
70  void SetReal(const std::string& theID, const double& theValue);
71  double GetReal(const std::string& theID);
72 
73  void SetString(const std::string& theID, const std::string& theValue);
74  std::string GetString(const std::string& theID);
75 
76  void SetBool(const std::string& theID, const bool& theValue);
77  bool GetBool(const std::string& theID);
78 
79  void SetRealArray(const std::string& theID, const std::vector<double>& theArray);
80  std::vector<double> GetRealArray(const std::string& theID);
81 
82  void SetIntArray(const std::string& theID, const std::vector<int>& theArray);
83  std::vector<int> GetIntArray(const std::string& theID);
84 
85  void SetStrArray(const std::string& theID, const std::vector<std::string>& theArray);
86  std::vector<std::string> GetStrArray(const std::string& theID);
87 
88  bool IsSet(const std::string& theID, const Parameter_Types theType);
89 
90  bool RemoveID(const std::string& theID, const Parameter_Types theType);
91 
93  bool HasFather();
94  bool IsRoot();
95 
96  std::vector<std::string> GetIDs(const Parameter_Types theType);
97 
98  void Clear();
99 
100  virtual std::string Save();
101  virtual void Load(const std::string& theValue);
102 
103  const std::string& ID() const;
104  void Restore(DF_Attribute* with) ;
105  DF_Attribute* NewEmpty() const;
106  void Paste(DF_Attribute* into);
107 
109 };
110 
111 #endif
Parameter_Types
Definition: SALOMEDSImpl_AttributeParameter.hxx:39
@ PT_INTEGER
Definition: SALOMEDSImpl_AttributeParameter.hxx:39
@ PT_STRING
Definition: SALOMEDSImpl_AttributeParameter.hxx:39
@ PT_REAL
Definition: SALOMEDSImpl_AttributeParameter.hxx:39
@ PT_BOOLEAN
Definition: SALOMEDSImpl_AttributeParameter.hxx:39
@ PT_STRARRAY
Definition: SALOMEDSImpl_AttributeParameter.hxx:39
@ PT_INTARRAY
Definition: SALOMEDSImpl_AttributeParameter.hxx:39
@ PT_REALARRAY
Definition: SALOMEDSImpl_AttributeParameter.hxx:39
#define SALOMEDSIMPL_EXPORT
Definition: SALOMEDSImpl_Defines.hxx:34
Definition: DF_Attribute.hxx:30
virtual void Restore(DF_Attribute *theAttribute)=0
virtual const std::string & ID() const =0
virtual std::string Save()
Definition: DF_Attribute.hxx:47
virtual void Load(const std::string &)
Definition: DF_Attribute.hxx:48
virtual DF_Attribute * NewEmpty() const =0
virtual void Paste(DF_Attribute *theIntoAttribute)=0
Definition: DF_Label.hxx:65
Class: SALOMEDSImpl_AttributeParameter Description : AttributeParameter is a universal container of b...
Definition: SALOMEDSImpl_AttributeParameter.hxx:48
std::map< std::string, std::vector< int > > _intarrays
Definition: SALOMEDSImpl_AttributeParameter.hxx:57
~SALOMEDSImpl_AttributeParameter()
Definition: SALOMEDSImpl_AttributeParameter.hxx:108
std::map< std::string, std::vector< double > > _realarrays
Definition: SALOMEDSImpl_AttributeParameter.hxx:56
SALOMEDSImpl_AttributeParameter()
Definition: SALOMEDSImpl_AttributeParameter.hxx:64
std::map< std::string, std::string > _strings
Definition: SALOMEDSImpl_AttributeParameter.hxx:54
std::map< std::string, std::vector< std::string > > _strarrays
Definition: SALOMEDSImpl_AttributeParameter.hxx:58
std::map< std::string, double > _reals
Definition: SALOMEDSImpl_AttributeParameter.hxx:53
std::map< std::string, bool > _bools
Definition: SALOMEDSImpl_AttributeParameter.hxx:55
std::map< std::string, int > _ints
Definition: SALOMEDSImpl_AttributeParameter.hxx:52
Definition: SALOMEDSImpl_GenericAttribute.hxx:39