Salome HOME
352a0cfdafd50b2aa0230f1076197ccfcf12b0ec
[modules/yacs.git] / src / engine_swig / pilot.i
1 // Copyright (C) 2006-2022  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 %define DOCSTRING
21 "All is needed to create and execute a calculation schema."
22 %enddef
23
24 %module(docstring=DOCSTRING) pilot
25
26 #ifndef SWIGIMPORTED
27 //work around SWIG bug #1863647
28 #if SWIG_VERSION >= 0x010336
29 #define SwigPyIterator pilot_PySwigIterator
30 #else
31 #define PySwigIterator pilot_PySwigIterator
32 #endif
33 #endif
34
35 %feature("autodoc", "1");
36
37 %include "engtypemaps.i"
38
39 #ifdef DOXYGEN_IS_OK
40 %include docengine.i
41 #endif
42
43 %{
44 #include "Any.hxx"
45 #include "TypeCode.hxx"
46 #include "ComponentDefinition.hxx"
47 #include "Visitor.hxx"
48 #include "VisitorSaveSchema.hxx"
49 #include "VisitorSaveState.hxx"
50 #include "LinkInfo.hxx"
51 #include "Catalog.hxx"
52 #include "Executor.hxx"
53 #include "ExecutorSwig.hxx"
54 #include "Dispatcher.hxx"
55 #include "Container.hxx"
56 #include "HomogeneousPoolContainer.hxx"
57 #include "Logger.hxx"
58 #include "DeploymentTree.hxx"
59 #include "ComponentInstance.hxx"
60 #include "DataNode.hxx"
61 #include "PlayGround.hxx"
62 #include "SetOfPoints.hxx"
63 #include "PointVisitor.hxx"
64 #include "ForkBlocPoint.hxx"
65 #include "LinkedBlocPoint.hxx"
66 #include "NotSimpleCasePoint.hxx"
67 #include "ElementaryPoint.hxx"
68 #include "ObserverAsPlugin.hxx"
69 #include "InGate.hxx"
70   
71 using namespace YACS::ENGINE;
72
73 %}
74
75 %init
76 %{
77   // init section
78 #ifdef OMNIORB
79   PyObject* omnipy = PyImport_ImportModule((char*)"_omnipy");
80   if (!omnipy)
81   {
82     PyErr_SetString(PyExc_ImportError,(char*)"Cannot import _omnipy");
83     return NULL;
84   }
85   PyObject* pyapi = PyObject_GetAttrString(omnipy, (char*)"API");
86   api = (omniORBpyAPI*)PyCapsule_GetPointer(pyapi,"_omnipy.API");
87   Py_DECREF(pyapi);
88 #endif
89 %}
90
91 %ignore YACS::ENGINE::Any::operator[];
92 %ignore YACS::ENGINE::TypeCode::operator=;
93 %ignore YACS::ENGINE::DeploymentTree::operator=;
94 %ignore operator<<;
95 %ignore YACS::ENGINE::Runtime::_tc_double;
96 %ignore YACS::ENGINE::Runtime::_tc_int;
97 %ignore YACS::ENGINE::Runtime::_tc_bool;
98 %ignore YACS::ENGINE::Runtime::_tc_string;
99 %ignore YACS::ENGINE::Runtime::_tc_file;
100 %rename(StateLoader) YACS::ENGINE::StateLoader; // to suppress a 503 warning
101 %rename(NbDoneLoader) YACS::ENGINE::NbDoneLoader; // to suppress a 503 warning
102 %rename(getRuntime) YACS::ENGINE::getRuntime; // to suppress a 503 warning
103 %rename(_from) YACS::ENGINE::DataLinkInfo::from ; // to suppress a 314 warning
104 %rename(_from) YACS::ENGINE::StreamLinkInfo::from ; // to suppress a 314 warning
105
106 /*
107  * Template section
108  */
109 %template()              std::pair<std::string, YACS::ENGINE::TypeCode *>;
110 %template()              std::pair<std::string, YACS::ENGINE::Node *>;
111 %template()              std::pair<std::string, YACS::ENGINE::InlineNode *>;
112 %template()              std::pair<std::string, YACS::ENGINE::ServiceNode *>;
113 %template()              std::pair<std::string, YACS::ENGINE::Container *>;
114 %template()              std::pair<YACS::ENGINE::OutPort *,YACS::ENGINE::InPort *>;
115 %template()              std::pair<YACS::ENGINE::InPort *,YACS::ENGINE::OutPort *>;
116 %template()              std::pair< std::string, int >;
117 %template()              std::pair< YACS::ENGINE::InGate *, bool>;
118 %template(ItPy3TC)       IteratorPy3<YACS::ENGINE::TypeCode *>;
119 //%template(TCmap)         std::map<std::string, YACS::ENGINE::TypeCode *>;
120 REFCOUNT_TEMPLATE(TCmap,YACS::ENGINE::TypeCode)
121 %template(NODEmap)       std::map<std::string, YACS::ENGINE::Node *>;
122 %template(INODEmap)      std::map<std::string, YACS::ENGINE::InlineNode *>;
123 %template(SNODEmap)      std::map<std::string, YACS::ENGINE::ServiceNode *>;
124 //%template(CONTAINmap)    std::map<std::string, YACS::ENGINE::Container *>;
125 %template(ItPy3Cont)     IteratorPy3<YACS::ENGINE::Container * >;
126 REFCOUNT_TEMPLATE(CONTAINmap,YACS::ENGINE::Container)
127 %template(strvec)        std::vector<std::string>;
128 %template(uivec)         std::vector<unsigned int>;
129 %template(ivec)          std::vector<int>;
130 %template(linksvec)      std::vector< std::pair<YACS::ENGINE::OutPort *,YACS::ENGINE::InPort *> >;
131 %template(linkvec)       std::vector< std::pair<YACS::ENGINE::InPort *,YACS::ENGINE::OutPort *> >;
132 %template(instreamlist)  std::list<YACS::ENGINE::InputDataStreamPort *>;
133 %template(outstreamlist) std::list<YACS::ENGINE::OutputDataStreamPort *>;
134 %template(vpsi)          std::vector< std::pair< std::string, int > >;
135           
136 %template()              std::pair<std::string, YACS::ENGINE::CatalogLoader *>;
137 %template(loadermap)     std::map<std::string,YACS::ENGINE::CatalogLoader *>;
138 %template()              std::pair<std::string, YACS::ENGINE::ComposedNode *>;
139 %template(composedmap)   std::map<std::string,YACS::ENGINE::ComposedNode *>;
140 %template()              std::pair<std::string, YACS::ENGINE::ComponentDefinition *>;
141 %template(compomap)      std::map<std::string, YACS::ENGINE::ComponentDefinition *>;
142 %template()              std::pair<std::string, std::string>;
143 %template(propmap)       std::map<std::string, std::string>;
144 %template(ItPy3Comp)     IteratorPy3<YACS::ENGINE::ComponentInstance *>;
145 %template(listpairingatebool) std::list< std::pair< YACS::ENGINE::InGate *, bool> >;
146
147 REFCOUNT_TEMPLATE(CompoInstmap,YACS::ENGINE::ComponentInstance)
148
149 %include "exception.i"
150
151 /*
152  * End of Template section
153  */
154
155 %typemap(out) Container *
156 {
157   $result=convertContainer($1,$owner);
158 }
159
160 %typemap(out) YACS::ENGINE::Container *
161 {
162   $result=convertContainer($1,$owner);
163 }
164
165 /*
166  * Ownership section
167  */
168 //Take ownership : it is not the default (constructor) as it is a factory
169 %newobject *::createProc;
170 %newobject *::createScriptNode;
171 %newobject *::createFuncNode;
172 %newobject *::createRefNode;
173 %newobject *::createCompoNode;
174 %newobject *::createSInlineNode;
175 %newobject *::createInDataNode;
176 %newobject *::createOutDataNode;
177 %newobject *::createBloc;
178 %newobject *::createForLoop;
179 %newobject *::createForEachLoop;
180 %newobject *::createForEachLoopDyn;
181 %newobject *::createWhileLoop;
182 %newobject *::createSwitch;
183 %newobject *::loadCatalog;
184 %newobject *::createComponentInstance;
185 %newobject *::createContainer;
186
187
188 %newobject *::createInputPort;
189 %newobject *::createOutputPort;
190 %newobject *::createInputDataStreamPort;
191 %newobject *::createOutputDataStreamPort;
192 %newobject *::clone;
193 %newobject *::cloneAlways;
194 %newobject *::cloneWithoutCompAndContDeepCpy;
195 %newobject *::New;
196
197 //Take ownership : transfer it from C++ (has to be completed)
198 %newobject YACS::ENGINE::Loop::edRemoveNode;
199 %newobject YACS::ENGINE::Switch::edReleaseDefaultNode;
200 %newobject YACS::ENGINE::Switch::edReleaseCase;
201 %newobject YACS::ENGINE::DynParaLoop::edRemoveNode;
202 %newobject YACS::ENGINE::DynParaLoop::edRemoveInitNode;
203 //No other way to do ??
204 %feature("pythonappend") YACS::ENGINE::Bloc::edRemoveChild(Node *node)%{
205         args[1].thisown=1
206 %}
207
208 %newobject *::createSequenceTc;
209 %newobject *::createInterfaceTc;
210 %newobject *::createStructTc;
211 %newobject *::createType;
212
213 %newobject YACS::ENGINE::SequenceAny::removeUnsetItemsFromThis;
214
215 %newobject YACS::ENGINE::TypeCode::interfaceTc;
216 %newobject YACS::ENGINE::TypeCode::sequenceTc;
217 %newobject YACS::ENGINE::TypeCode::structTc;
218
219 /*
220  * End of ownership section
221  */
222
223
224 %include <define.hxx>
225 %include <YACSBasesExport.hxx>
226 %include <Exception.hxx>
227 %include <YACSlibEngineExport.hxx>
228 %include <ConversionException.hxx>
229 %include <Runtime.hxx>
230 %include <PropertyInterface.hxx>
231
232 PYEXCEPTION(YACS::ENGINE::Executor::RunW)
233 PYEXCEPTION(YACS::ENGINE::Executor::RunB)
234 PYEXCEPTION(YACS::ENGINE::Executor::setExecMode)
235 PYEXCEPTION(YACS::ENGINE::Executor::resumeCurrentBreakPoint)
236 PYEXCEPTION(YACS::ENGINE::Executor::stopExecution)
237 PYEXCEPTION(YACS::ENGINE::Executor::waitPause)
238 PYEXCEPTION(YACS::ENGINE::ComponentInstance::load)
239
240 %include <Executor.hxx>
241
242 EXCEPTION(YACS::ENGINE::ExecutorSwig::RunPy)
243 EXCEPTION(YACS::ENGINE::ExecutorSwig::waitPause)
244 %include <ExecutorSwig.hxx>
245
246 %include <RefCounter.hxx>
247
248 %feature("unref") YACS::ENGINE::Any "$this->decrRef();"
249 %include <Any.hxx>
250
251 %ignore YACS::ENGINE::TypeCode::getOrBuildAnyFromZippedData;
252 %include <TypeCode.hxx>
253
254 %include <Scheduler.hxx>
255 %include <Task.hxx>
256 %include <Dispatcher.hxx>
257 %include <DeploymentTree.hxx>
258 %include <Port.hxx>
259 %extend YACS::ENGINE::Port
260 {
261   /* __cmp__ does not exist in Python 3 */
262   int  __lt__(Port* other)
263     {
264       if(self==other)
265         return 0;
266       else 
267         return 1;
268     }
269   int  __gt__(Port* other)
270     {
271       if(self==other)
272         return 0;
273       else 
274         return 1;
275     }
276   int __ne__(Port* other)
277     {
278       if(self==other)
279         return 0;
280       else 
281         return 1;
282     }
283   int __eq__(Port* other)
284     {
285       if(self==other)
286         return 0;
287       else 
288         return 1;
289     }
290   int __le__(Port* other)
291     {
292       if(self==other)
293         return 0;
294       else 
295         return 1;
296     }
297   int __ge__(Port* other)
298     {
299       if(self==other)
300         return 0;
301       else 
302         return 1;
303     }
304   
305   long ptr()
306     {
307       return (long)self;
308     }
309 }
310 %include <DataPort.hxx>
311 %include <InPort.hxx>
312 %include <OutPort.hxx>
313 %include <InGate.hxx>
314 %include <OutGate.hxx>
315 %include <DataFlowPort.hxx>
316 %include <DataStreamPort.hxx>
317
318 %include <LinkInfo.hxx>
319 %include <Logger.hxx>
320
321 %include <ComponentInstance.hxx>
322 %include <Container.hxx>
323 %include <HomogeneousPoolContainer.hxx>
324 %include <InputPort.hxx>
325 %extend YACS::ENGINE::InputPort
326 {
327   void edInitXML(const char * s)
328     {
329       self->edInit("XML",s);
330     }
331   void edInitPy(PyObject* ob)
332     {
333       self->edInit("Python",ob);
334     }
335 }
336 %include <InPropertyPort.hxx>
337 %extend YACS::ENGINE::InPropertyPort
338 {
339   void edInitXML(const char * s)
340     {
341       self->edInit("XML",s);
342     }
343   void edInitPy(PyObject* ob)
344     {
345       self->edInit("Python",ob);
346     }
347 }
348
349 %template(edInitInt)       YACS::ENGINE::InputPort::edInit<int>;
350 %template(edInitBool)      YACS::ENGINE::InputPort::edInit<bool>;
351 %template(edInitString)    YACS::ENGINE::InputPort::edInit<std::string>;
352 %template(edInitDbl)       YACS::ENGINE::InputPort::edInit<double>;
353
354 %include <AnyInputPort.hxx>
355 %include <ConditionInputPort.hxx>
356 %include <OutputPort.hxx>
357 %include <AnyOutputPort.hxx>
358 %include <InputDataStreamPort.hxx>
359 %include <OutputDataStreamPort.hxx>
360 %include <DataPort.hxx>
361
362 %include <Node.hxx>
363 %extend YACS::ENGINE::Node 
364 {
365   /* __cmp__ does not exist in Python 3 */
366   int  __lt__(Node* other)
367     {
368       if(self==other)
369         return 0;
370       else 
371         return 1;
372     }
373   int  __gt__(Node* other)
374     {
375       if(self==other)
376         return 0;
377       else 
378         return 1;
379     }
380   int __ne__(Node* other)
381     {
382       if(self==other)
383         return 0;
384       else 
385         return 1;
386     }
387   int __eq__(Node* other)
388     {
389       if(self==other)
390         return 0;
391       else 
392         return 1;
393     }
394   int __le__(Node* other)
395     {
396       if(self==other)
397         return 0;
398       else 
399         return 1;
400     }
401   int __ge__(Node* other)
402     {
403       if(self==other)
404         return 0;
405       else 
406         return 1;
407     }
408
409   long ptr()
410     {
411           return (long)self;
412     }
413 }
414 %include <ComplexWeight.hxx>
415 %include <ElementaryNode.hxx>
416 %include <InlineNode.hxx>
417 %include <ServiceNode.hxx>
418 %include <ServiceInlineNode.hxx>
419 %include <ServerNode.hxx>
420 %include <DataNode.hxx>
421
422 %include <ComposedNode.hxx>
423 %include <StaticDefinedComposedNode.hxx>
424 %include <Bloc.hxx>
425 %include <Proc.hxx>
426
427 %include <Loop.hxx>
428 %include <ForLoop.hxx>
429 %include <DynParaLoop.hxx>
430 %include <WhileLoop.hxx>
431 %include <ForEachLoop.hxx>
432 %include <OptimizerLoop.hxx>
433 %include <Switch.hxx>
434 %include <Visitor.hxx>
435 %include <VisitorSaveSchema.hxx>
436 %include <ComponentDefinition.hxx>
437 %include <Catalog.hxx>
438 %include <Pool.hxx>
439
440 %include <AlternateThread.hxx>
441 %include <AlternateThreadPT.hxx>
442
443 // Ignore class OptimizerAlgASync to avoid confusion with class
444 // OptimizerAlgASync in module SALOMERuntime
445 %ignore YACS::ENGINE::OptimizerAlgASync;
446 %include <OptimizerAlg.hxx>
447 %include "PlayGround.i"
448
449 %extend YACS::ENGINE::ConditionInputPort
450 {
451   bool getPyObj()
452   {
453     return self->getValue();
454   }
455 }
456 %extend YACS::ENGINE::Any
457 {
458   PyObject *getBytes()
459   {
460     YACS::ENGINE::AtomAny *self2(dynamic_cast<YACS::ENGINE::AtomAny *>(self));
461     if(!self2)
462       throw YACS::Exception("getBytes : self is not an AtomAny !");
463     std::size_t len(0);
464     const char *pt(self2->getBytesValue(len));
465     return PyBytes_FromStringAndSize(pt,len);
466   }
467 }
468
469 %extend YACS::ENGINE::AnyInputPort
470 {
471   PyObject * getPyObj()
472   {
473     return (PyObject *)getRuntime()->convertNeutral(self->edGetType(),self->getValue());
474   }
475 }
476
477 %extend YACS::ENGINE::AnyOutputPort
478 {
479   PyObject * getPyObj()
480   {
481     return (PyObject *)getRuntime()->convertNeutral(self->edGetType(),self->getValue());
482   }
483 }
484
485 %extend YACS::ENGINE::Any
486 {
487   PyObject *getPyObj()
488   {
489     return (PyObject *)getRuntime()->convertNeutral(const_cast<YACS::ENGINE::TypeCode *>(self->getType()),self);
490   }
491 }
492
493 %newobject YACS::ENGINE::SequenceAny::__getitem__;
494 %extend YACS::ENGINE::SequenceAny
495 {
496   Any* __getitem__(int i)
497   {
498     if (i < self->size())
499       {
500         AnyPtr a=(*self)[i];
501         a->incrRef();
502         return a;
503       }
504     else
505       throw std::length_error("index too large");
506   }
507 }
508
509 %newobject YACS::ENGINE::StructAny::__getitem__;
510 %extend YACS::ENGINE::StructAny
511 {
512   Any* __getitem__(const char * key)
513   {
514     AnyPtr a=(*self)[key];
515     a->incrRef();
516     return a;
517   }
518 }
519
520 %extend YACS::ENGINE::ForEachLoop
521 {
522   PyObject *getPassedResults(Executor *execut) const
523   {
524     std::vector<SequenceAny *> ret1;
525     std::vector<std::string> ret2;
526     std::vector<unsigned int> ret0(self->getPassedResults(execut,ret1,ret2));
527     PyObject *ret(PyTuple_New(3));
528     // param 0
529     PyObject *ret0Py(PyList_New(ret0.size()));
530     for(std::size_t i=0;i<ret0.size();i++)
531       PyList_SetItem(ret0Py,i,PyLong_FromLong(ret0[i]));
532     PyTuple_SetItem(ret,0,ret0Py);
533     // param 1
534     PyObject *ret1Py(PyList_New(ret1.size()));
535     for(std::size_t i=0;i<ret1.size();i++)
536       PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_YACS__ENGINE__SequenceAny, SWIG_POINTER_OWN | 0 ));
537     PyTuple_SetItem(ret,1,ret1Py);
538     // param 2
539     PyObject *ret2Py(PyList_New(ret2.size()));
540     for(std::size_t i=0;i<ret2.size();i++)
541       PyList_SetItem(ret2Py,i,PyUnicode_FromString(ret2[i].c_str()));
542     PyTuple_SetItem(ret,2,ret2Py);
543     return ret;
544   }
545
546   void assignPassedResults(const std::vector<unsigned int>& passedIds, PyObject *passedOutputs, const std::vector<std::string>& nameOfOutputs)
547   {
548     std::vector<SequenceAny *> passedOutputsCpp;
549     convertFromPyObjVectorOfObj<YACS::ENGINE::SequenceAny *>(passedOutputs,SWIGTYPE_p_YACS__ENGINE__SequenceAny,"SequenceAny",passedOutputsCpp);
550     self->assignPassedResults(passedIds,passedOutputsCpp,nameOfOutputs);
551   }
552 }
553
554 namespace YACS
555 {
556   namespace ENGINE
557   {
558     class AbstractPoint
559     {
560     protected:
561       virtual ~AbstractPoint();
562       AbstractPoint();
563       AbstractPoint(const AbstractPoint&);
564     };
565
566     class ElementaryPoint : public AbstractPoint
567     {
568     public:
569       Node *getFirstNode();
570     private:
571       ~ElementaryPoint();
572       ElementaryPoint();
573       ElementaryPoint(const ElementaryPoint&);
574     };
575
576     class BlocPoint : public AbstractPoint
577     {
578     protected:
579       ~BlocPoint();
580       BlocPoint();
581       BlocPoint(const BlocPoint&);
582     };
583
584     class LinkedBlocPoint : public BlocPoint
585     {
586     private:
587       ~LinkedBlocPoint();
588       LinkedBlocPoint();
589       LinkedBlocPoint(const LinkedBlocPoint&);
590     };
591
592     class ForkBlocPoint : public BlocPoint
593     {
594     private:
595       ~ForkBlocPoint();
596       ForkBlocPoint();
597       ForkBlocPoint(const ForkBlocPoint&);
598     };
599
600     class NotSimpleCasePoint : public BlocPoint
601     {
602     private:
603       ~NotSimpleCasePoint();
604       NotSimpleCasePoint();
605       NotSimpleCasePoint(const NotSimpleCasePoint&);
606     };
607     
608     class SetOfPoints
609     {
610     public:
611       SetOfPoints(const std::list<Node *>& nodes);
612       ~SetOfPoints();
613       void simplify();
614       std::string getRepr() const;
615       %extend
616       {
617       void accept(PyObject *pv)
618       {
619         class MyPointVisitor : public YACS::ENGINE::PointVisitor
620         {
621         public:
622           MyPointVisitor(PyObject *py):_py(py) { }
623           void beginForkBlocPoint(ForkBlocPoint *pt)
624           {
625             PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__ForkBlocPoint,0));
626             PyObject *meth(PyString_FromString("beginForkBlocPoint"));
627             PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
628             Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
629           }
630           void endForkBlocPoint(ForkBlocPoint *pt)
631           {
632             PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__ForkBlocPoint,0));
633             PyObject *meth(PyString_FromString("endForkBlocPoint"));
634             PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
635             Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
636           }
637           void beginLinkedBlocPoint(LinkedBlocPoint *pt)
638           {
639             PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__LinkedBlocPoint,0));
640             PyObject *meth(PyString_FromString("beginLinkedBlocPoint"));
641             PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
642             Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
643           }
644           void endLinkedBlocPoint(LinkedBlocPoint *pt)
645           {
646             PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__LinkedBlocPoint,0));
647             PyObject *meth(PyString_FromString("endLinkedBlocPoint"));
648             PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
649             Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
650           }
651           void beginElementaryPoint(ElementaryPoint *pt)
652           {
653             PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__ElementaryPoint,0));//$descriptor(YACS::ENGINE::ElementaryPoint *)
654             PyObject *meth(PyString_FromString("beginElementaryPoint"));
655             PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
656             Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
657           }
658           void endElementaryPoint(ElementaryPoint *pt)
659           {
660             PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__ElementaryPoint,0));
661             PyObject *meth(PyString_FromString("endElementaryPoint"));
662             PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
663             Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
664           }
665           void beginNotSimpleCasePoint(NotSimpleCasePoint *pt)
666           {
667             PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__NotSimpleCasePoint,0));//$descriptor(YACS::ENGINE::NotSimpleCasePoint *)
668             PyObject *meth(PyString_FromString("beginNotSimpleCasePoint"));
669             PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
670             Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
671           }
672           void endNotSimpleCasePoint(NotSimpleCasePoint *pt)
673           {
674             PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__NotSimpleCasePoint,0));
675             PyObject *meth(PyString_FromString("endNotSimpleCasePoint"));
676             PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
677             Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
678           }
679         private:
680           PyObject *_py;
681         };
682         MyPointVisitor mpv(pv);
683         self->accept(&mpv);
684         }
685       }
686     };
687   }
688 }
689
690 %rename(LoadObserversPluginIfAny) LoadObserversPluginIfAnySwig;
691 %rename(UnLoadObserversPluginIfAny) UnLoadObserversPluginIfAnySwig;
692                                   
693 %inline{
694   void LoadObserversPluginIfAnySwig(YACS::ENGINE::ComposedNode *rootNode, YACS::ENGINE::ExecutorSwig *executor)
695   {
696     YACS::ENGINE::LoadObserversPluginIfAny(rootNode,executor);
697   }
698
699   void UnLoadObserversPluginIfAnySwig()
700   {
701     YACS::ENGINE::UnLoadObserversPluginIfAny();
702   }
703
704   PyObject *ToBase64Swig(PyObject *bytes)
705   {
706     char *pt = nullptr;
707     Py_ssize_t length=0;
708     PyBytes_AsStringAndSize(bytes,&pt,&length);
709     std::string input(pt,length);
710     std::string ret(YACS::ENGINE::ToBase64(input));
711     return PyBytes_FromStringAndSize(ret.c_str(),ret.size());
712   }
713
714   PyObject *FromBase64Swig(PyObject *base64Str)
715   {
716     char *pt = nullptr;
717     Py_ssize_t length=0;
718     PyBytes_AsStringAndSize(base64Str,&pt,&length);
719     std::string input(pt,length);
720     std::string ret(YACS::ENGINE::FromBase64(input));
721     return PyBytes_FromStringAndSize(ret.c_str(),ret.size());
722   }
723 }