Get the name of an instance

20 views
Skip to first unread message

Mahdy S.

unread,
Feb 18, 2015, 7:13:56 AM2/18/15
to omn...@googlegroups.com
Hi experts,

I created in my simulation a simple module and then created several instances of this module with different names. My question is pretty simple (at least I hope so):
How can I in the cc code get the name of the current instance of the module. Say I have a module named DNS with 3 instances: DNS0, DNS1 and DNS2. Is there a function which returns the string "DNS1" when DNS1 is sending the message for example?

Thanks in advance!

Mahdy

Ivo Calado

unread,
Feb 18, 2015, 7:17:53 AM2/18/15
to omn...@googlegroups.com
Mahdy,
    you must retrieve the instance of your module and call "getName()"

[]'s

--
You received this message because you are subscribed to the Google Groups "omnetpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ivo Calado

Quidquid latine dictum sit, altum viditur

Putt's Law:
       Technology is dominated by two types of people:
               Those who understand what they do not manage.
               Those who manage what they do not understand.

Mahdy S.

unread,
Feb 18, 2015, 7:24:46 AM2/18/15
to omn...@googlegroups.com, ivo.c...@ee.ufcg.edu.br
Hi Ivo,

thanks a lot for the quick answer!

I used getName() directly and it works :)

Regards,
Mahdy
Reply all
Reply to author
Forward
0 new messages