@@ -77,36 +77,36 @@ class lazyRefs {
7777 potentialReferentInsts ( edL );
7878 // 3d - load each inst
7979 /* invAttrListNode * invNode*/
80- iAstruct * ias = invAttr ( _inst, ia );
80+ iAstruct ias = invAttr ( _inst, ia );
8181 referentInstances_t::iterator insts = _referentInstances.begin ();
8282 for ( ; insts != _referentInstances.end (); ++insts ) {
8383 loadInstIFFreferent ( *insts, ias, ia );
8484 }
8585 // 3f - cache edL - TODO
8686 }
8787
88- void loadInstIFFreferent ( instanceID inst, iAstruct * ias, const Inverse_attribute * ia ) {
88+ void loadInstIFFreferent ( instanceID inst, iAstruct ias, const Inverse_attribute * ia ) {
8989 std::cout << " liir for inst #" << _inst->STEPfile_id << " , referent #" << inst << " , ia " << ia->Name () << " (" << (void *) ia;
90- std::cout << " ), ias " << (void *) ias << std::endl;
90+ std::cout << " ), ias " << (void *) & ias << std::endl;
9191 bool prevLoaded = _lim->isLoaded ( inst );
9292 SDAI_Application_instance * rinst = _lim->loadInstance ( inst );
9393 bool ref = refersToCurrentInst ( ia, rinst );
9494 if ( ref ) {
9595 if ( ia->inverted_attr_ ()->IsAggrType () ) {
96- if ( !ias-> a ) {
97- ias-> a = new EntityAggregate;
98- _inst->setInvAttr ( ia, * ias );
99- assert ( invAttr ( _inst, ia )-> a == ias-> a );
96+ if ( !ias. a ) {
97+ ias. a = new EntityAggregate;
98+ _inst->setInvAttr ( ia, ias );
99+ assert ( invAttr ( _inst, ia ). a == ias. a );
100100 }
101- EntityAggregate * ea = ias-> a ;
101+ EntityAggregate * ea = ias. a ;
102102// assert( ias->a && "is it possible for this to be null here? if so, must create & assign");
103103 // FIXME InitIAttrs has been called, but this is null. what to do? init here? if not, where???
104104 // TODO check if duplicate
105105 ea->AddNode ( new EntityNode ( rinst ) );
106106 } else {
107- SDAI_Application_instance * ai = ias-> i ;
107+ SDAI_Application_instance * ai = ias. i ;
108108 if ( !ai ) {
109- ias-> i = rinst;
109+ ias. i = rinst;
110110 } else if ( ai->GetFileId () != inst ) {
111111 std::cerr << " ERROR: two instances (" << rinst << " and " << ai->GetFileId () << " ) refer to inst " ;
112112 std::cerr << _inst->GetFileId () << " , but its inverse attribute is not an aggregation type!" << std::endl;
@@ -166,27 +166,12 @@ class lazyRefs {
166166 return -1 ;
167167 }
168168
169- iAstruct * invAttr ( SDAI_Application_instance * inst, const Inverse_attribute * ia /* , iaList_t & iaList */ ) {
170- /* looks for iAttrs in schemas/sdai_ap214e3/entity/SdaiGeometric_representation_context.cc, but the ctors don't populate it
171- * shouldn't the parent class ctor populate it?
172- ENTITY representation_context;
173- context_identifier : identifier;
174- context_type : text;
175- INVERSE
176- representations_in_context : SET [1:?] OF representation FOR context_of_items
177- ;
178- END_ENTITY; -- 10303-43: representation_schema
179-
180- ENTITY geometric_representation_context
181- SUBTYPE OF (representation_context);
182- coordinate_space_dimension : dimension_count;
183- END_ENTITY; -- 10303-42: geometry_schema
184- */
169+ iAstruct invAttr ( SDAI_Application_instance * inst, const Inverse_attribute * ia /* , iaList_t & iaList */ ) {
185170 SDAI_Application_instance::iAMap_t map = inst->getInvAttrs ();
186171 SDAI_Application_instance::iAMap_t::iterator iai = map.begin ();
187172 while ( iai != map.end () ) {
188173 if ( iai->first == ia ) {
189- return &( iai->second ) ;
174+ return iai->second ;
190175 }
191176 ++iai;
192177 }
@@ -198,8 +183,10 @@ END_ENTITY; -- 10303-42: geometry_schema
198183 std::cerr << iai->first ->Name () << " : " << (void *)(iai->second .a ) << " , " ;
199184 }
200185 std::cerr << std::endl;
201- abort ();
202- // // return NULL;
186+ // abort();
187+ iAstruct nil;
188+ memset ( &nil, 0 , sizeof ( nil ) );
189+ return nil;
203190 }
204191
205192 /* * 3c. compare the type of each item in R with types in A
0 commit comments