mpictor/StepClassLibrary — Issue #138: compiler error (ap210e3): declaration of '_rep_1' conflicts with previous...
Author: mpictor
Created: 2012-02-11 18:21:23+00:00
State: open

component_2d_location has multiple variables with the same name, because it inherits representation_relationship from more than one supertype:

```C++
class SdaiComponent_2d_location : public SdaiContext_dependent_shape_representation {
protected:
SDAI_String _name ;
SDAI_Application_instance_ptr _rep_1 ;
SDAI_Application_instance_ptr _rep_2 ;
SDAI_String _name ;
SDAI_Application_instance_ptr _rep_1 ;
SDAI_Application_instance_ptr _rep_2 ;
//...
}
```

errors:

...
SdaiMULTIPLE_REP.h:247:39: error: declaration of ‘SDAI_Application_instance* SdaiComponent_2d_location::_rep_1’
SdaiMULTIPLE_REP.h:244:39: error: conflicts with previous declaration ‘SDAI_Application_instance* SdaiComponent_2d_location::_rep_1’
...
SdaiMULTIPLE_REP.h:268:38: error: ‘SdaiRepresentation* const SdaiComponent_2d_location::rep_1_() const’ cannot be overloaded
SdaiMULTIPLE_REP.h:259:38: error: with ‘SdaiRepresentation* const SdaiComponent_2d_location::rep_1_() const’
...

relatively small schema, derived from ap210e3:

```
SCHEMA multiple_rep;

ENTITY component_2d_location
SUBTYPE OF (context_dependent_shape_representation, shape_representation_relationship, definitional_representation_relationship);
DERIVE
SELF\context_dependent_shape_representation.representation_relation : component_2d_location := SELF; -- NEW
WHERE
WR1: SELF\representation_relationship.name = 'component 2d location';
END_ENTITY;

ENTITY context_dependent_shape_representation;
representation_relation : shape_representation_relationship;
WHERE
WR2: SIZEOF(USEDIN(SELF, 'MULTIPLE_REP.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
WR3: SIZEOF(USEDIN(SELF, 'MULTIPLE_REP.' + 'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1;
END_ENTITY;

ENTITY shape_representation_relationship
SUBTYPE OF (representation_relationship);
WHERE
WR1: 'MULTIPLE_REP.SHAPE_REPRESENTATION' IN (TYPEOF(SELF\representation_relationship.rep_1) + TYPEOF(SELF\representation_relationship.rep_2));
END_ENTITY;

ENTITY definitional_representation_relationship
SUBTYPE OF (representation_relationship);
END_ENTITY;

ENTITY representation_relationship;
name : label;
rep_1 : representation;
rep_2 : representation;
END_ENTITY;

ENTITY property_definition ;
name : label;
definition : characterized_definition;
WHERE
WR1: SIZEOF(USEDIN(SELF, 'MULTIPLE_REP.' + 'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
END_ENTITY;

ENTITY representation;
name : label;
items : SET[1:?] OF representation_item;
context_of_items : representation_context;
WHERE
WR1: SIZEOF (USEDIN (SELF, 'MULTIPLE_REP.' + 'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
WR2: SIZEOF (USEDIN (SELF, 'MULTIPLE_REP.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
END_ENTITY;

TYPE characterized_definition = SELECT (characterized_object, characterized_product_definition, shape_definition);
END_TYPE;

TYPE text = STRING; END_TYPE;
TYPE characterized_object = STRING; END_TYPE;
TYPE characterized_product_definition = STRING; END_TYPE;
TYPE shape_definition = STRING; END_TYPE;
TYPE label = STRING; END_TYPE;
TYPE representation_item = STRING; END_TYPE;
TYPE representation_context = STRING; END_TYPE;
TYPE identifier = STRING; END_TYPE;
TYPE transformation = STRING; END_TYPE;

END_SCHEMA;
```