Version: 9.16.0
YACS::ENGINE::PyCorbaStruct Class Reference

#include <PythonCORBAConv.hxx>

Inheritance diagram for YACS::ENGINE::PyCorbaStruct:
Collaboration diagram for YACS::ENGINE::PyCorbaStruct:

Public Member Functions

 PyCorbaStruct (InputCorbaPort *p)
 Class PyCorbaStruct is a proxy port that converts a PyObject object (of type struct) to a CORBA::Any object (of type struct) More...
 
virtual void put (const void *data)
 
void put (PyObject *data)
 Convert a PyObject (struct) to CORBA::Any (struct) More...
 
- Public Member Functions inherited from YACS::ENGINE::ProxyPort
 ProxyPort (InputPort *p)
 
 ~ProxyPort ()
 
void edRemoveAllLinksLinkedWithMe ()
 
InputPortclone (Node *newHelder) const
 
void edNotifyReferencedBy (OutPort *fromPort, bool isLoopProof=true) override
 
void edNotifyDereferencedBy (OutPort *fromPort)
 
std::set< OutPort * > edSetOutPort () const
 Returns physical backlinks NOT user backlinks. More...
 
InputPortgetPublicRepresentant ()
 returns the final physical port behind 'this'. More...
 
void * get () const
 
virtual void put (const void *data)
 
void releaseData () override
 
int edGetNumberOfLinks () const
 Returns number of physical backlinks NOT number of user backlinks. More...
 
bool isIntermediate () const
 
void exRestoreInit ()
 
void exSaveInit ()
 
void getAllRepresentants (std::set< InPort * > &repr) const
 
virtual std::string typeName ()
 
- Public Member Functions inherited from YACS::ENGINE::InputPort
virtual ~InputPort ()
 
std::string getNameOfTypeOfCurrentInstance () const
 
virtual InputPortgetPublicRepresentant ()
 returns the final physical port behind 'this'. More...
 
virtual bool isIntermediate () const
 
virtual bool edIsManuallyInitialized () const
 Specifies if this port has been manually set by the call of InputPort::edInit. More...
 
bool edIsInitialized () const
 soon deprecated More...
 
template<class T >
void edInit (T value)
 
void edInit (Any *value)
 
void edInit (const std::string &impl, const void *value)
 Initialize the port with an object (value) coming from a world with implementation impl. More...
 
virtual void edRemoveManInit ()
 Removes eventually previous manual initialisation. More...
 
virtual void checkBasicConsistency () const
 Check basically that this port has one chance to be specified on time. It's a necessary condition not sufficient at all. More...
 
virtual void exInit (bool start)
 
virtual void exSaveInit ()=0
 
virtual void exRestoreInit ()=0
 
virtual InputPortclone (Node *newHelder) const =0
 
virtual bool isEmpty ()
 
virtual void * get () const =0
 
virtual void releaseData ()=0
 
virtual void put (const void *data)=0
 
virtual std::string dump ()
 
virtual std::string getHumanRepr ()
 
virtual void setStringRef (std::string strRef)
 
virtual std::string typeName ()
 
bool canBeNull () const
 
- Public Member Functions inherited from YACS::ENGINE::DataFlowPort
std::string getNameOfTypeOfCurrentInstance () const
 
TypeOfChannel getTypeOfChannel () const
 returns type of channel the port will use for data exchange on runtime : DATAFLOW or DATASTREAM. More...
 
virtual ~DataFlowPort ()
 
virtual std::string typeName ()
 
virtual std::string valToStr ()
 Gives a string representation of the data, for user interfaces. More...
 
virtual void valFromStr (std::string valstr)
 Allows to set data from a string representation used in user interface. More...
 
- Public Member Functions inherited from YACS::ENGINE::DataPort
TypeCodeedGetType () const
 
void edSetType (TypeCode *type)
 
std::string getName () const
 
void setName (std::string theName)
 
std::string getNameOfTypeOfCurrentInstance () const
 
virtual TypeOfChannel getTypeOfChannel () const =0
 returns type of channel the port will use for data exchange on runtime : DATAFLOW or DATASTREAM. More...
 
bool isDifferentTypeOf (const DataPort *other) const
 
virtual void edRemoveAllLinksLinkedWithMe ()=0
 
virtual std::string typeName ()
 
virtual std::string getAsString ()
 returns port value as a string that can be used in a GUI for example More...
 
- Public Member Functions inherited from YACS::ENGINE::Port
virtual ~Port ()
 
NodegetNode () const
 
virtual std::string getNameOfTypeOfCurrentInstance () const
 
int getNumId () const
 
virtual std::string typeName ()
 
void modified ()
 
- Public Member Functions inherited from YACS::ENGINE::InPort
virtual InPortgetPublicRepresentant ()
 
virtual int edGetNumberOfLinks () const
 Returns number of physical backlinks NOT number of user backlinks. More...
 
virtual std::set< OutPort * > edSetOutPort () const
 Returns physical backlinks NOT user backlinks. More...
 
bool canSafelySqueezeMemory () const
 
bool isBackLinked () const
 
virtual ~InPort ()
 
virtual std::string typeName ()
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::DataPort
static DataPortisCrossingType (const std::vector< DataPort * > &historyOfLink)
 
- Static Public Attributes inherited from YACS::ENGINE::InputPort
static const char NAME [] ="InputPort"
 
- Static Public Attributes inherited from YACS::ENGINE::DataFlowPort
static const char NAME [] ="DataFlowPort"
 
- Static Public Attributes inherited from YACS::ENGINE::DataPort
static const char NAME [] ="DataPort"
 
- Protected Member Functions inherited from YACS::ENGINE::InputPort
 InputPort (const InputPort &other, Node *newHelder)
 
 InputPort (const std::string &name, Node *node, TypeCode *type, bool canBeNull=false)
 
void releaseDataUnsafe ()
 
- Protected Member Functions inherited from YACS::ENGINE::DataFlowPort
 DataFlowPort (const DataFlowPort &other, Node *newHelder)
 
 DataFlowPort (const std::string &name, Node *node, TypeCode *type)
 
- Protected Member Functions inherited from YACS::ENGINE::DataPort
virtual ~DataPort ()
 
 DataPort (const DataPort &other, Node *newHelder)
 
 DataPort (const std::string &name, Node *node, TypeCode *type)
 
- Protected Member Functions inherited from YACS::ENGINE::Port
 Port (Node *node)
 
 Port (const Port &other, Node *newHelder)
 
- Protected Member Functions inherited from YACS::ENGINE::InPort
 InPort (const InPort &other, Node *newHelder)
 
 InPort (const std::string &name, Node *node, TypeCode *type)
 
void edRemoveAllLinksLinkedWithMe ()
 
virtual void edNotifyReferencedBy (OutPort *fromPort, bool isLoopProof=true)
 
virtual void edNotifyDereferencedBy (OutPort *fromPort)
 
virtual void getAllRepresentants (std::set< InPort * > &repr) const
 
- Protected Attributes inherited from YACS::ENGINE::ProxyPort
InputPort_port
 
- Protected Attributes inherited from YACS::ENGINE::InputPort
Any_initValue
 
std::string _stringRef
 
bool _canBeNull
 
- Protected Attributes inherited from YACS::ENGINE::DataPort
TypeCode_type
 
std::string _name
 
- Protected Attributes inherited from YACS::ENGINE::Port
Node_node
 
int _id
 
- Protected Attributes inherited from YACS::ENGINE::InPort
std::set< std::pair< OutPort *, bool > > _backLinks
 
- Static Protected Attributes inherited from YACS::ENGINE::Port
static int _total = 0
 
static const char NAME [] ="Port"
 

Detailed Description

Definition at line 89 of file PythonCORBAConv.hxx.

Constructor & Destructor Documentation

◆ PyCorbaStruct()

PyCorbaStruct::PyCorbaStruct ( InputCorbaPort p)

Class PyCorbaStruct is a proxy port that converts a PyObject object (of type struct) to a CORBA::Any object (of type struct)

Parameters
p: the input CORBA port to adapt to Python output port

Definition at line 203 of file PythonCORBAConv.cxx.

204 : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
205{
206}
std::string getName() const
DataPort(const DataPort &other, Node *newHelder)
Definition: DataPort.cxx:41
friend class ProxyPort
Definition: InPort.hxx:50
Port(Node *node)
Definition: Port.cxx:34
Proc * p
Definition: driver.cxx:216

Member Function Documentation

◆ put() [1/2]

void PyCorbaStruct::put ( const void *  data)
virtual

Reimplemented from YACS::ENGINE::ProxyPort.

Definition at line 208 of file PythonCORBAConv.cxx.

209{
210 put((PyObject *)data);
211}
virtual void put(const void *data)

References put().

Referenced by put().

◆ put() [2/2]

void PyCorbaStruct::put ( PyObject *  data)

Convert a PyObject (struct) to CORBA::Any (struct)

Parameters
data: python object

Definition at line 217 of file PythonCORBAConv.cxx.

218{
219 DEBTRACE("data refcnt: " << data->ob_refcnt);
220#ifdef _DEVDEBUG_
221 PyObject_Print(data,stderr,Py_PRINT_RAW);
222 std::cerr << std::endl;
223#endif
224 CORBA::Any *a= convertPyObjectCorba(_port->edGetType(),data);
226 _port->put(a);
227#ifdef REFCNT
228 DEBTRACE("refcount CORBA structTC: " << ((omni::TypeCode_base*)a->pd_tc.in())->pd_ref_count);
229#endif
230 //delete Any that has been allocated by convertPyObjectCorba
231 delete a;
232#ifdef REFCNT
233 DEBTRACE("refcount CORBA structTC: " << ((omni::TypeCode_base*)((InputCorbaPort*)_port)->getAny()->pd_tc.in())->pd_ref_count);
234#endif
235}
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
TypeCode * edGetType() const
Definition: DataPort.hxx:53
Class for CORBA Input Ports.
Definition: CORBAPorts.hxx:45
virtual void put(const void *data)=0
CORBA::Any * convertPyObjectCorba(const TypeCode *t, PyObject *data)

References YACS::ENGINE::ProxyPort::_port, gui.CONNECTOR::a, YACS::ENGINE::convertPyObjectCorba(), DEBTRACE, YACS::ENGINE::DataPort::edGetType(), and YACS::ENGINE::InputPort::put().


The documentation for this class was generated from the following files: