The idea is to introduce a templated class into the C++ headers that looks similar to this code:
private:
const T* m_ptr;
public:
classParam(const T* ptr)
: m_ptr (ptr)
{ }
classParam(std::shared_ptr <T> sharedptr)
: m_ptr(sharedptr.get())
{ }
LibXXXSDKHandle GetHandle()
{
if (m_ptr != nullptr)
return m_ptr->GetHandle();
return nullptr;
}
};
This would allow to make method calls with class instances a lot cleaner and script-like, for example
objectA->Method (objectB, objectC, 5);
instead of
objectA->Method (objectB.get(), objectC.get(), 5);