This repository was archived by the owner on Mar 30, 2019. It is now read-only.
This repository was archived by the owner on Mar 30, 2019. It is now read-only.
Function mapping guideline question #1115
Open
Description
Some function Create*
functions are mapped with a MyType CreateMyType()
pattern, and others are mapped to something like void CreateMyType(out MyType)
. Are there any general rules to follow in deciding which should be used?
I'm looking at cleaning up and submitting some fixed I've made in MediaFoundation
specifically. In mapping-core.xml
there's an example for DXGIDeviceManager
like this:
<map param="MFCreateDXGIDeviceManager::ppDeviceManager" attribute="out fast"/>
and then there's this for SinkWriter
:
<map param="MFCreateSinkWriterFromURL::ppSinkWriter" return="true"/>
Is there any reason in particular these should be different? My intuition would be that creating these rarely created objects, that would generally not be made every frame for example would be better off using the MyType CreateMyType()
pattern. I'm interested in any insights here.