-// Copyright (C) 2006-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "PointVisitor.hxx"
#include "ForkBlocPoint.hxx"
#include "LinkedBlocPoint.hxx"
+#include "NotSimpleCasePoint.hxx"
#include "ElementaryPoint.hxx"
+#include "ObserverAsPlugin.hxx"
+#include "InGate.hxx"
using namespace YACS::ENGINE;
%template() std::pair<YACS::ENGINE::OutPort *,YACS::ENGINE::InPort *>;
%template() std::pair<YACS::ENGINE::InPort *,YACS::ENGINE::OutPort *>;
%template() std::pair< std::string, int >;
+%template() std::pair< YACS::ENGINE::InGate *, bool>;
%template(ItPy3TC) IteratorPy3<YACS::ENGINE::TypeCode *>;
//%template(TCmap) std::map<std::string, YACS::ENGINE::TypeCode *>;
REFCOUNT_TEMPLATE(TCmap,YACS::ENGINE::TypeCode)
%template() std::pair<std::string, std::string>;
%template(propmap) std::map<std::string, std::string>;
%template(ItPy3Comp) IteratorPy3<YACS::ENGINE::ComponentInstance *>;
+%template(listpairingatebool) std::list< std::pair< YACS::ENGINE::InGate *, bool> >;
+
REFCOUNT_TEMPLATE(CompoInstmap,YACS::ENGINE::ComponentInstance)
%include "exception.i"
return self->getValue();
}
}
+%extend YACS::ENGINE::Any
+{
+ PyObject *getBytes()
+ {
+ YACS::ENGINE::AtomAny *self2(dynamic_cast<YACS::ENGINE::AtomAny *>(self));
+ if(!self2)
+ throw YACS::Exception("getBytes : self is not an AtomAny !");
+ std::size_t len(0);
+ const char *pt(self2->getBytesValue(len));
+ return PyBytes_FromStringAndSize(pt,len);
+ }
+}
%extend YACS::ENGINE::AnyInputPort
{
ForkBlocPoint();
ForkBlocPoint(const ForkBlocPoint&);
};
+
+ class NotSimpleCasePoint : public BlocPoint
+ {
+ private:
+ ~NotSimpleCasePoint();
+ NotSimpleCasePoint();
+ NotSimpleCasePoint(const NotSimpleCasePoint&);
+ };
class SetOfPoints
{
PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
}
+ void beginNotSimpleCasePoint(NotSimpleCasePoint *pt)
+ {
+ PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__NotSimpleCasePoint,0));//$descriptor(YACS::ENGINE::NotSimpleCasePoint *)
+ PyObject *meth(PyString_FromString("beginNotSimpleCasePoint"));
+ PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
+ Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
+ }
+ void endNotSimpleCasePoint(NotSimpleCasePoint *pt)
+ {
+ PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__NotSimpleCasePoint,0));
+ PyObject *meth(PyString_FromString("endNotSimpleCasePoint"));
+ PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
+ Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
+ }
private:
PyObject *_py;
};
}
}
+%rename(LoadObserversPluginIfAny) LoadObserversPluginIfAnySwig;
+%rename(UnLoadObserversPluginIfAny) UnLoadObserversPluginIfAnySwig;
+
+%inline{
+ void LoadObserversPluginIfAnySwig(YACS::ENGINE::ComposedNode *rootNode, YACS::ENGINE::ExecutorSwig *executor)
+ {
+ YACS::ENGINE::LoadObserversPluginIfAny(rootNode,executor);
+ }
+
+ void UnLoadObserversPluginIfAnySwig()
+ {
+ YACS::ENGINE::UnLoadObserversPluginIfAny();
+ }
+
+ PyObject *ToBase64Swig(PyObject *bytes)
+ {
+ char *pt = nullptr;
+ Py_ssize_t length=0;
+ PyBytes_AsStringAndSize(bytes,&pt,&length);
+ std::string input(pt,length);
+ std::string ret(YACS::ENGINE::ToBase64(input));
+ return PyBytes_FromStringAndSize(ret.c_str(),ret.size());
+ }
+
+ PyObject *FromBase64Swig(PyObject *base64Str)
+ {
+ char *pt = nullptr;
+ Py_ssize_t length=0;
+ PyBytes_AsStringAndSize(base64Str,&pt,&length);
+ std::string input(pt,length);
+ std::string ret(YACS::ENGINE::FromBase64(input));
+ return PyBytes_FromStringAndSize(ret.c_str(),ret.size());
+ }
+}