0028832: MMgt_TShared can be replaced by Standard_Transient
[occt.git] / src / StepData / StepData_ESDescr.hxx
CommitLineData
42cf5bc1 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_ESDescr_HeaderFile
18#define _StepData_ESDescr_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <TCollection_AsciiString.hxx>
24#include <TColStd_HArray1OfTransient.hxx>
25#include <StepData_EDescr.hxx>
26#include <Standard_CString.hxx>
27#include <Standard_Integer.hxx>
28#include <Standard_Boolean.hxx>
997e128f 29#include <NCollection_DataMap.hxx>
30#include <TCollection_AsciiString.hxx>
31#include <Standard_Transient.hxx>
42cf5bc1 32class StepData_PDescr;
42cf5bc1 33class StepData_Described;
34
35
36class StepData_ESDescr;
37DEFINE_STANDARD_HANDLE(StepData_ESDescr, StepData_EDescr)
38
39//! This class is intended to describe the authorized form for a
40//! Simple (not Plex) Entity, as a list of fields
41class StepData_ESDescr : public StepData_EDescr
42{
43
44public:
45
46
47 //! Creates an ESDescr with a type name
48 Standard_EXPORT StepData_ESDescr(const Standard_CString name);
49
50 //! Sets a new count of fields
51 //! Each one is described by a PDescr
52 Standard_EXPORT void SetNbFields (const Standard_Integer nb);
53
54 //! Sets a PDescr to describe a field
55 //! A Field is designated by its rank and name
56 Standard_EXPORT void SetField (const Standard_Integer num, const Standard_CString name, const Handle(StepData_PDescr)& descr);
57
58 //! Sets an ESDescr as based on another one
59 //! Hence, if there are inherited fields, the derived ESDescr
60 //! cumulates all them, while the base just records its own ones
61 Standard_EXPORT void SetBase (const Handle(StepData_ESDescr)& base);
62
63 //! Sets an ESDescr as "super-type". Applies an a base (non
64 //! derived) ESDescr
65 Standard_EXPORT void SetSuper (const Handle(StepData_ESDescr)& super);
66
67 //! Returns the type name given at creation time
68 Standard_EXPORT Standard_CString TypeName() const;
69
70 //! Returns the type name as an AsciiString
71 Standard_EXPORT const TCollection_AsciiString& StepType() const;
72
73 //! Returns the basic ESDescr, null if <me> is not derived
74 Standard_EXPORT Handle(StepData_ESDescr) Base() const;
75
76 //! Returns the super-type ESDescr, null if <me> is root
77 Standard_EXPORT Handle(StepData_ESDescr) Super() const;
78
79 //! Tells if <me> is sub-type of (or equal to) another one
80 Standard_EXPORT Standard_Boolean IsSub (const Handle(StepData_ESDescr)& other) const;
81
82 //! Returns the count of fields
83 Standard_EXPORT Standard_Integer NbFields() const;
84
85 //! Returns the rank of a field from its name. 0 if unknown
86 Standard_EXPORT Standard_Integer Rank (const Standard_CString name) const;
87
88 //! Returns the name of a field from its rank. empty if outofrange
89 Standard_EXPORT Standard_CString Name (const Standard_Integer num) const;
90
91 //! Returns the PDescr for the field <num> (or Null)
92 Standard_EXPORT Handle(StepData_PDescr) Field (const Standard_Integer num) const;
93
94 //! Returns the PDescr for the field named <name> (or Null)
95 Standard_EXPORT Handle(StepData_PDescr) NamedField (const Standard_CString name) const;
96
97 //! Tells if a ESDescr matches a step type : exact or super type
79104795 98 Standard_EXPORT Standard_Boolean Matches (const Standard_CString steptype) const Standard_OVERRIDE;
42cf5bc1 99
100 //! Returns False
79104795 101 Standard_EXPORT Standard_Boolean IsComplex() const Standard_OVERRIDE;
42cf5bc1 102
103 //! Creates a described entity (i.e. a simple one)
79104795 104 Standard_EXPORT Handle(StepData_Described) NewEntity() const Standard_OVERRIDE;
42cf5bc1 105
106
107
108
92efcf78 109 DEFINE_STANDARD_RTTIEXT(StepData_ESDescr,StepData_EDescr)
42cf5bc1 110
111protected:
112
113
114
115
116private:
117
118
119 TCollection_AsciiString thenom;
120 Handle(TColStd_HArray1OfTransient) thedescr;
997e128f 121 NCollection_DataMap<TCollection_AsciiString, Standard_Integer> thenames;
42cf5bc1 122 Handle(StepData_ESDescr) thebase;
123 Handle(StepData_ESDescr) thesuper;
124
125
126};
127
128
129
130
131
132
133
134#endif // _StepData_ESDescr_HeaderFile