0029269: Improvement for thread safety of the STEP translator - cleanup
[occt.git] / src / StepData / StepData_Simple.hxx
1 // Created on: 1997-05-09
2 // Created by: Christian CAILLET
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _StepData_Simple_HeaderFile
18 #define _StepData_Simple_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <StepData_FieldListN.hxx>
24 #include <StepData_Described.hxx>
25 #include <Standard_CString.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Integer.hxx>
28 class Interface_InterfaceMismatch;
29 class StepData_ESDescr;
30 class StepData_Field;
31 class StepData_FieldListN;
32 class Interface_Check;
33 class Interface_EntityIterator;
34
35
36 class StepData_Simple;
37 DEFINE_STANDARD_HANDLE(StepData_Simple, StepData_Described)
38
39 //! A Simple Entity is defined by a type (which can heve super
40 //! types) and a list of parameters
41 class StepData_Simple : public StepData_Described
42 {
43
44 public:
45
46   
47   //! Creates a Simple Entity
48   Standard_EXPORT StepData_Simple(const Handle(StepData_ESDescr)& descr);
49   
50   //! Returns description, as for simple
51   Standard_EXPORT Handle(StepData_ESDescr) ESDescr() const;
52   
53   //! Returns the recorded StepType (TypeName of its ESDescr)
54   Standard_EXPORT Standard_CString StepType() const;
55   
56   //! Returns False
57   Standard_EXPORT Standard_Boolean IsComplex() const Standard_OVERRIDE;
58   
59   //! Tells if a step type is matched by <me>
60   //! For a Simple Entity : own type or super type
61   //! For a Complex Entity : one of the members
62   Standard_EXPORT Standard_Boolean Matches (const Standard_CString steptype) const Standard_OVERRIDE;
63   
64   //! Returns a Simple Entity which matches with a Type in <me> :
65   //! For a Simple Entity : me if it matches, else a null handle
66   //! For a Complex Entity : the member which matches, else null
67   Standard_EXPORT Handle(StepData_Simple) As (const Standard_CString steptype) const Standard_OVERRIDE;
68   
69   //! Tells if a Field brings a given name
70   Standard_EXPORT Standard_Boolean HasField (const Standard_CString name) const Standard_OVERRIDE;
71   
72   //! Returns a Field from its name; read-only
73   Standard_EXPORT const StepData_Field& Field (const Standard_CString name) const Standard_OVERRIDE;
74   
75   //! Returns a Field from its name; read or write
76   Standard_EXPORT StepData_Field& CField (const Standard_CString name) Standard_OVERRIDE;
77   
78   //! Returns the count of fields
79   Standard_EXPORT Standard_Integer NbFields() const;
80   
81   //! Returns a field from its rank, for read-only use
82   Standard_EXPORT const StepData_Field& FieldNum (const Standard_Integer num) const;
83   
84   //! Returns a field from its rank, in order to modify it
85   Standard_EXPORT StepData_Field& CFieldNum (const Standard_Integer num);
86   
87   //! Returns the entire field list, read-only
88   Standard_EXPORT const StepData_FieldListN& Fields() const;
89   
90   //! Returns the entire field list, read or write
91   Standard_EXPORT StepData_FieldListN& CFields();
92   
93   //! Fills a Check by using its Description
94   Standard_EXPORT void Check (Handle(Interface_Check)& ach) const Standard_OVERRIDE;
95   
96   //! Fills an EntityIterator with entities shared by <me>
97   Standard_EXPORT void Shared (Interface_EntityIterator& list) const Standard_OVERRIDE;
98
99
100
101
102   DEFINE_STANDARD_RTTIEXT(StepData_Simple,StepData_Described)
103
104 protected:
105
106
107
108
109 private:
110
111
112   StepData_FieldListN thefields;
113
114
115 };
116
117
118
119
120
121
122
123 #endif // _StepData_Simple_HeaderFile