|
10 | 10 | * and is not subject to copyright. |
11 | 11 | */ |
12 | 12 |
|
13 | | -#include <sc_cf.h> |
14 | | - |
15 | | -#include <memory.h> |
16 | | -#include <math.h> |
17 | | -#include <stdio.h> |
18 | | - |
19 | | -#include <ExpDict.h> |
20 | | -#include <STEPaggregate.h> |
21 | | -#include <Registry.h> |
22 | | -#include "sc_memmgr.h" |
23 | | -#include <SubSuperIterators.h> |
24 | | - |
25 | | - |
26 | | -/////////////////////////////////////////////////////////////////////////////// |
27 | | - |
28 | | -/////////////////////////////////////////////////////////////////////////////// |
29 | | - |
30 | | - |
31 | | -////////////////////////////////////////////////////////////////////////////// |
32 | | - |
33 | | -/////////////////////////////////////////////////////////////////////////////// |
34 | | - |
35 | | -EnumAggregate * create_EnumAggregate() { |
36 | | - return new EnumAggregate; |
37 | | -} |
38 | | - |
39 | | -GenericAggregate * create_GenericAggregate() { |
40 | | - return new GenericAggregate; |
41 | | -} |
42 | | - |
43 | | -EntityAggregate * create_EntityAggregate() { |
44 | | - return new EntityAggregate; |
45 | | -} |
46 | | - |
47 | | -SelectAggregate * create_SelectAggregate() { |
48 | | - return new SelectAggregate; |
49 | | -} |
50 | | - |
51 | | -StringAggregate * create_StringAggregate() { |
52 | | - return new StringAggregate; |
53 | | -} |
54 | | - |
55 | | -BinaryAggregate * create_BinaryAggregate() { |
56 | | - return new BinaryAggregate; |
57 | | -} |
58 | | - |
59 | | -RealAggregate * create_RealAggregate() { |
60 | | - return new RealAggregate; |
61 | | -} |
62 | | - |
63 | | -IntAggregate * create_IntAggregate() { |
64 | | - return new IntAggregate; |
65 | | -} |
66 | | - |
67 | | - |
68 | | - |
69 | | -/////////////////////////////////////////////////////////////////////////////// |
70 | | - |
71 | | - |
72 | | -/////////////////////////////////////////////////////////////////////////////// |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
77 | | -/** FIXME |
78 | | - * #ifdef NOT_YET |
79 | | - /////////////////////////////////////////////////////////////////////////////// |
80 | | - // EnumerationTypeDescriptor functions |
81 | | - /////////////////////////////////////////////////////////////////////////////// |
82 | | - EnumerationTypeDescriptor::EnumerationTypeDescriptor( ) { |
83 | | - _elements = new StringAggregate; |
84 | | - } |
85 | | - * #endif |
86 | | - */ |
87 | | - |
88 | | -/////////////////////////////////////////////////////////////////////////////// |
89 | | -// SelectTypeDescriptor functions |
90 | | -/////////////////////////////////////////////////////////////////////////////// |
91 | | - |
92 | | -SDAI_Select * SelectTypeDescriptor::CreateSelect() { |
93 | | - if( CreateNewSelect ) { |
94 | | - return CreateNewSelect(); |
95 | | - } else { |
96 | | - return 0; |
97 | | - } |
98 | | -} |
99 | | - |
100 | | -const TypeDescriptor * SelectTypeDescriptor::IsA( const TypeDescriptor * other ) const { |
101 | | - return TypeDescriptor::IsA( other ); |
102 | | -} |
103 | | - |
104 | | -/** |
105 | | - * returns the td among the choices of tds describing elements of this select |
106 | | - * type but only at this unexpanded level. The td ultimately describing the |
107 | | - * type may be an element of a td for a select that is returned. |
108 | | - */ |
109 | | -const TypeDescriptor * SelectTypeDescriptor::CanBe( const TypeDescriptor * other ) const { |
110 | | - if( this == other ) { |
111 | | - return other; |
112 | | - } |
113 | | - |
114 | | - TypeDescItr elements( GetElements() ) ; |
115 | | - const TypeDescriptor * td = elements.NextTypeDesc(); |
116 | | - while( td ) { |
117 | | - if( td -> CanBe( other ) ) { |
118 | | - return td; |
119 | | - } |
120 | | - td = elements.NextTypeDesc(); |
121 | | - } |
122 | | - return 0; |
123 | | -} |
124 | | - |
125 | | -/** |
126 | | - * returns the td among the choices of tds describing elements of this select |
127 | | - * type but only at this unexpanded level. The td ultimately describing the |
128 | | - * type may be an element of a td for a select that is returned. |
129 | | - */ |
130 | | -const TypeDescriptor * SelectTypeDescriptor::CanBe( const char * other ) const { |
131 | | - TypeDescItr elements( GetElements() ) ; |
132 | | - const TypeDescriptor * td = 0; |
133 | | - |
134 | | - // see if other is the select |
135 | | - if( !StrCmpIns( _name, other ) ) { |
136 | | - return this; |
137 | | - } |
138 | | - |
139 | | - // see if other is one of the elements |
140 | | - while( ( td = elements.NextTypeDesc() ) ) { |
141 | | - if( td -> CanBe( other ) ) { |
142 | | - return td; |
143 | | - } |
144 | | - } |
145 | | - return 0; |
146 | | -} |
147 | | - |
148 | | -/** |
149 | | - * A modified CanBe, used to determine if "other", a string we have just read, |
150 | | - * is a possible type-choice of this. (I.e., our select "CanBeSet" to this |
151 | | - * choice.) This deals with the following issue, based on the Tech Corrigendum |
152 | | - * to Part 21: Say our select ("selP") has an item which is itself a select |
153 | | - * ("selQ"). Say it has another select item which is a redefinition of another |
154 | | - * select ("TYPE selR = selS;"). According to the T.C., if selP is set to one |
155 | | - * of the members of selQ, "selQ(...)" may not appear in the instantiation. |
156 | | - * If, however, selP is set to a member of selR, "selR(...)" must appear first. |
157 | | - * The code below checks if "other" = one of our possible choices. If one of |
158 | | - * our choices is a select like selQ, we recurse to see if other matches a |
159 | | - * member of selQ (and don't look for "selQ"). If we have a choice like selR, |
160 | | - * we check if other = "selR", but do not look at selR's members. This func- |
161 | | - * tion also takes into account schNm, the name of the current schema. If |
162 | | - * schNm does not = the schema in which this type was declared, it's possible |
163 | | - * that it should be referred to with a different name. This would be the case |
164 | | - * if schNm = a schema which USEs or REFERENCEs this and renames it (e.g., "USE |
165 | | - * from XX (A as B)"). |
| 13 | +/* |
| 14 | + * \file ExpDict.cc |
| 15 | + * this file has been split into many smaller files, organized by class rather than by member: |
| 16 | + * |
| 17 | + * aggrTypeDescriptor.cc dictSchema.cc globalRule.cc inverseAttributeList.cc typeOrRuleVar.cc |
| 18 | + * attrDescriptor.cc entityDescriptor.cc implicitItemId.cc schRename.cc uniquenessRule.cc |
| 19 | + * attrDescriptorList.cc entityDescriptorList.cc interfaceSpec.cc selectTypeDescriptor.cc whereRule.cc |
| 20 | + * create_Aggr.cc enumTypeDescriptor.cc interfacedItem.cc typeDescriptor.cc |
| 21 | + * derivedAttribute.cc explicitItemId.cc inverseAttribute.cc typeDescriptorList.cc |
166 | 22 | */ |
167 | | -const TypeDescriptor * SelectTypeDescriptor::CanBeSet( const char * other, const char * schNm ) const { |
168 | | - TypeDescItr elements( GetElements() ) ; |
169 | | - const TypeDescriptor * td = elements.NextTypeDesc(); |
170 | | - |
171 | | - while( td ) { |
172 | | - if( td->Type() == REFERENCE_TYPE && td->NonRefType() == sdaiSELECT ) { |
173 | | - // Just look at this level, don't look at my items (see intro). |
174 | | - if( td->CurrName( other, schNm ) ) { |
175 | | - return td; |
176 | | - } |
177 | | - } else if( td->CanBeSet( other, schNm ) ) { |
178 | | - return td; |
179 | | - } |
180 | | - td = elements.NextTypeDesc(); |
181 | | - } |
182 | | - return 0; |
183 | | -} |
184 | | - |
185 | | -/////////////////////////////////////////////////////////////////////////////// |
186 | | -// AggrTypeDescriptor functions |
187 | | -/////////////////////////////////////////////////////////////////////////////// |
188 | | - |
189 | | -STEPaggregate * AggrTypeDescriptor::CreateAggregate() { |
190 | | - if( CreateNewAggr ) { |
191 | | - return CreateNewAggr(); |
192 | | - } else { |
193 | | - return 0; |
194 | | - } |
195 | | -} |
196 | | - |
197 | | -void AggrTypeDescriptor::AssignAggrCreator( AggregateCreator f ) { |
198 | | - CreateNewAggr = f; |
199 | | -} |
200 | | - |
201 | | -AggrTypeDescriptor::AggrTypeDescriptor( ) : |
202 | | - _uniqueElements( "UNKNOWN_TYPE" ) { |
203 | | - _bound1 = -1; |
204 | | - _bound2 = -1; |
205 | | - _aggrDomainType = 0; |
206 | | -} |
207 | | - |
208 | | -AggrTypeDescriptor::AggrTypeDescriptor( SDAI_Integer b1, |
209 | | - SDAI_Integer b2, |
210 | | - Logical uniqElem, |
211 | | - TypeDescriptor * aggrDomType ) |
212 | | - : _bound1( b1 ), _bound2( b2 ), _uniqueElements( uniqElem ) { |
213 | | - _aggrDomainType = aggrDomType; |
214 | | -} |
215 | | - |
216 | | -AggrTypeDescriptor::~AggrTypeDescriptor() { |
217 | | -} |
0 commit comments