Book a Demo

Author Topic: Association with array in C++  (Read 2215 times)

tletsch

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Association with array in C++
« on: January 15, 2007, 07:19:34 am »
As I have a situation where an A-object has 0 to 7 B-objects ( A ---> 0..7 B ), I would like to build this with an attribute in class A which is an array of 7 pointers:  B *m_A[7]


How can I do this?

With the "Collection Classes"-dialog or "Member Type:" in the "Association Properties>Target Role" I'm not able to achieve this.

Thanks in advance for any hints
Thomas

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Association with array in C++
« Reply #1 on: January 15, 2007, 01:11:42 pm »
There isn't any way to generate this from an association with the default C++ templates.  You can however modify the templates or use an attribute.

To set up an attribute to use an array like that create it then go to the Detail tab and check 'Attribute is a collection' and set the container type to [7].