Version: 9.16.0
CORBAPorts.cxx File Reference
#include "RuntimeSALOME.hxx"
#include "TypeConversions.hxx"
#include "TypeCode.hxx"
#include "AutoLocker.hxx"
#include "CORBAPorts.hxx"
#include "PythonPorts.hxx"
#include "ServiceNode.hxx"
#include "ComponentInstance.hxx"
#include "SALOME_GenericObj.hh"
#include <iostream>
#include <sstream>
#include "YacsTrace.hxx"
Include dependency graph for CORBAPorts.cxx:

Go to the source code of this file.

Namespaces

namespace  YACS
 
namespace  YACS::ENGINE
 

Functions

void releaseObj (CORBA::Any &data)
 
void registerObj (CORBA::Any &data)
 
void display (CORBA::Any *data)
 
ostream & YACS::ENGINE::operator<< (ostream &os, const OutputCorbaPort &p)
 

Function Documentation

◆ display()

void display ( CORBA::Any *  data)

Definition at line 144 of file CORBAPorts.cxx.

145{
146 CORBA::TypeCode_var tc=data->type();
147 switch(tc->kind())
148 {
149 case CORBA::tk_double:
151 *data >>= d;
152 DEBTRACE( "Double: " << d );
153 break;
154 case CORBA::tk_long:
155 CORBA::Long l;
156 *data >>= l;
157 DEBTRACE( "Int: " << l );
158 break;
159 default:
160 break;
161 }
162}
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31

References DEBTRACE, YACS::ENGINE::Double, and testCppPluginInvokation::l.

Referenced by main(), and YACS::ENGINE::InputCorbaPort::put().

◆ registerObj()

void registerObj ( CORBA::Any &  data)

Definition at line 74 of file CORBAPorts.cxx.

75{
76 CORBA::Object_var obj;
77 if(data >>= CORBA::Any::to_object(obj))
78 {
79 SALOME::GenericObj_var gobj;
80 try
81 {
82 gobj=SALOME::GenericObj::_narrow(obj);
83 }
84 catch(const CORBA::SystemException& )
85 {
86 return;
87 }
88 if(!CORBA::is_nil(gobj))
89 {
90 DEBTRACE("It's a SALOME::GenericObj");
91 gobj->Register();
92 }
93 else
94 DEBTRACE("It's a CORBA::Object but not a SALOME::GenericObj");
95 }
96 else
97 DEBTRACE("It's not a CORBA::Object");
98}

References DEBTRACE.

Referenced by YACS::ENGINE::InputCorbaPort::put().

◆ releaseObj()

void releaseObj ( CORBA::Any &  data)

Definition at line 48 of file CORBAPorts.cxx.

49{
50 CORBA::Object_var obj;
51 if(data >>= CORBA::Any::to_object(obj))
52 {
53 SALOME::GenericObj_var gobj;
54 try
55 {
56 gobj=SALOME::GenericObj::_narrow(obj);
57 }
58 catch(const CORBA::SystemException& )
59 {
60 return;
61 }
62 if(!CORBA::is_nil(gobj))
63 {
64 DEBTRACE("It's a SALOME::GenericObj");
65 gobj->UnRegister();
66 }
67 else
68 DEBTRACE("It's a CORBA::Object but not a SALOME::GenericObj");
69 }
70 else
71 DEBTRACE("It's not a CORBA::Object");
72}

References DEBTRACE.

Referenced by YACS::ENGINE::InputCorbaPort::put(), YACS::ENGINE::OutputCorbaPort::put(), YACS::ENGINE::InputCorbaPort::~InputCorbaPort(), and YACS::ENGINE::OutputCorbaPort::~OutputCorbaPort().