ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activepython
activepython
passing instance of another class.
by anandforums other posts by this author
Jun 22 2009 4:43AM messages near this date
view in the new Beta List Site
ANN: ActivePython 3.1.0.1 is now available | need help for open source and diagramming research
Hello Python Experts,


Dear Python experts,?

Please can you help in a following scenario..?
I have some classes each for a Protocol Data Unit which you could consider as a structures o
f elements?
example?
class ex1:?
class usr_mac(MAC_PDU):?
? ? 
? ? def __init__(self):?
? ? ? ? self.pf = BV.Bit1.new()?
? ? ? ? self.res = BV.Bit1.new()?
? ? ? ? self.flco = ?BV.Bit6.new()?
? ? ? ? self.grpad = BV.Bit24.new()?
? ? ? ? self.srcad = BV.Bit24.new()?
? ? ? ? self.order = ['protectFlag',?
? ? ? ? ? ? ? ? ? ? ? 'reserved',?
? ? ? ? ? ? ? ? ? ? ? 'flco',?
? ? ? ? ? ? ? ? ? ? ? 'grpad ',?
? ? ? ? ? ? ? ? ? ? ? 'srcad '] 

Another message (transport layer)
class Info_req_msg(MAC_PDU):?

? ? 
whose elements are 
1. msg_type
2. msg_size
3. PDU ( in this case, i need to send instance of "usr_mac"? defined above)

can you please help me. 


Now i have a another message which i need to create similar but now it contains the above cl
ass instance as one of the members.?

Please can you tell me how to pass instance of above class as a member of the new message cr
eated in similar lines with one of the elements is the complete data above (instance of abov
e class).?

I am encapsulating above message in a transport layer message.?
2. Now similarly, i would like given a choice to choose the instance of other class as the i
 would like to pass ?in other instance of class similarly.?

Your kind help will be greatly appreciated. Please let me know if there are clarifications i
 can give, I am posting this in a hurry. I am sure there could be questions.?

Thanks in advance?
ag

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved