![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Basics of DxlObject ? Topic Summary: Created On: 30-Jan-2008 17:09 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I've seen a few people rave about using DxlObject. I've searched the forum for more details, but have only found it briefly mentioned in a few places. Can someone explain what it is, how it works, and maybe provide a simple example? How does DxlObject differ from a Skip List? Can you store anything in a DxlObject? Is there anything you can't store in a DxlObject? Do you have to be explicit with data types when storing and retrieving information from them? Can you pass DxlObjects into functions? Can you return DxlObjects from functions?
Thanks in advance. Edited: 30-Jan-2008 at 17:56 by David Jakad |
|
![]() |
|
![]() |
|
See Tony Goodman's site
http://www.smartdxl.com/undoc.html And I see no reason why you can't pass/return a DXL Object to/from a function. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com Edited: 30-Jan-2008 at 18:26 by David Pechacek |
|
![]() |
|
![]() |
|
Just a remark, if you create a Skip List containing DxlObjects (which can be extremely useful), you have to manually delete the DxlObjects before deleting the Skip List, otherwise you will have a momory leak
// Assuming dxlSkip is the SkipList DxlObject d for d in dxlSkip do {delete d} delete dxlSkip Peter |
|
![]() |
|
![]() |
|
Peter.... on the topic of memory management.... do you know... will all data, skip lists, dxlObjects, etc., be automatically deleted when the script ends, or when a dialog box is closed?
|
|
![]() |
|
![]() |
|
Oh well, I would just not count on it and clean up manually in any case :-)
Peter |
|
![]() |
|
![]() |
|
Hi David,
Peter.... on the topic of memory management.... do you know... will all data, skip lists, dxlObjects, etc., be automatically deleted when the script ends, or when a dialog box is closed? I'd be happy with either of these solutions... But I think the memory leak will exist (at least?) until the DOORS client ends. So, if you run a script that causes memory leakage, you wil leak more and more memory. Note that this is my hunch and is not founded on technical knowledge of DOORS memory management. Marcel |
|
![]() |
|
![]() |
|
Thanks for all the help. I looked at Tony Goodman's site and have been practicing with the DxlObject. Now my question is, is there any way to generically dump the data from any DxlObject, or must you know the structure of the data within the DxlObject.
For example, if I have something like: DxlObject o = new() o->"First Name" = "John" o->"Last Name" = "Doe" o->"Home Town" = "Springfield" o->"Motto" = "Hello World" ..and if I now want to dump out that data, is there any way to simply say, "for every element in the DxlObject, print the key=value pair"? Or, must you hard code it, like: print (string o->"First Name") print (string o->"Last Name") print (string o->"Home Town") print (string o->"Motto") |
|
![]() |
|
![]() |
|
As far as I know, there is no loop through DxlObject elements available, and as you must cast the variable type when retrieving the value, I doubt it is possible at all. A workaround could be to store all keys of the same type in a skip list and loop through the skip list when retrieving the elements.
Regards, Peterr |
|
![]() |
|
![]() |
|
To get data from a DXLObject, you must know the string names of the fields. You must also explicitly cast the returned value to a the correct type.
Chances are that you will have a set structure for your DXLObjects and that knowing the structure won't be a problem. You could write wrapper functions for put() and get() as follows: Another common technique is to have conditional fields based on the value of a mandatory field. bool b = (bool o->"Has Middle Name") if (b) middleName = (string o->"Moiddle Name") else middleName = "" ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Basics of DxlObject ?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.