I'm creating wrappers using SWIG for python for my software library and I have the following function:
template<class PR>
boost::shared_ptr<JobT<PR> > Client::WaitForJob() {
boost::shared_ptr<JobT<PR> > job;
while (!job.get()) {
list<boost::shared_ptr<Job> > jobs = GetJobs(p_jobName, p_jobID, "", JobT<PR>::New);
while (jobs.size() > 0) {
job = boost::dynamic_pointer_cast<JobT<PR> >(jobs.front());
jobs.pop_front();
if (ClaimJob(job)) return job;
else job.reset();
}
}
return job;
}
In this case I'm able to create a class for the JobT and I also used the boos_pointer. Currently I have the following in my interface file:
%template(jobme) JobT; %include "boost_shared_ptr.i" %shared_ptr(jobme)
%template(waitforme) Client::WaitForJob;
The waitforme function template return a pointer to a swig python object. This is correct but i want it to be the same as a jobme pointer.
Can someone point out if this is possible ??