[omniORB] RE: omniORB-list Digest, Vol 78, Issue 1

Amit Kumar amitk at tarangtech.com
Thu Oct 1 17:56:26 BST 2009


Hi All,

I have got the solution to my problem. The idl compilation has to be done
with -Wba option. That generates the corresponding overloaded operator code
for >>=. For a quick reference you may visit the section 11.1.3  "Inserting
and Extracting Constructed Types from an Any" in the link
http://omniorb.sourceforge.net/omni41/omniORB/omniORB011.html 

Greetings,
Amit

-----Original Message-----
From: omniorb-list-bounces at omniorb-support.com
[mailto:omniorb-list-bounces at omniorb-support.com] On Behalf Of
omniorb-list-request at omniorb-support.com
Sent: Thursday, October 01, 2009 4:30 PM
To: omniorb-list at omniorb-support.com
Subject: omniORB-list Digest, Vol 78, Issue 1

Send omniORB-list mailing list submissions to
	omniorb-list at omniorb-support.com

To subscribe or unsubscribe via the World Wide Web, visit
	http://www.omniorb-support.com/mailman/listinfo/omniorb-list
or, via email, send a message with subject or body 'help' to
	omniorb-list-request at omniorb-support.com

You can reach the person managing the list at
	omniorb-list-owner at omniorb-support.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of omniORB-list digest..."


Today's Topics:

   1. trouble in extracting a struct from any (Amit Kumar)


----------------------------------------------------------------------

Message: 1
Date: Wed, 30 Sep 2009 18:17:07 +0530
From: "Amit Kumar" <amitk at tarangtech.com>
Subject: [omniORB] trouble in extracting a struct from any
To: <omniorb-list at omniorb-support.com>
Message-ID: <00be01ca41cc$1e55e540$5b01afc0$@com>
Content-Type: text/plain; charset="us-ascii"

Hello All,

 

I am passing a structure as "any" argument in a function. Also, I am trying
to extract the same within the function body. But I am getting error at the
compilation time itself. Details as follows:

 

 //Function Body

 void myFunction(CORBA::Any& data)

{

   Information * localInfo; // "Information" is a structure defined in the
IDL .  "ID" and "name" are the two members of this structure.

   list<CORBA::Any*> myList;

   myList.push_back(new CORBA::Any(data)); //I am storing the data in a list
for some other use

   myList.front() >>=  localInfo;

}

 

 

I am getting following compilation error for the function.

 

error: invalid operands of types `CORBA::Any*' and `Information*' to binary
`operator>>'

in evaluation of `operator>>=(class CORBA::Any*, struct Information*)'

 

 

I am using the structure and function call as below:

 

 long ID_No = 10;

 CORBA::Any myName;

 myName <<= "Amit" ;    

 Information * myInfo;  // "Information" is a structure defined in the IDL .
"ID" and "name" are the two members of this structure.

 myInfo->ID = (CORBA::ULong) ID_No;

 myInfo->raw_data = myName;

 CORBA::Any myAny;

 myAny <<= myInfo;

 myFunction(myAny); //Function call

 

Please help me to resolve this issue.

 

Thanks and Regards,

Amit

 

  

                     

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090930/6
c7a7221/attachment-0001.htm

------------------------------

_______________________________________________
omniORB-list mailing list
omniORB-list at omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list


End of omniORB-list Digest, Vol 78, Issue 1
*******************************************




More information about the omniORB-list mailing list