[tao-users] How to use a customed StructuredEvent which gener ated from IDL file bewteen publisher and subscriber by Notifycation Servi ces?

techabc techabc at gmail.com
Wed Mar 15 13:54:52 CDT 2017


the problem solved according to the changelog:

USER VISIBLE CHANGES BETWEEN TAO-2.4.1 and TAO-2.4.2
====================================================

. Fixed some problems with versioned namespaces in the
  tao_idl generated code

. Removed the non-const Any extraction operators which
  are deprecated within the IDL to C++ specification
  for a long time. Reduces footprint and simplifies the
  code. Make sure you are using 'const Foo*' as extraction
  type for Foo instead of 'Foo*'.


2017-03-15 16:46 GMT+08:00 techabc <techabc at gmail.com>:

> thanks again for your help.
> but, when I upgrade to msvc14(aka. vs2015), the code below can NOT compile
> pass:
>
> event.remainder_of_body >>= m_cmd;
>
> what should I to do?
>
> 2007-11-22 23:18 GMT+08:00 Colon Eric <Eric.Colon at rma.ac.be>:
>
>> Hi,
>>
>>
>>
>> Have a look at the example ACE_wrappers\TAO\orbsvcs\examp
>> les\Notify\Subscribe.
>>
>>
>>
>> You will find somewhere:
>>
>> event.remainder_of_body <<= (CORBA::Long)10;
>>
>>
>>
>> The remainder_of_body has the type “any”. So you can push what you want
>> into it.
>>
>>
>>
>> For instance if you define in your idl file something as:
>>
>>
>>
>> Typedef long MotionCommand
>>
>> Typdef sequence<MotionCommand> MCmdSeq
>>
>>
>>
>> You then declare in your implementation class a variable of that type:
>>
>>
>>
>> McmdSeq m_cmd;
>>
>>
>>
>> //example
>>
>> m_cmd .length(2);
>>
>> m_cmd[0] = 10;
>>
>> m_cmd[0] = 20;
>>
>>
>>
>> And push it into the event in the supplier:
>>
>>
>>
>> event.remainder_of_body <<= m_cmd
>>
>>
>>
>> then you send the data by using:
>>
>>
>>
>> supplier_1_->send_event (event); // in the subscribe example
>>
>>
>>
>> that will call:
>>
>>
>>
>> proxy_consumer->push_structured_event (event);
>>
>>
>>
>> in the consumer you will do the reverse operation
>>
>>
>>
>> event.remainder_of_body >>= m_cmd;
>>
>>
>>
>> The <<= and >>= conversion operators are generated by the idl compiler.
>>
>>
>>
>> Hope this will help you.
>>
>>
>>
>> ---------------------------------
>> Eric Colon Dr Ir
>> Chargé de cours militaire
>> Département de Mécanique
>> Ecole Royale Militaire
>> Avenue de la Renaissance 30
>> B-1000 Bruxelles
>> Phone: + 32 2 42 6556
>> Fax: + 32 2 742 6547 <+32%202%20742%2065%2047>
>> http://mecatron.rma.ac.be
>> ----------------------------------
>>
>> ------------------------------
>>
>> *De :* cherokee [mailto:techabc at gmail.com]
>> *Envoyé :* jeudi 22 novembre 2007 13:54
>> *À :* tao-users at cse.wustl.edu
>> *Objet :* [tao-users] How to use a customed StructuredEvent which
>> generated from IDL file bewteen publisher and subscriber by Notifycation
>> Services?
>>
>>
>>
>> Hi, all:
>>
>>     I have a question for help, thanks:
>>
>>     How to use a customed StructuredEvent which generated from IDL file
>> bewteen publisher and subscriber by Notifycation Services?
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/tao-users/attachments/20170316/c07ea117/attachment.html>


More information about the tao-users mailing list