Salome HOME
DCQ: prepare V2.0.0
[modules/yacs.git] / src / SALOMEDS / SALOMEDS_TableOfIntegerAttribute.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_TableOfIntegerAttribute.hxx
8 //  Author : Michael Ponikarov
9 //  Module : SALOME
10 //  $Header$
11
12 #ifndef _SALOMEDS_TableOfIntegerAttribute_HeaderFile
13 #define _SALOMEDS_TableOfIntegerAttribute_HeaderFile
14
15 #ifndef _Standard_HeaderFile
16 #include <Standard.hxx>
17 #endif
18 #ifndef _Handle_SALOMEDS_TableOfIntegerAttribute_HeaderFile
19 #include <Handle_SALOMEDS_TableOfIntegerAttribute.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_DataMapOfIntegerInteger_HeaderFile
33 #include <TColStd_DataMapOfIntegerInteger.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 #ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile
43 #include <Handle_TColStd_HSequenceOfInteger.hxx>
44 #endif
45 #ifndef _Standard_Boolean_HeaderFile
46 #include <Standard_Boolean.hxx>
47 #endif
48 #ifndef _Handle_TDF_Attribute_HeaderFile
49 #include <Handle_TDF_Attribute.hxx>
50 #endif
51 #ifndef _Handle_TDF_RelocationTable_HeaderFile
52 #include <Handle_TDF_RelocationTable.hxx>
53 #endif
54 class TColStd_HSequenceOfExtendedString;
55 class Standard_GUID;
56 class TDF_Label;
57 class TCollection_ExtendedString;
58 class TColStd_HSequenceOfInteger;
59 class TDF_Attribute;
60 class TDF_RelocationTable;
61
62 #include <strstream>
63
64 class SALOMEDS_TableOfIntegerAttribute : public TDF_Attribute {
65
66 public:
67
68     inline void* operator new(size_t,void* anAddress) 
69       {
70         return anAddress;
71       }
72     inline void* operator new(size_t size) 
73       { 
74         return Standard::Allocate(size); 
75       }
76     inline void  operator delete(void *anAddress) 
77       { 
78         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
79       }
80 //    inline void  operator delete(void *anAddress, size_t size) 
81 //      { 
82 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
83 //      }
84  // Methods PUBLIC
85  // 
86 Standard_EXPORT static const Standard_GUID& GetID() ;
87 Standard_EXPORT static  Handle_SALOMEDS_TableOfIntegerAttribute Set(const TDF_Label& label) ;
88 Standard_EXPORT SALOMEDS_TableOfIntegerAttribute();
89 Standard_EXPORT   void SetNbColumns(const Standard_Integer theNbColumns);
90 Standard_EXPORT   void SetTitle(const TCollection_ExtendedString& theTitle) ;
91 Standard_EXPORT   TCollection_ExtendedString GetTitle() const;
92 Standard_EXPORT   void SetRowData(const Standard_Integer theRow,const Handle(TColStd_HSequenceOfInteger)& theData) ;
93 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetRowData(const Standard_Integer theRow) ;
94 Standard_EXPORT   void SetRowTitle(const Standard_Integer theRow,const TCollection_ExtendedString& theTitle) ;
95 Standard_EXPORT   TCollection_ExtendedString GetRowTitle(const Standard_Integer theRow) const;
96 Standard_EXPORT   void SetColumnData(const Standard_Integer theColumn,const Handle(TColStd_HSequenceOfInteger)& theData) ;
97 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetColumnData(const Standard_Integer theColumn) ;
98 Standard_EXPORT   void SetColumnTitle(const Standard_Integer theColumn,const TCollection_ExtendedString& theTitle) ;
99 Standard_EXPORT   TCollection_ExtendedString GetColumnTitle(const Standard_Integer theColumn) const;
100 Standard_EXPORT   Standard_Integer GetNbRows() const;
101 Standard_EXPORT   Standard_Integer GetNbColumns() const;
102
103 Standard_EXPORT   void PutValue(const Standard_Integer theValue,const Standard_Integer theRow,const Standard_Integer theColumn) ;
104 Standard_EXPORT   Standard_Boolean HasValue(const Standard_Integer theRow,const Standard_Integer theColumn) ;
105 Standard_EXPORT   Standard_Integer GetValue(const Standard_Integer theRow,const Standard_Integer theColumn) ;
106 Standard_EXPORT  const Standard_GUID& ID() const;
107 Standard_EXPORT   void Restore(const Handle(TDF_Attribute)& with) ;
108 Standard_EXPORT   Handle_TDF_Attribute NewEmpty() const;
109 Standard_EXPORT   void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const;
110
111 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetSetRowIndices(const Standard_Integer theRow);
112 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetSetColumnIndices(const Standard_Integer theColumn);
113
114 Standard_EXPORT   void ConvertToString(ostrstream& theStream);
115 Standard_EXPORT   bool RestoreFromString(istrstream& theStream);
116
117 Standard_EXPORT ~SALOMEDS_TableOfIntegerAttribute();
118
119
120
121
122  // Type management
123  //
124  Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_TableOfIntegerAttribute_Type_();
125  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
126  Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
127
128 protected:
129
130  // Methods PROTECTED
131  // 
132
133
134  // Fields PROTECTED
135  //
136
137
138 private: 
139
140  // Methods PRIVATE
141  // 
142
143
144  // Fields PRIVATE
145  //
146 TColStd_DataMapOfIntegerInteger myTable;
147 TCollection_ExtendedString myTitle;
148 Handle_TColStd_HSequenceOfExtendedString myRows;
149 Handle_TColStd_HSequenceOfExtendedString myCols;
150 Standard_Integer myNbRows;
151 Standard_Integer myNbColumns;
152
153 };
154
155
156
157
158
159 // other inline functions and methods (like "C++: function call" methods)
160 //
161
162
163 #endif