comparison PyTypeInterface.h @ 72:ffaa1fb3d7de vampyhost

inline is not a useful keyword with contemporary compilers
author Chris Cannam
date Mon, 24 Nov 2014 09:50:49 +0000
parents 40a01bb24209
children
comparison
equal deleted inserted replaced
71:40a01bb24209 72:ffaa1fb3d7de
242 242
243 } 243 }
244 244
245 //Vamp specific types 245 //Vamp specific types
246 Vamp::Plugin::FeatureSet PyValue_To_FeatureSet(PyObject*) const; 246 Vamp::Plugin::FeatureSet PyValue_To_FeatureSet(PyObject*) const;
247 inline void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::FeatureSet &r) const 247 void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::FeatureSet &r) const
248 { r = this->PyValue_To_FeatureSet(pyValue); } 248 { r = this->PyValue_To_FeatureSet(pyValue); }
249 249
250 Vamp::RealTime PyValue_To_RealTime(PyObject*) const; 250 Vamp::RealTime PyValue_To_RealTime(PyObject*) const;
251 inline void PyValue_To_rValue(PyObject *pyValue, Vamp::RealTime &r) const 251 void PyValue_To_rValue(PyObject *pyValue, Vamp::RealTime &r) const
252 { r = this->PyValue_To_RealTime(pyValue); } 252 { r = this->PyValue_To_RealTime(pyValue); }
253 253
254 Vamp::Plugin::OutputDescriptor::SampleType PyValue_To_SampleType(PyObject*) const; 254 Vamp::Plugin::OutputDescriptor::SampleType PyValue_To_SampleType(PyObject*) const;
255 255
256 Vamp::Plugin::InputDomain PyValue_To_InputDomain(PyObject*) const; 256 Vamp::Plugin::InputDomain PyValue_To_InputDomain(PyObject*) const;
257 inline void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::InputDomain &r) const 257 void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::InputDomain &r) const
258 { r = this->PyValue_To_InputDomain(pyValue); } 258 { r = this->PyValue_To_InputDomain(pyValue); }
259 259
260 /* Overloaded PyValue_To_rValue() to support generic functions */ 260 /* Overloaded PyValue_To_rValue() to support generic functions */
261 inline void PyValue_To_rValue(PyObject *pyValue, float &defValue) const 261 void PyValue_To_rValue(PyObject *pyValue, float &defValue) const
262 { float tmp = m_conv.PyValue_To_Float(pyValue); 262 { float tmp = m_conv.PyValue_To_Float(pyValue);
263 if(!m_error) defValue = tmp; } 263 if(!m_error) defValue = tmp; }
264 inline void PyValue_To_rValue(PyObject *pyValue, size_t &defValue) const 264 void PyValue_To_rValue(PyObject *pyValue, size_t &defValue) const
265 { size_t tmp = m_conv.PyValue_To_Size_t(pyValue); 265 { size_t tmp = m_conv.PyValue_To_Size_t(pyValue);
266 if(!m_error) defValue = tmp; } 266 if(!m_error) defValue = tmp; }
267 inline void PyValue_To_rValue(PyObject *pyValue, bool &defValue) const 267 void PyValue_To_rValue(PyObject *pyValue, bool &defValue) const
268 { bool tmp = m_conv.PyValue_To_Bool(pyValue); 268 { bool tmp = m_conv.PyValue_To_Bool(pyValue);
269 if(!m_error) defValue = tmp; } 269 if(!m_error) defValue = tmp; }
270 inline void PyValue_To_rValue(PyObject *pyValue, std::string &defValue) const 270 void PyValue_To_rValue(PyObject *pyValue, std::string &defValue) const
271 { std::string tmp = m_conv.PyValue_To_String(pyValue); 271 { std::string tmp = m_conv.PyValue_To_String(pyValue);
272 if(!m_error) defValue = tmp; } 272 if(!m_error) defValue = tmp; }
273 /*used by templates where we expect no return value, if there is one it will be ignored*/ 273 /*used by templates where we expect no return value, if there is one it will be ignored*/
274 inline void PyValue_To_rValue(PyObject *pyValue, NoneType &defValue) const 274 void PyValue_To_rValue(PyObject *pyValue, NoneType &defValue) const
275 { if (m_strict && pyValue != Py_None) 275 { if (m_strict && pyValue != Py_None)
276 setValueError("Strict conversion error: Expected 'None' type.",m_strict); 276 setValueError("Strict conversion error: Expected 'None' type.",m_strict);
277 } 277 }
278 278
279 /* convert sequence types to Vamp List types */ 279 /* convert sequence types to Vamp List types */
280 inline void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::OutputList &r) const 280 void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::OutputList &r) const
281 { r = this->PyValue_To_VampList<Vamp::Plugin::OutputList,Vamp::Plugin::OutputDescriptor>(pyValue); } 281 { r = this->PyValue_To_VampList<Vamp::Plugin::OutputList,Vamp::Plugin::OutputDescriptor>(pyValue); }
282 inline void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::ParameterList &r) const 282 void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::ParameterList &r) const
283 { r = this->PyValue_To_VampList<Vamp::Plugin::ParameterList,Vamp::Plugin::ParameterDescriptor>(pyValue); } 283 { r = this->PyValue_To_VampList<Vamp::Plugin::ParameterList,Vamp::Plugin::ParameterDescriptor>(pyValue); }
284 inline void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::FeatureList &r) const 284 void PyValue_To_rValue(PyObject *pyValue, Vamp::Plugin::FeatureList &r) const
285 { r = this->PyValue_To_VampList<Vamp::Plugin::FeatureList,Vamp::Plugin::Feature>(pyValue); } 285 { r = this->PyValue_To_VampList<Vamp::Plugin::FeatureList,Vamp::Plugin::Feature>(pyValue); }
286 286
287 /// this is only needed for RealTime->Frame conversion 287 /// this is only needed for RealTime->Frame conversion
288 void setInputSampleRate(float inputSampleRate) 288 void setInputSampleRate(float inputSampleRate)
289 { m_inputSampleRate = (unsigned int) inputSampleRate; } 289 { m_inputSampleRate = (unsigned int) inputSampleRate; }
297 297
298 void setValueError(std::string,bool) const; 298 void setValueError(std::string,bool) const;
299 ValueError& lastError() const; 299 ValueError& lastError() const;
300 300
301 /* Overloaded _convert(), bypasses error checking to avoid doing it twice in internals. */ 301 /* Overloaded _convert(), bypasses error checking to avoid doing it twice in internals. */
302 inline void _convert(PyObject *pyValue,float &r) const 302 void _convert(PyObject *pyValue,float &r) const
303 { r = m_conv.PyValue_To_Float(pyValue); } 303 { r = m_conv.PyValue_To_Float(pyValue); }
304 inline void _convert(PyObject *pyValue,size_t &r) const 304 void _convert(PyObject *pyValue,size_t &r) const
305 { r = m_conv.PyValue_To_Size_t(pyValue); } 305 { r = m_conv.PyValue_To_Size_t(pyValue); }
306 inline void _convert(PyObject *pyValue,bool &r) const 306 void _convert(PyObject *pyValue,bool &r) const
307 { r = m_conv.PyValue_To_Bool(pyValue); } 307 { r = m_conv.PyValue_To_Bool(pyValue); }
308 inline void _convert(PyObject *pyValue,std::string &r) const 308 void _convert(PyObject *pyValue,std::string &r) const
309 { r = m_conv.PyValue_To_String(pyValue); } 309 { r = m_conv.PyValue_To_String(pyValue); }
310 inline void _convert(PyObject *pyValue,std::vector<std::string> &r) const 310 void _convert(PyObject *pyValue,std::vector<std::string> &r) const
311 { r = m_conv.PyValue_To_StringVector(pyValue); } 311 { r = m_conv.PyValue_To_StringVector(pyValue); }
312 inline void _convert(PyObject *pyValue,std::vector<float> &r) const 312 void _convert(PyObject *pyValue,std::vector<float> &r) const
313 { r = m_conv.PyValue_To_FloatVector(pyValue); } 313 { r = m_conv.PyValue_To_FloatVector(pyValue); }
314 inline void _convert(PyObject *pyValue,Vamp::RealTime &r) const 314 void _convert(PyObject *pyValue,Vamp::RealTime &r) const
315 { r = PyValue_To_RealTime(pyValue); } 315 { r = PyValue_To_RealTime(pyValue); }
316 inline void _convert(PyObject *pyValue,Vamp::Plugin::OutputDescriptor::SampleType &r) const 316 void _convert(PyObject *pyValue,Vamp::Plugin::OutputDescriptor::SampleType &r) const
317 { r = PyValue_To_SampleType(pyValue); } 317 { r = PyValue_To_SampleType(pyValue); }
318 // inline void _convert(PyObject *pyValue,Vamp::Plugin::InputDomain &r) const 318 // void _convert(PyObject *pyValue,Vamp::Plugin::InputDomain &r) const
319 // { r = m_conv.PyValue_To_InputDomain(pyValue); } 319 // { r = m_conv.PyValue_To_InputDomain(pyValue); }
320 320
321 321
322 /* Identify descriptors for error reporting */ 322 /* Identify descriptors for error reporting */
323 inline std::string getDescriptorId(Vamp::Plugin::OutputDescriptor d) const 323 std::string getDescriptorId(Vamp::Plugin::OutputDescriptor d) const
324 {return std::string("Output Descriptor '") + d.identifier +"' ";} 324 {return std::string("Output Descriptor '") + d.identifier +"' ";}
325 inline std::string getDescriptorId(Vamp::Plugin::ParameterDescriptor d) const 325 std::string getDescriptorId(Vamp::Plugin::ParameterDescriptor d) const
326 {return std::string("Parameter Descriptor '") + d.identifier +"' ";} 326 {return std::string("Parameter Descriptor '") + d.identifier +"' ";}
327 inline std::string getDescriptorId(Vamp::Plugin::Feature f) const 327 std::string getDescriptorId(Vamp::Plugin::Feature f) const
328 {return std::string("Feature (") + f.label + ")"; } 328 {return std::string("Feature (") + f.label + ")"; }
329 329
330 public: 330 public:
331 const bool& error; 331 const bool& error;
332 332