1 #ifndef DFCONTAINER_HXX
2 #define DFCONTAINER_HXX
4 #include "DF_definitions.hxx"
5 #include "DF_Attribute.hxx"
9 //Class DF_Container is used to store several types of data
10 class DF_Container : public DF_Attribute
14 //Static method that returns an ID of the give type of attributes
15 Standard_EXPORT static const std::string& GetID();
17 //Creates if not exists a Container attribute and places if is not placed it the Label
18 Standard_EXPORT static DF_Container* Set(DF_Label& theLabel);
21 Standard_EXPORT DF_Container();
24 Standard_EXPORT ~DF_Container();
26 //Sets an integer value of the attribute with given ID
27 Standard_EXPORT void SetInt(const std::string& theID, int theValue);
29 //Returns an integer value of the attribute with given ID
30 Standard_EXPORT int GetInt(const std::string& theID);
32 //Returns True if there is an integer with given ID
33 Standard_EXPORT bool HasIntID(const std::string& theID);
35 //Sets a double value of the attribute with given ID
36 Standard_EXPORT void SetDouble(const std::string& theID, const double& theValue);
38 //Returns a double value of the attribute with given ID
39 Standard_EXPORT double GetDouble(const std::string& theID);
41 //Returns True if there is a double with given ID
42 Standard_EXPORT bool HasDoubleID(const std::string& theID);
44 //Sets a string value of the attribute with given ID
45 Standard_EXPORT void SetString(const std::string& theID, const std::string& theValue);
47 //Returns a string value of the attribute with given ID
48 Standard_EXPORT std::string GetString(const std::string& theID);
50 //Returns True if there is a string with given ID
51 Standard_EXPORT bool HasStringID(const std::string& theID);
53 //Sets a boolean value of the attribute with given ID
54 Standard_EXPORT void SetBool(const std::string& theID, bool theValue);
56 //Returns a boolean value of the attribute with given ID
57 Standard_EXPORT bool GetBool(const std::string& theID);
59 //Returns True if there is a boolean value with given ID
60 Standard_EXPORT bool HasBoolID(const std::string& theID);
62 //Clears a content of the attribute
63 Standard_EXPORT void Clear();
65 //ID is a std::string that uniquely identify the given type of Attributes within the Application.
66 Standard_EXPORT virtual const std::string& ID() const;
68 //Restores a content of this Attribute from another Attribute
69 Standard_EXPORT virtual void Restore(DF_Attribute* theAttribute);
71 //Creates a new empty copy of this Attribute
72 Standard_EXPORT virtual DF_Attribute* NewEmpty() const;
74 //Pastes a content of this Attribute into another Attribute
75 Standard_EXPORT virtual void Paste(DF_Attribute* theIntoAttribute);
79 std::map<std::string, int> _ints;
80 std::map<std::string, double> _doubles;
81 std::map<std::string, std::string> _strings;
82 std::map<std::string, bool> _bools;