Hi Roman,
Thanks for your help with my problem using std::vector<int>. As I said in my last email, my ultimate goal is to wrap functions with a signature similar to:
UserDefinedReturnValue getDevices(std::vector<UserDefinedClass> & devices)
I am have problems with a vector of a UserDefinedClass.
I have the following class:
#include <string>
#include <iostream>
#include <vector>
using namespace std;
enum iStorReturnType {SUCCESS, FAILURE};
class Device
{
public:
Device();
iStorReturnType setName( string );
iStorReturnType getName( string& );
iStorReturnType printName();
protected:
string m_name;
};
In another class I have two instances of the Device class. In this class I have a function which returns one instance of the Device class with no problem. I want to also have a function to return a vector of all the devices.
iStorReturnType getDevices(std::vector<Device>& devices);
In my generated file I am seeing the following error:
{ //scope begin
typedef bp::class_< std::vector< Device > > vector_less__Device__grate__exposer_t;
vector_less__Device__grate__exposer_t vector_less__Device__grate__exposer = vector_less__Device__grate__exposer_t("vector_less__Device__grate_");
bp::scope vector_less__Device__grate__scope( vector_less__Device__grate__exposer );
//WARNING: the next line of code will not compile, because "::Device" does not have operator== !
vector_less__Device__grate__exposer.def( bp::vector_indexing_suite< ::std::vector< Device > >() );
} //scope end
I am hoping this is the last stumbling block to being able to implement these "simple" classes. I would greatly appreciate any help you can give me.
I do have one other question. In the C++ code that I am trying to wrap, all the functions have an error code as the return value and the actual values you want are passed as reference parameters. Is there a way to generate the function transformations other than listing each function separately in the python script which pyplusplus uses to generate the wrappers?
Thanks so much for your help.
Norma
|