MCPcopy Create free account
hub / github.com/MTG/essentia / toPython

Function toPython

src/python/parsing.cpp:143–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143PyObject* toPython(void* obj, Edt tp) {
144 switch (tp) {
145 case REAL: return PyReal::toPythonCopy((Real*)obj);
146 case STRING: return String::toPythonCopy((string*)obj);
147 case INTEGER: return Integer::toPythonCopy((int*)obj);
148 case BOOL: return Boolean::toPythonCopy((bool*)obj);
149 case STEREOSAMPLE: return PyStereoSample::toPythonCopy((StereoSample*)obj);
150 case VECTOR_REAL: return VectorReal::toPythonRef((RogueVector<Real>*)obj);
151 case VECTOR_STRING: return VectorString::toPythonCopy((vector<string>*)obj);
152 case VECTOR_COMPLEX: return VectorComplex::toPythonRef((RogueVector<complex<Real> >*)obj);
153 case VECTOR_INTEGER: return VectorInteger::toPythonRef((RogueVector<int>*)obj);
154 case VECTOR_STEREOSAMPLE: return VectorStereoSample::toPythonCopy((vector<StereoSample>*)obj);
155 case VECTOR_VECTOR_REAL: return VectorVectorReal::toPythonCopy((vector<vector<Real> >*)obj);
156 case VECTOR_VECTOR_STRING: return VectorVectorString::toPythonCopy((vector<vector<string> >*)obj);
157 case VECTOR_VECTOR_STEREOSAMPLE: return VectorVectorStereoSample::toPythonCopy((vector<vector<StereoSample> >*)obj);
158 case MATRIX_REAL: return MatrixReal::toPythonRef((TNT::Array2D<Real>*)obj);
159 case VECTOR_MATRIX_REAL: return VectorMatrixReal::toPythonCopy((vector<TNT::Array2D<Real> >*)obj);
160 case POOL: return PyPool::toPythonRef((Pool*)obj);
161
162 // WARNING: This list is very incomplete. For example, paramToPython uses this function and is
163 // supposed to support every kind of parameter including Maps of things which are obviously not
164 // currently supported in this function. To complete this list, make sure to see paramToPython.
165
166 default:
167 throw EssentiaException("toPython: Unable to convert data type to a python type: ", edtToString(tp));
168 }
169}
170
171typedef map<string, Real> mapreal;
172typedef map<string, vector<Real> > mapvectorreal;

Callers 12

computeMethod · 0.85
paramToPythonFunction · 0.85
nameMethod · 0.85
inputNamesMethod · 0.85
outputNamesMethod · 0.85
parameterNamesMethod · 0.85
hasSinkMethod · 0.85
hasSourceMethod · 0.85
getInputTypeMethod · 0.85
getOutputTypeMethod · 0.85
paramTypeMethod · 0.85
totalProducedFunction · 0.85

Calls 2

EssentiaExceptionClass · 0.85
edtToStringFunction · 0.85

Tested by

no test coverage detected