1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef DFCONTAINER_HXX
23 #define DFCONTAINER_HXX
25 #include "DF_definitions.hxx"
26 #include "DF_Attribute.hxx"
30 //Class DF_Container is used to store several types of data
31 class DF_Container : public DF_Attribute
35 //Static method that returns an ID of the give type of attributes
36 Standard_EXPORT static const std::string& GetID();
38 //Creates if not exists a Container attribute and places if is not placed it the Label
39 Standard_EXPORT static DF_Container* Set(DF_Label& theLabel);
42 Standard_EXPORT DF_Container();
45 Standard_EXPORT ~DF_Container();
47 //Sets an integer value of the attribute with given ID
48 Standard_EXPORT void SetInt(const std::string& theID, int theValue);
50 //Returns an integer value of the attribute with given ID
51 Standard_EXPORT int GetInt(const std::string& theID);
53 //Returns True if there is an integer with given ID
54 Standard_EXPORT bool HasIntID(const std::string& theID);
56 //Sets a double value of the attribute with given ID
57 Standard_EXPORT void SetDouble(const std::string& theID, const double& theValue);
59 //Returns a double value of the attribute with given ID
60 Standard_EXPORT double GetDouble(const std::string& theID);
62 //Returns True if there is a double with given ID
63 Standard_EXPORT bool HasDoubleID(const std::string& theID);
65 //Sets a string value of the attribute with given ID
66 Standard_EXPORT void SetString(const std::string& theID, const std::string& theValue);
68 //Returns a string value of the attribute with given ID
69 Standard_EXPORT std::string GetString(const std::string& theID);
71 //Returns True if there is a string with given ID
72 Standard_EXPORT bool HasStringID(const std::string& theID);
74 //Sets a boolean value of the attribute with given ID
75 Standard_EXPORT void SetBool(const std::string& theID, bool theValue);
77 //Returns a boolean value of the attribute with given ID
78 Standard_EXPORT bool GetBool(const std::string& theID);
80 //Returns True if there is a boolean value with given ID
81 Standard_EXPORT bool HasBoolID(const std::string& theID);
83 //Clears a content of the attribute
84 Standard_EXPORT void Clear();
86 //ID is a std::string that uniquely identify the given type of Attributes within the Application.
87 Standard_EXPORT virtual const std::string& ID() const;
89 //Restores a content of this Attribute from another Attribute
90 Standard_EXPORT virtual void Restore(DF_Attribute* theAttribute);
92 //Creates a new empty copy of this Attribute
93 Standard_EXPORT virtual DF_Attribute* NewEmpty() const;
95 //Pastes a content of this Attribute into another Attribute
96 Standard_EXPORT virtual void Paste(DF_Attribute* theIntoAttribute);
100 std::map<std::string, int> _ints;
101 std::map<std::string, double> _doubles;
102 std::map<std::string, std::string> _strings;
103 std::map<std::string, bool> _bools;