Scott Lanning
2007-09-07 13:02:06 UTC
This is the last question I can remember having.
I'm unsure how to implement methods which return an Object& .
For example, I have a method getPosition here
http://www.ogre3d.org/docs/api/html/classOgre_1_1Node.html#Ogre_1_1TagPointa35
virtual const Vector3& Ogre::Node::getPosition(void) const
My understanding is that a reference is just an alias,
but....the memory handling confuses me.
Here's how I have it
Vector3 *
Node::getPosition()
CODE:
RETVAL = new Vector3;
*RETVAL = THIS->getPosition();
OUTPUT:
RETVAL
where the OUTPUT typemap for Vector3* would be
sv_setref_pv($arg, "Ogre::Vector3", (void *) $var);
Is that correct?
By the way, I'd love to get critiques of
http://search.cpan.org/~slanning/Ogre-0.25/MANIFEST
There are a lot of places where I feel uncertain
that what I'm doing is correct.
Thanks for your time
I'm unsure how to implement methods which return an Object& .
For example, I have a method getPosition here
http://www.ogre3d.org/docs/api/html/classOgre_1_1Node.html#Ogre_1_1TagPointa35
virtual const Vector3& Ogre::Node::getPosition(void) const
My understanding is that a reference is just an alias,
but....the memory handling confuses me.
Here's how I have it
Vector3 *
Node::getPosition()
CODE:
RETVAL = new Vector3;
*RETVAL = THIS->getPosition();
OUTPUT:
RETVAL
where the OUTPUT typemap for Vector3* would be
sv_setref_pv($arg, "Ogre::Vector3", (void *) $var);
Is that correct?
By the way, I'd love to get critiques of
http://search.cpan.org/~slanning/Ogre-0.25/MANIFEST
There are a lot of places where I feel uncertain
that what I'm doing is correct.
Thanks for your time