CppSharp
CppSharp copied to clipboard
Added marshalling to struct...
Mostly done... But, one other error is exposed due to this. And moreover it now also marshals few C++ classes to C# struct.
Was that intended while using @class.IsPOD
@tritao @ddobrev
Also, I did not add the check for is declared as struct this time.
Marshalling some classes as structs is OK, this is what @tritao 's idea is: marshal types based on their usage, not on the key-word which means almost nothing in C++. The error you get, however, is indeed a problem. What exactly is it?
@ddobrev The code marshals a class which was intended to be a Ref type as I had written it for testing a fix when CS_OUT was applied to a ref type argument. Now it is value type and it is not being properly initialising before use.
@ddobrev Also i wanted to ask about the case when a class in completely different assembly inherits from a class which was previously marshalled as Value Type. I described the problem on #500 a few days back,
@ddobrev Adding this pass to generator didn't seem to be good. Because of two main reasons:
1.
If user has 1 class in one project inheriting from a second class in another project. Then if he uses CppSharp on the two projects separately (As in Namespace Test) then it causes error if the Base has laready been marshalled to value type.
2.
Some classes are used in Tests like they are ref type and after marshalling them to value type the tests break.
.
For (1) I have introduced a new macro CS_REF_TYPE
which will allow the user to force marshalling to ref type even when CheckClassAsValueTypePass is used just on the condition that the CheckMacroPass is used before this pass.
@tritao @ddobrev Please review this.
@ddobrev @tritao Any comments?!
Hello @genuinelucifer . Please accept my apologies for this huge delay. I've been really busy with Qt#, I am almost ready to build GUI examples with it and it needs a last effort. Meanwhile please proceed with the task about delegates, it's more important than this one anyway.
@ddobrev That's great! :) I had a look into Qt# and it really seems that you have put much much effort into it. Best of Luck!
I'm actually unable to proceed with the delegates task because I actually don't know much about them and actually couldn't figure out how to do that. I will post my real problems on that issue soon.
@genuinelucifer I am glad you have started thinking about the task. Feel free to ask any questions. I still don't have time to review this one but I have more than enough for questions.
Hey @ddobrev we should review this soon.
(sigh) I agree. It's just that the problems keep popping up...