rdotnet/rClr

pass by reference

hh1985 opened this issue · 0 comments

Hi,

I have following error in my code. Object ch has function like void getTimeIntensityPairs(TimeIntensityPairList& ), and I created an object ch_data (TimeIntensityPairList type) and passed it to the function. It seems to me that I need to pass a reference instead of the original object. If so, is there any way to extract the reference of an object?

Thanks a lot!

> clrGetMemberSignature(ch, 'getTimeIntensityPairs')
[1] "Method: Void getTimeIntensityPairs, TimeIntensityPairList&"

> ch_data
An object of class "cobjRef"
Slot "clrobj":
<pointer: 0x0000000030d9d860>
Slot "clrtype":
[1] "pwiz.CLI.msdata.TimeIntensityPairList"

> clrCall(ch, 'getTimeIntensityPairs', ch_data)
Error in clrCall(ch, "getTimeIntensityPairs", ch_data) : 
  Type:    System.MissingMethodException
Message: Could not find a suitable instance method getTimeIntensityPairs on type pwiz.CLI.msdata.Chromatogram for method parameters TimeIntensityPairList
Method:  Void ThrowMissingMethod(System.Type, System.String, System.String, System.Type[])
Stack trace:
   at Rclr.ReflectionHelper.ThrowMissingMethod(Type classType, String methodName, String modifier, Type[] types) in c:\Users\hhusl\AppData\Local\Temp\RtmpWMoV35\R.INSTALL337439456109\rClr\src\ClrFacade\ReflectionHelper.cs:line 785
   at Rclr.ClrFacade.InternalCallInstanceMethod(Object obj, String methodName, Boolean tryUseConverter, Object[] arguments) in c:\Users\hhusl\AppData\Local\Temp\RtmpWMoV35\R.INSTALL337439456109\rClr\src\ClrFacade\ClrFacade.cs:line 48