]> SALOME platform Git repositories - modules/yacs.git/blob - src/runtime/CORBANeutralConv.cxx
Salome HOME
copy tag mergefrom_BR_V0_1_CC_Salome_04oct07
[modules/yacs.git] / src / runtime / CORBANeutralConv.cxx
1
2 #include "TypeConversions.hxx"
3 #include "CORBANeutralConv.hxx"
4
5 #include <iostream>
6
7 //#define _DEVDEBUG_
8 #include "YacsTrace.hxx"
9
10 using namespace YACS::ENGINE;
11 using namespace std;
12
13 CorbaNeutral::CorbaNeutral(InputPort* p)
14   : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
15 {
16 }
17
18 //!Convert a CORBA::Any that is convertible to a YACS::ENGINE::Any * and send it to proxy port
19 /*!
20  *   \param data : CORBA::Any object as a void * pointer
21  */
22
23 void CorbaNeutral::put(const void *data) throw(ConversionException)
24 {
25   put((CORBA::Any *)data);
26 }
27
28 //!Convert a CORBA::Any that is convertible to a YACS::ENGINE::Any * and send it to proxy port
29 /*!
30  *   \param data : CORBA::Any object
31  */
32 void CorbaNeutral::put(CORBA::Any *data) throw(ConversionException)
33 {
34   DEBTRACE( "CorbaNeutral::put" )
35   YACS::ENGINE::Any *ob;
36   ob=convertCorbaNeutral(edGetType(),data);
37   DEBTRACE("before put refcnt: " << ob->getRefCnt())
38   DEBTRACE( _port->getName() )
39   _port->put(ob);
40   // ob has been created in convertCorbaNeutral. _port has normally called incRef 
41   ob->decrRef();
42   DEBTRACE("after put refcnt: " << ob->getRefCnt())
43 }