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