In reply to dave_59:
Thank u dave_59. Currently I am doing the same i.e. I have a static longint unsigned variable in the class that gets incremented in the constructor of the class. I am passing this to dpi. My other question is that (coming from cpp background), should I have some protection (mutex) while incrementing this static variable in the constructor of the class.