1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef DFCONTAINER_HXX
21 #define DFCONTAINER_HXX
23 #include "DF_definitions.hxx"
24 #include "DF_Attribute.hxx"
28 //Class DF_Container is used to store several types of data
29 class DF_Container : public DF_Attribute
33 //Static method that returns an ID of the give type of attributes
34 Standard_EXPORT static const std::string& GetID();
36 //Creates if not exists a Container attribute and places if is not placed it the Label
37 Standard_EXPORT static DF_Container* Set(DF_Label& theLabel);
40 Standard_EXPORT DF_Container();
43 Standard_EXPORT ~DF_Container();
45 //Sets an integer value of the attribute with given ID
46 Standard_EXPORT void SetInt(const std::string& theID, int theValue);
48 //Returns an integer value of the attribute with given ID
49 Standard_EXPORT int GetInt(const std::string& theID);
51 //Returns True if there is an integer with given ID
52 Standard_EXPORT bool HasIntID(const std::string& theID);
54 //Sets a double value of the attribute with given ID
55 Standard_EXPORT void SetDouble(const std::string& theID, const double& theValue);
57 //Returns a double value of the attribute with given ID
58 Standard_EXPORT double GetDouble(const std::string& theID);
60 //Returns True if there is a double with given ID
61 Standard_EXPORT bool HasDoubleID(const std::string& theID);
63 //Sets a string value of the attribute with given ID
64 Standard_EXPORT void SetString(const std::string& theID, const std::string& theValue);
66 //Returns a string value of the attribute with given ID
67 Standard_EXPORT std::string GetString(const std::string& theID);
69 //Returns True if there is a string with given ID
70 Standard_EXPORT bool HasStringID(const std::string& theID);
72 //Sets a boolean value of the attribute with given ID
73 Standard_EXPORT void SetBool(const std::string& theID, bool theValue);
75 //Returns a boolean value of the attribute with given ID
76 Standard_EXPORT bool GetBool(const std::string& theID);
78 //Returns True if there is a boolean value with given ID
79 Standard_EXPORT bool HasBoolID(const std::string& theID);
81 //Clears a content of the attribute
82 Standard_EXPORT void Clear();
84 //ID is a std::string that uniquely identify the given type of Attributes within the Application.
85 Standard_EXPORT virtual const std::string& ID() const;
87 //Restores a content of this Attribute from another Attribute
88 Standard_EXPORT virtual void Restore(DF_Attribute* theAttribute);
90 //Creates a new empty copy of this Attribute
91 Standard_EXPORT virtual DF_Attribute* NewEmpty() const;
93 //Pastes a content of this Attribute into another Attribute
94 Standard_EXPORT virtual void Paste(DF_Attribute* theIntoAttribute);
98 std::map<std::string, int> _ints;
99 std::map<std::string, double> _doubles;
100 std::map<std::string, std::string> _strings;
101 std::map<std::string, bool> _bools;