Topic
  • 1 reply
  • Latest Post - ‏2013-08-12T04:14:29Z by AE91_SHINJI_KANAI
MartinHansson
MartinHansson
59 Posts

Pinned topic Creating a map to a set(or map or other stl container)

‏2013-07-31T09:23:59Z |

I would like to draw a diagram that generates the following code, C++, but I'm not sure how to go about it.

stl::map< key, stl::set< class > > nameOfMap_;

The set could be any other stl container as I'm thinking the solution would be generic (as long as I can tell Rhapsody what kind of container to generate, usually through properties).

Anyone have a suggestion?
Feel free to ask for a clarification as I know this question was a bit terse but could not come up with a better explanation for what I want to do.

  • AE91_SHINJI_KANAI
    AE91_SHINJI_KANAI
    199 Posts

    Re: Creating a map to a set(or map or other stl container)

    ‏2013-08-12T04:14:29Z  

    Please check the attached sample project (saved in RiC++ v7.6). You will see the following code generated in A.h for the relation between Class A and Class set<T>. 

    std::map<int, std::set<int>> nameOfMap_;

    To replace "set" with other stl container, you can add a corresponding template class to std package. Is it similar to what you're trying to accomplish?  The model still contains series of compile errors to be fixed, but hope it will give you an idea. 

    --Shinji

    Attachments