[omniORB] Can't compile client that retrieves a struct whichcontains a sequence

Clarke Brunt clarke.brunt at trafficmaster.co.uk
Thu May 1 12:38:22 BST 2008


Tom O'Reilly wrote:
> void foo(SequenceTestIF_var seqTest) {
> ...etc.

Hopefully the other reply has solved the actual problem. But (and
nothing to do with the problem) I'd advise against writing methods which
take _var types as arguments. Make it "SequenceTestIF_ptr seqTest"
instead.

With the _ptr version, then if in the calling function, you've already
got an xxx_var, it's no problem - it will be correctly converted to
xxx_ptr when you make the call. And if you've already got an xxx_ptr,
then that will work too.

But with your _var version, while it will work as intended if you always
call it passing another _var, if someone called it passing an xxx_ptr
(as they'd expect to be able to do), then the _var contructor will 'eat'
the _ptr and its destructor will automatically
delete/destroy/release/whatever it when the statement completes. Which
would lead to the _ptr no longer working.

Clarke Brunt
TRAFFICMASTER PLC
UNIT 22 / ST. JOHN'S INNOVATION CENTRE
COWLEY ROAD / CAMBRIDGE / CB4 0WS
T: 01223 422469
F: 
E: clarke.brunt at trafficmaster.co.uk

 
Please consider the environment before printing this email. --------------------------------------------------------

Trafficmaster PLC is a limited Company registered in England and Wales.
Registered number: 2292714   Registered office: Martell House, University Way, Cranfield, BEDS. MK43 0TR
 
This message (and any associated files) is intended only for the use of omniorb-list at omniorb-support.com and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not omniorb-list at omniorb-support.com you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Any views or opinions presented are solely those of the author clarke.brunt at trafficmaster.co.uk and do not necessarily represent those of the company.
 
Warning: Although the company has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments.
--------------------------------------------------------



More information about the omniORB-list mailing list