Discussion:
Another questions
Michael Nester
2010-04-23 14:20:52 UTC
Permalink
I placed "#include <iostream>" and "using namespace std;" in CBox.h
(only class for the moment).



These lines disappear (no big surprise) whenever I "generate code" or
"regenerate all".

Is there a way to add these lines so that they do not disappear?



Mike Nester

------------------------------------------------------
http://astade.tigris.org/ds/viewMessage.do?dsForumId=3430&dsMessageId=2593561

To unsubscribe from this discussion, e-mail: [users-unsubscribe-***@public.gmane.orgis.org].
Anders Larsen
2010-04-23 16:12:11 UTC
Permalink
Hello Mike,
Post by Michael Nester
I placed "#include <iostream>" and "using namespace std;" in CBox.h
(only class for the moment).
These lines disappear (no big surprise) whenever I "generate code" or
"regenerate all".
Is there a way to add these lines so that they do not disappear?
sure - right-click on the class and select "edit prolog/epilog", "edit specification prolog"; add your two lines in the editor and you're done!

Cheers
Anders

------------------------------------------------------
http://astade.tigris.org/ds/viewMessage.do?dsForumId=3430&dsMessageId=2593637

To unsubscribe from this discussion, e-mail: [users-unsubscribe-***@public.gmane.orgis.org].
Thomas Spitzer
2010-04-23 17:23:53 UTC
Permalink
Post by Anders Larsen
Post by Michael Nester
I placed "#include <iostream>" and "using namespace std;" in CBox.h
(only class for the moment).
These lines disappear (no big surprise) whenever I "generate code" or
"regenerate all".
Is there a way to add these lines so that they do not disappear?
sure - right-click on the class and select "edit prolog/epilog", "edit specification prolog"; add your two lines in the editor and you're done!
For <iostream> there is another possibility.

1. Create a package "std" somewhere
2. Create a "classes" subfolder in it
3. Create a "lib class" called "std::iostream"
4. Open the feature dialog of that lib class and write <iostream> in the
class include (see attached picture)

Now you have a "lib class" for std::iostream. If you want to tell
Astade, that a certain class uses it, you

1. rightclick the class and select "start releation to ..."
2. rightclick the lib class and select "complete relation from"

Astade generates a "useage" relation. You can configure, weather this
relation is a specification or an implementation usage.

This will cause the include, too.

It is a little bit more complicate, but has two advantages:

1. If you let Astade draw an object model diagram, it draws the relation
to std::iostream

2. If you go to the lib class in the model, you can navigate to all
classes which uses it.

If you do it in "prolog" it is totally transparent to Astade.

In case of "std::iostream" one could discuss weather you want to have it
"hidden" (use prolog) or if you want Astade to know about it (use lib
class)

My intention was to explain this second possibility ;-)

------------------------------------------------------
http://astade.tigris.org/ds/viewMessage.do?dsForumId=3430&dsMessageId=2593687

To unsubscribe from this discussion, e-mail: [users-unsubscribe-HcrAt6aCZFAWBrYXtHbyV9i2O/***@public.gmane.org].
Loading...