]> SALOME platform Git repositories - modules/yacs.git/blob - src/runtime/CppNeutralConv.cxx
Salome HOME
copy tag mergefrom_BR_V0_1_CC_Salome_04oct07
[modules/yacs.git] / src / runtime / CppNeutralConv.cxx
1
2 #include "TypeConversions.hxx"
3 #include "CppNeutralConv.hxx"
4
5 #include <iostream>
6 #include <sstream>
7 #include "Any.hxx"
8
9 //#define _DEVDEBUG_
10 #include "YacsTrace.hxx"
11
12 using namespace std;
13
14 namespace YACS
15 {
16   namespace ENGINE 
17   {
18     Any* convertCppNeutral(const TypeCode *t, Any *a)
19     {
20       return convertNeutralNeutral(t, a);
21     }
22
23     CppNeutral::CppNeutral(InputPort* p)
24       : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
25     {
26     }
27
28     void CppNeutral::put(const void *data) throw(ConversionException)
29     {
30       DEBTRACE(" CppNeutral::put(const void *data)");
31       put((Any *)data);
32     }
33
34     //! Send received C++/Neutral (Any *) value to proxy port
35     /*!
36      *   \param data : Neutral (Any *) value
37      */
38
39     void CppNeutral::put(Any *data) throw(ConversionException)
40     {
41       DEBTRACE("CppNeutral::put " << data);
42       Any *ob;
43       ob=convertCppNeutral(edGetType(), data);
44       DEBTRACE("before put refcnt: " << ob->getRefCnt());
45       _port->put(ob);
46       DEBTRACE( "after put refcnt: " << ob->getRefCnt() );
47       //_port has called incRef
48       ob->decrRef();
49     }
50
51     int isAdaptableNeutralCpp(const TypeCode *t1, const TypeCode *t2)
52     {
53       return isAdaptableNeutralNeutral(t1, t2);
54     }
55   }
56 }