public ErrorCode Init(FidelityParamsCallback fidelityParamsCallback,
                              IMessage trainingFidelityParameters, String endpointUrlOverride)
        {
            IntPtr trainingFidelityParametersPtr = IntPtr.Zero;

            if (trainingFidelityParameters != null)
            {
                CProtobufSerialization cs = CProtobufSerialization.Create(trainingFidelityParameters);
                trainingFidelityParametersPtr = Marshal.AllocHGlobal(Marshal.SizeOf(cs));
                Marshal.StructureToPtr(cs, trainingFidelityParametersPtr, true);
                m_Ptrs.Add(trainingFidelityParametersPtr);
            }

            IntPtr endpointUrlOverridePtr = IntPtr.Zero;

            if (!string.IsNullOrEmpty(endpointUrlOverride))
            {
                endpointUrlOverridePtr = Marshal.StringToHGlobalAnsi(endpointUrlOverride);
                m_Ptrs.Add(endpointUrlOverridePtr);
            }

            return(m_LibraryMethods.Init(fidelityParamsCallback, trainingFidelityParametersPtr, endpointUrlOverridePtr));
        }
Exemple #2
0
 public ErrorCode Init(FidelityParamsCallback fidelityParamsCallback,
                       IntPtr trainingFidelityParameters, IntPtr endpointUrlOverride)
 {
     return((ErrorCode)Unity_TuningFork_init(fidelityParamsCallback, trainingFidelityParameters,
                                             endpointUrlOverride));
 }
Exemple #3
0
 public ErrorCode Init(FidelityParamsCallback fidelityParamsCallback,
                       IntPtr trainingFidelityParams, IntPtr endpointUrlOverride)
 {
     return(ErrorCode.PlatformNotSupported);
 }
Exemple #4
0
 static extern int Unity_TuningFork_init(
     FidelityParamsCallback fidelityParamsCallback,
     IntPtr trainingFidelityParameters,
     IntPtr endpointUrlOverride);