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