FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WrapClass fails

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
vertex



Joined: 24 Nov 2007
Posts: 18

PostPosted: Wed Dec 19, 2007 10:16 am    Post subject: WrapClass fails Reply with quote

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
View user's profile Send private message
vertex



Joined: 24 Nov 2007
Posts: 18

PostPosted: Wed Dec 19, 2007 11:28 am    Post subject: Dirty but works Reply with quote

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
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Wed Dec 19, 2007 11:37 am    Post subject: Reply with quote

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
View user's profile Send private message
vertex



Joined: 24 Nov 2007
Posts: 18

PostPosted: Wed Dec 19, 2007 12:19 pm    Post subject: Reply with quote

Uh ... I think programmers are very lazy when it comes to reading documentation ... at least I am Smile

-Mike
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group