private static extern bool imageflow_job_get_output_buffer_by_id(ContextPointer context, JobPointer job, int io_id, [Out] out IntPtr result_buffer, [Out] out long result_buffer_length);
public static extern JobIoPointer imageflow_job_get_io(ContextPointer context, JobPointer job, int placeholder_id);
/// <summary> /// Provides access to the underlying buffer for the given <see cref="JobPointer"/>. /// </summary> /// <param name="context"></param> /// <param name="job"></param> /// <param name="io_id"></param> /// <param name="resultBuffer"></param> /// <returns></returns> /// <exception cref="BufferOverflowException"></exception> public static bool imageflow_job_get_output_buffer_by_id(ContextPointer context, JobPointer job, int io_id, out JsonReader resultBuffer) { IntPtr resultBufferPointer; long bufferSize; bool @return = imageflow_job_get_output_buffer_by_id(context, job, io_id, out resultBufferPointer, out bufferSize); if (!@return) { resultBuffer = null; return(false); } #pragma warning disable HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation resultBuffer = new UnmanagedJsonReader(resultBufferPointer, bufferSize); #pragma warning restore HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation return(true); }
private static extern JsonResponsePointer imageflow_job_send_json(ContextPointer context, JobPointer job, [MarshalAs(UnmanagedType.LPStr)][In] string method, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)][In] byte[] json_buffer, IntPtr json_buffer_size);
/// <summary> /// Sends a JSON message to the <see cref="JobPointer"/>. /// </summary> /// <param name="context">The context.</param> /// <param name="job">The job.</param> /// <param name="method">Determines which code path will be used to process the provided JSON data and compose a response.</param> /// <param name="json">The json.</param> /// <returns><see cref="JsonResponsePointer.Zero"/> on failure.</returns> public static JsonResponsePointer imageflow_job_send_json(ContextPointer context, JobPointer job, string method, string json) { byte[] json_buffer = Encoding.UTF8.GetBytes(json); return(imageflow_job_send_json(context, job, method, json_buffer, new IntPtr(json_buffer.Length))); }
public static extern bool imageflow_job_destroy(ContextPointer context, JobPointer job);
public static extern bool imageflow_job_add_io(ContextPointer context, JobPointer job, IntPtr io, int placeholder_id, Direction direction);