View previous topic :: View next topic |
Author |
Message |
vertex
Joined: 24 Nov 2007 Posts: 18
|
Posted: Wed Dec 19, 2007 10:16 am Post subject: WrapClass fails |
|
|
I've got a problem with WrapClass, I'm asking now, before going deeper into it, maybe I'll fix it, let's see.
There are two classes - CConnector and CContainer, where CContainer is a general container for every item in my app. CContainers can have CConnectors, which are sources/sinks for audio/cv signals or events. CContainers should return CConnector[] arrays to MiniD, but WrapClass fails for CContainer as soon as I wrap the CConnector[] inputs()/outputs() methods, although WrapClass for CConnector succeeds. The two calls to WrapClass are in the same file, located directly.
MDValue.opAssign() - Invalid argument type 'CConnector'
C:\dmd\src\ext\minid\types.d(1072): Error: undefined identifier ARGUMENT_ERROR
C:\dmd\src\ext\minid\types.d(1072): Error: function expected before (), not ARGUMENT_ERROR of type int
C:\dmd\src\ext\minid\types.d(1884): template instance minid.types.MDValue.opAssign!(CConnector) error instantiating
Any ideas? I know that's kind of a vague description, as I said I haven't looked into it more closely, just wanted to ask if someone has any quick idea that can help.
-Mike |
|
Back to top |
|
|
vertex
Joined: 24 Nov 2007 Posts: 18
|
Posted: Wed Dec 19, 2007 11:28 am Post subject: Dirty but works |
|
|
public MDValue[] inputsForMiniD()
{
auto temp = inputs();
if (temp is null) return null;
MDValue[] temp2;
foreach (item; temp)
{
temp2 ~= ToMiniDType!(CConnector)(item);
}
return temp2;
}
Hmm. I'm using this for now and wrapping that instead of the "real" methods. But it would be nice to know more about that, maybe get rid of this hack.
-Mike |
|
Back to top |
|
|
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Wed Dec 19, 2007 11:37 am Post subject: |
|
|
Quote: | CContainers should return CConnector[] arrays to MiniD, but WrapClass fails for CContainer as soon as I wrap the CConnector[] inputs()/outputs() methods |
There's the problem. One shortcoming of the binding library (as noted in the minid.bind docs in the "Bugs" section at the top) is that arrays of wrapped classes/structs are not yet supported. What you've done with that shim is probably the best you can do until I get that working :\ |
|
Back to top |
|
|
vertex
Joined: 24 Nov 2007 Posts: 18
|
Posted: Wed Dec 19, 2007 12:19 pm Post subject: |
|
|
Uh ... I think programmers are very lazy when it comes to reading documentation ... at least I am
-Mike |
|
Back to top |
|
|
|