0027970: Improvement of standard attributes usability - containers.
[occt.git] / src / TDataStd / TDataStd_RealArray.hxx
index 86a020c..86f2364 100644 (file)
@@ -26,6 +26,8 @@
 #include <Standard_Integer.hxx>
 #include <Standard_Real.hxx>
 #include <Standard_OStream.hxx>
+#include <Standard_GUID.hxx>
+
 class TDataStd_DeltaOnModificationOfRealArray;
 class Standard_GUID;
 class TDF_Label;
@@ -56,20 +58,33 @@ public:
   //! If attribute is already set, input parameter <isDelta> is refused and the found
   //! attribute returned.
   Standard_EXPORT static Handle(TDataStd_RealArray) Set (const TDF_Label& label, const Standard_Integer lower, const Standard_Integer upper, const Standard_Boolean isDelta = Standard_False);
-  
+  //! Finds, or creates, an RealArray attribute with explicit user defined <guid>.
+  //! The RealArray attribute  is  returned.
+  Standard_EXPORT static Handle(TDataStd_RealArray) Set (const TDF_Label& label, const Standard_GUID&   theGuid,
+                                                         const Standard_Integer lower, const Standard_Integer upper, 
+                                                         const Standard_Boolean isDelta = Standard_False);
+
   //! Initialize the inner array with bounds from <lower> to <upper>
   Standard_EXPORT void Init (const Standard_Integer lower, const Standard_Integer upper);
-  
+  //! Sets the explicit GUID (user defined) for the attribute.
+  Standard_EXPORT void SetID( const Standard_GUID&  theGuid) Standard_OVERRIDE;
+
+  //! Sets default GUID for the attribute.
+  Standard_EXPORT void SetID() Standard_OVERRIDE;
+
   //! Sets  the   <Index>th  element  of   the  array to <Value>
   //! OutOfRange exception is raised if <Index> doesn't respect Lower and Upper bounds of the internal  array.
   Standard_EXPORT void SetValue (const Standard_Integer Index, const Standard_Real Value);
   
   //! Return the value of  the  <Index>th element of the array
   Standard_EXPORT Standard_Real Value (const Standard_Integer Index) const;
-Standard_Real operator () (const Standard_Integer Index) const
-{
-  return Value(Index);
-}
+
+  Standard_Real operator () (const Standard_Integer Index) const
+  {
+    return Value(Index);
+  }
   
   //! Returns the lower boundary of the array.
   Standard_EXPORT Standard_Integer Lower() const;
@@ -122,6 +137,7 @@ private:
 
   Handle(TColStd_HArray1OfReal) myValue;
   Standard_Boolean myIsDelta;
+  Standard_GUID myID;
 
 };