AW: AW: [omniORB] Usage of _out objects
Fischer, Clemens
clemens.fischer at atlas-elektronik.com
Mon Aug 13 11:06:05 BST 2007
Exactly,
You have to care for incrementing the object reference count e.g.:
void Server::f(A_out a){
...
A_var myA = ... // got reference from somewhere
a = A::_duplicate(myA);
...
}
or if you don't need myA anymore:
void Server::f(A_out a){
...
A_var myA = ... // got reference from somewhere
a = myA._retn(); // now myA does no longer care for ref count
...
}
Clemens
-----Ursprüngliche Nachricht-----
Von: Bjørn Kristian Larsen [mailto:bjorn.k.larsen at met.no]
Gesendet: Montag, 13. August 2007 10:01
An: Fischer, Clemens
Cc: omniorb-list at omniorb-support.com
Betreff: Re: AW: [omniORB] Usage of _out objects
That gives me
error: no match for 'operator=' in a ...
A is an interface in my idl.
Does that mean that I need to activate the object in the POA to get a
reference?
Fischer, Clemens wrote:
> Should have read your question completely.
> On the server side you have to allocate memory for the out parameter:
>
> void Server::f(A_out a){
> ...
> a = new A();
> ...
> }
>
> Clemens
>
> -----Ursprüngliche Nachricht-----
> Von: omniorb-list-bounces at omniorb-support.com [mailto:omniorb-list-bounces at omniorb-support.com] Im Auftrag von Bjørn Kristian Larsen
> Gesendet: Sonntag, 12. August 2007 17:00
> An: omniorb-list at omniorb-support.com
> Betreff: [omniORB] Usage of _out objects
>
> Say you are calling this function from the client (c++):
>
> void Server::f(A_out a){
> ...
> }
>
> How do you set the A_out (variable length) object?
>
> My book says it's a "reference to a pointer". I'm not sure what that is
> and not how to handle them.
>
> And if I understand my book correct, I don't need to free/release the
> object on the server (callee) side. Is this correct?
>
>
> Sorry for the stupid question, but I'm new to CORBA...
>
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list
More information about the omniORB-list
mailing list