I'm using rhapsody7.5, i want to create a object from class CA,which is an active class,and has the constructor CA(int arg). I have two ways to create the object.
1. I drag the CA to the model graph, and then make it to object.but the object has no property "activethreadname", so i cannot name the thread. Although i can name the class CA's thread name, i want to make the object's thread name different.
2. I make a object first, and then draw generalization relation to CA.In this way, I can name the object's threadname. But there is another problem, i can not set the object constructor's input parameter like the first way.
So what can I do if I want to set the constructor's input parameter, and also want to set the object's threadname?
Any suggestion will be appreciated.
Pinned topic Object constructor and threadname
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-11-24T06:00:00Z at 2012-11-24T06:00:00Z by SystemAdmin
Yevo 270002F6T8313 Posts
Re: Object constructor and threadname2012-11-23T08:45:30ZThis is the accepted answer. This is the accepted answer.It is a bit tricky, but works.
1) define your own CA constructor with parameter thrName of char* type
2) set CG::Class::ActiveThreadName property to the thrName (its value should be the same as the name of parameter)
3) uncheck CG::Class::GenerateImplicitConstructors property
4) now you can define an object of CA and set the name of its thread in its initialization field of Features dialog. Don't forget quotes.
See attached picture for more understanding.