g***@virgin.net
2008-09-24 10:27:38 UTC
Hello,
I have a library object that indexes large data files of various
formats by converting to a common format.
During the indexing process i call a callback method so that an
interested consumer of the object can access the converted data at the
point of indexing.
The signature of my callback method has a parameter that is a pointer
to a common base class object from which all of my converter objects
are derived.
In my consumers implementation (a separate application) of the call
back function i use dynamic_cast to downcast the passed base pointer
object to the expected derived class. Although dynamic_cast does
succeed the resultant cast pointer does not hold the derived class
details. I suspect that only memory for the base class is actually
passed to the callback function.
Can anyone shed any light on how this should function? do i need to
provide custom marshalling? if so how?
Many thanks
I have a library object that indexes large data files of various
formats by converting to a common format.
During the indexing process i call a callback method so that an
interested consumer of the object can access the converted data at the
point of indexing.
The signature of my callback method has a parameter that is a pointer
to a common base class object from which all of my converter objects
are derived.
In my consumers implementation (a separate application) of the call
back function i use dynamic_cast to downcast the passed base pointer
object to the expected derived class. Although dynamic_cast does
succeed the resultant cast pointer does not hold the derived class
details. I suspect that only memory for the base class is actually
passed to the callback function.
Can anyone shed any light on how this should function? do i need to
provide custom marshalling? if so how?
Many thanks