Salome HOME
portage sur processeur alpha/osf
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_TableOfRealAttribute.hxx
1 //  SALOME SALOMEDS : data structure of SALOME and sources of Salome data server 
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : SALOMEDS_TableOfRealAttribute.hxx
8 //  Author : Michael Ponikarov
9 //  Module : SALOME
10 //  $Header$
11
12 #ifndef _SALOMEDS_TableOfRealAttribute_HeaderFile
13 #define _SALOMEDS_TableOfRealAttribute_HeaderFile
14
15 #ifndef _Standard_HeaderFile
16 #include <Standard.hxx>
17 #endif
18 #ifndef _Handle_SALOMEDS_TableOfRealAttribute_HeaderFile
19 #include <Handle_SALOMEDS_TableOfRealAttribute.hxx>
20 #endif
21
22 #ifndef _TColStd_SequenceOfTransient_HeaderFile
23 #include <TColStd_SequenceOfTransient.hxx>
24 #endif
25 #ifndef _TCollection_ExtendedString_HeaderFile
26 #include <TCollection_ExtendedString.hxx>
27 #endif
28 #ifndef _Handle_TColStd_HSequenceOfExtendedString_HeaderFile
29 #include <Handle_TColStd_HSequenceOfExtendedString.hxx>
30 #endif
31
32 #ifndef _TColStd_DataMapOfIntegerReal_HeaderFile
33 #include <TColStd_DataMapOfIntegerReal.hxx>
34 #endif
35
36 #ifndef _TDF_Attribute_HeaderFile
37 #include <TDF_Attribute.hxx>
38 #endif
39 #ifndef _Standard_Integer_HeaderFile
40 #include <Standard_Integer.hxx>
41 #endif
42
43 #ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile
44 #include <Handle_TColStd_HSequenceOfInteger.hxx>
45 #endif 
46
47 #ifndef TColStd_HSequenceOfInteger_HeaderFile
48 #include <TColStd_HSequenceOfInteger.hxx>
49 #endif 
50
51 #ifndef _Handle_TColStd_HSequenceOfReal_HeaderFile
52 #include <Handle_TColStd_HSequenceOfReal.hxx>
53 #endif
54 #ifndef _Standard_Boolean_HeaderFile
55 #include <Standard_Boolean.hxx>
56 #endif
57 #ifndef _Handle_TDF_Attribute_HeaderFile
58 #include <Handle_TDF_Attribute.hxx>
59 #endif
60 #ifndef _Handle_TDF_RelocationTable_HeaderFile
61 #include <Handle_TDF_RelocationTable.hxx>
62 #endif
63 class TColStd_HSequenceOfExtendedString;
64 class Standard_GUID;
65 class TDF_Label;
66 class TCollection_ExtendedString;
67 class TColStd_HSequenceOfReal;
68 class TDF_Attribute;
69 class TDF_RelocationTable;
70
71 #include <strstream>
72
73 class SALOMEDS_TableOfRealAttribute : public TDF_Attribute {
74
75 public:
76
77     inline void* operator new(size_t,void* anAddress) 
78       {
79         return anAddress;
80       }
81     inline void* operator new(size_t size) 
82       { 
83         return Standard::Allocate(size); 
84       }
85     inline void  operator delete(void *anAddress) 
86       { 
87         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
88       }
89 //    inline void  operator delete(void *anAddress, size_t size) 
90 //      { 
91 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
92 //      }
93  // Methods PUBLIC
94  // 
95 Standard_EXPORT static const Standard_GUID& GetID() ;
96 Standard_EXPORT static  Handle_SALOMEDS_TableOfRealAttribute Set(const TDF_Label& label) ;
97 Standard_EXPORT SALOMEDS_TableOfRealAttribute();
98 Standard_EXPORT   void SetNbColumns(const Standard_Integer theNbColumns);
99 Standard_EXPORT   void SetTitle(const TCollection_ExtendedString& theTitle) ;
100 Standard_EXPORT   TCollection_ExtendedString GetTitle() const;
101 Standard_EXPORT   void SetRowData(const Standard_Integer theRow,const Handle(TColStd_HSequenceOfReal)& theData) ;
102 Standard_EXPORT   Handle_TColStd_HSequenceOfReal GetRowData(const Standard_Integer theRow) ;
103 Standard_EXPORT   void SetRowTitle(const Standard_Integer theRow,const TCollection_ExtendedString& theTitle) ;
104 Standard_EXPORT   TCollection_ExtendedString GetRowTitle(const Standard_Integer theRow) const;
105 Standard_EXPORT   void SetColumnData(const Standard_Integer theColumn,const Handle(TColStd_HSequenceOfReal)& theData) ;
106 Standard_EXPORT   Handle_TColStd_HSequenceOfReal GetColumnData(const Standard_Integer theColumn) ;
107 Standard_EXPORT   void SetColumnTitle(const Standard_Integer theColumn,const TCollection_ExtendedString& theTitle) ;
108 Standard_EXPORT   TCollection_ExtendedString GetColumnTitle(const Standard_Integer theColumn) const;
109 Standard_EXPORT   Standard_Integer GetNbRows() const;
110 Standard_EXPORT   Standard_Integer GetNbColumns() const;
111
112 Standard_EXPORT   void PutValue(const Standard_Real theValue,const Standard_Integer theRow,const Standard_Integer theColumn) ;
113 Standard_EXPORT   Standard_Boolean HasValue(const Standard_Integer theRow,const Standard_Integer theColumn) ;
114 Standard_EXPORT   Standard_Real GetValue(const Standard_Integer theRow,const Standard_Integer theColumn) ;
115 Standard_EXPORT  const Standard_GUID& ID() const;
116 Standard_EXPORT   void Restore(const Handle(TDF_Attribute)& with) ;
117 Standard_EXPORT   Handle_TDF_Attribute NewEmpty() const;
118 Standard_EXPORT   void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const;
119
120 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetSetRowIndices(const Standard_Integer theRow);
121 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetSetColumnIndices(const Standard_Integer theColumn);
122
123 Standard_EXPORT   void ConvertToString(std::ostrstream& theStream);
124 Standard_EXPORT   bool RestoreFromString(std::istrstream& theStream);
125
126 Standard_EXPORT ~SALOMEDS_TableOfRealAttribute();
127
128
129
130
131  // Type management
132  //
133  Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_TableOfRealAttribute_Type_();
134  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
135  Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
136
137 protected:
138
139  // Methods PROTECTED
140  // 
141
142
143  // Fields PROTECTED
144  //
145
146 private: 
147
148  // Methods PRIVATE
149  // 
150
151
152  // Fields PRIVATE
153  //
154 TColStd_DataMapOfIntegerReal myTable;
155 TCollection_ExtendedString myTitle;
156 Handle_TColStd_HSequenceOfExtendedString myRows;
157 Handle_TColStd_HSequenceOfExtendedString myCols;
158 Standard_Integer myNbRows;
159 Standard_Integer myNbColumns;
160
161 };
162
163
164
165
166
167 // other inline functions and methods (like "C++: function call" methods)
168 //
169
170
171 #endif