static T GetMethodDelegate <T>(UnmanagedLibrary library) where T : class { var methodName = RemoveStringSuffix(typeof(T).Name, "_delegate"); return(library.GetNativeMethodDelegate <T>(methodName)); }
public NativeMethods(UnmanagedLibrary library) { this.grpcsharp_init = GetMethodDelegate <Delegates.grpcsharp_init_delegate>(library); this.grpcsharp_shutdown = GetMethodDelegate <Delegates.grpcsharp_shutdown_delegate>(library); this.grpcsharp_version_string = GetMethodDelegate <Delegates.grpcsharp_version_string_delegate>(library); this.grpcsharp_batch_context_create = GetMethodDelegate <Delegates.grpcsharp_batch_context_create_delegate>(library); this.grpcsharp_batch_context_recv_initial_metadata = GetMethodDelegate <Delegates.grpcsharp_batch_context_recv_initial_metadata_delegate>(library); this.grpcsharp_batch_context_recv_message_length = GetMethodDelegate <Delegates.grpcsharp_batch_context_recv_message_length_delegate>(library); this.grpcsharp_batch_context_recv_message_to_buffer = GetMethodDelegate <Delegates.grpcsharp_batch_context_recv_message_to_buffer_delegate>(library); this.grpcsharp_batch_context_recv_status_on_client_status = GetMethodDelegate <Delegates.grpcsharp_batch_context_recv_status_on_client_status_delegate>(library); this.grpcsharp_batch_context_recv_status_on_client_details = GetMethodDelegate <Delegates.grpcsharp_batch_context_recv_status_on_client_details_delegate>(library); this.grpcsharp_batch_context_recv_status_on_client_trailing_metadata = GetMethodDelegate <Delegates.grpcsharp_batch_context_recv_status_on_client_trailing_metadata_delegate>(library); this.grpcsharp_batch_context_recv_close_on_server_cancelled = GetMethodDelegate <Delegates.grpcsharp_batch_context_recv_close_on_server_cancelled_delegate>(library); this.grpcsharp_batch_context_destroy = GetMethodDelegate <Delegates.grpcsharp_batch_context_destroy_delegate>(library); this.grpcsharp_request_call_context_create = GetMethodDelegate <Delegates.grpcsharp_request_call_context_create_delegate>(library); this.grpcsharp_request_call_context_call = GetMethodDelegate <Delegates.grpcsharp_request_call_context_call_delegate>(library); this.grpcsharp_request_call_context_method = GetMethodDelegate <Delegates.grpcsharp_request_call_context_method_delegate>(library); this.grpcsharp_request_call_context_host = GetMethodDelegate <Delegates.grpcsharp_request_call_context_host_delegate>(library); this.grpcsharp_request_call_context_deadline = GetMethodDelegate <Delegates.grpcsharp_request_call_context_deadline_delegate>(library); this.grpcsharp_request_call_context_request_metadata = GetMethodDelegate <Delegates.grpcsharp_request_call_context_request_metadata_delegate>(library); this.grpcsharp_request_call_context_destroy = GetMethodDelegate <Delegates.grpcsharp_request_call_context_destroy_delegate>(library); this.grpcsharp_composite_call_credentials_create = GetMethodDelegate <Delegates.grpcsharp_composite_call_credentials_create_delegate>(library); this.grpcsharp_call_credentials_release = GetMethodDelegate <Delegates.grpcsharp_call_credentials_release_delegate>(library); this.grpcsharp_call_cancel = GetMethodDelegate <Delegates.grpcsharp_call_cancel_delegate>(library); this.grpcsharp_call_cancel_with_status = GetMethodDelegate <Delegates.grpcsharp_call_cancel_with_status_delegate>(library); this.grpcsharp_call_start_unary = GetMethodDelegate <Delegates.grpcsharp_call_start_unary_delegate>(library); this.grpcsharp_call_start_client_streaming = GetMethodDelegate <Delegates.grpcsharp_call_start_client_streaming_delegate>(library); this.grpcsharp_call_start_server_streaming = GetMethodDelegate <Delegates.grpcsharp_call_start_server_streaming_delegate>(library); this.grpcsharp_call_start_duplex_streaming = GetMethodDelegate <Delegates.grpcsharp_call_start_duplex_streaming_delegate>(library); this.grpcsharp_call_send_message = GetMethodDelegate <Delegates.grpcsharp_call_send_message_delegate>(library); this.grpcsharp_call_send_close_from_client = GetMethodDelegate <Delegates.grpcsharp_call_send_close_from_client_delegate>(library); this.grpcsharp_call_send_status_from_server = GetMethodDelegate <Delegates.grpcsharp_call_send_status_from_server_delegate>(library); this.grpcsharp_call_recv_message = GetMethodDelegate <Delegates.grpcsharp_call_recv_message_delegate>(library); this.grpcsharp_call_recv_initial_metadata = GetMethodDelegate <Delegates.grpcsharp_call_recv_initial_metadata_delegate>(library); this.grpcsharp_call_start_serverside = GetMethodDelegate <Delegates.grpcsharp_call_start_serverside_delegate>(library); this.grpcsharp_call_send_initial_metadata = GetMethodDelegate <Delegates.grpcsharp_call_send_initial_metadata_delegate>(library); this.grpcsharp_call_set_credentials = GetMethodDelegate <Delegates.grpcsharp_call_set_credentials_delegate>(library); this.grpcsharp_call_get_peer = GetMethodDelegate <Delegates.grpcsharp_call_get_peer_delegate>(library); this.grpcsharp_call_destroy = GetMethodDelegate <Delegates.grpcsharp_call_destroy_delegate>(library); this.grpcsharp_channel_args_create = GetMethodDelegate <Delegates.grpcsharp_channel_args_create_delegate>(library); this.grpcsharp_channel_args_set_string = GetMethodDelegate <Delegates.grpcsharp_channel_args_set_string_delegate>(library); this.grpcsharp_channel_args_set_integer = GetMethodDelegate <Delegates.grpcsharp_channel_args_set_integer_delegate>(library); this.grpcsharp_channel_args_destroy = GetMethodDelegate <Delegates.grpcsharp_channel_args_destroy_delegate>(library); this.grpcsharp_override_default_ssl_roots = GetMethodDelegate <Delegates.grpcsharp_override_default_ssl_roots>(library); this.grpcsharp_ssl_credentials_create = GetMethodDelegate <Delegates.grpcsharp_ssl_credentials_create_delegate>(library); this.grpcsharp_composite_channel_credentials_create = GetMethodDelegate <Delegates.grpcsharp_composite_channel_credentials_create_delegate>(library); this.grpcsharp_channel_credentials_release = GetMethodDelegate <Delegates.grpcsharp_channel_credentials_release_delegate>(library); this.grpcsharp_insecure_channel_create = GetMethodDelegate <Delegates.grpcsharp_insecure_channel_create_delegate>(library); this.grpcsharp_secure_channel_create = GetMethodDelegate <Delegates.grpcsharp_secure_channel_create_delegate>(library); this.grpcsharp_channel_create_call = GetMethodDelegate <Delegates.grpcsharp_channel_create_call_delegate>(library); this.grpcsharp_channel_check_connectivity_state = GetMethodDelegate <Delegates.grpcsharp_channel_check_connectivity_state_delegate>(library); this.grpcsharp_channel_watch_connectivity_state = GetMethodDelegate <Delegates.grpcsharp_channel_watch_connectivity_state_delegate>(library); this.grpcsharp_channel_get_target = GetMethodDelegate <Delegates.grpcsharp_channel_get_target_delegate>(library); this.grpcsharp_channel_destroy = GetMethodDelegate <Delegates.grpcsharp_channel_destroy_delegate>(library); this.grpcsharp_sizeof_grpc_event = GetMethodDelegate <Delegates.grpcsharp_sizeof_grpc_event_delegate>(library); this.grpcsharp_completion_queue_create = GetMethodDelegate <Delegates.grpcsharp_completion_queue_create_delegate>(library); this.grpcsharp_completion_queue_shutdown = GetMethodDelegate <Delegates.grpcsharp_completion_queue_shutdown_delegate>(library); this.grpcsharp_completion_queue_next = GetMethodDelegate <Delegates.grpcsharp_completion_queue_next_delegate>(library); this.grpcsharp_completion_queue_pluck = GetMethodDelegate <Delegates.grpcsharp_completion_queue_pluck_delegate>(library); this.grpcsharp_completion_queue_destroy = GetMethodDelegate <Delegates.grpcsharp_completion_queue_destroy_delegate>(library); this.gprsharp_free = GetMethodDelegate <Delegates.gprsharp_free_delegate>(library); this.grpcsharp_metadata_array_create = GetMethodDelegate <Delegates.grpcsharp_metadata_array_create_delegate>(library); this.grpcsharp_metadata_array_add = GetMethodDelegate <Delegates.grpcsharp_metadata_array_add_delegate>(library); this.grpcsharp_metadata_array_count = GetMethodDelegate <Delegates.grpcsharp_metadata_array_count_delegate>(library); this.grpcsharp_metadata_array_get_key = GetMethodDelegate <Delegates.grpcsharp_metadata_array_get_key_delegate>(library); this.grpcsharp_metadata_array_get_value = GetMethodDelegate <Delegates.grpcsharp_metadata_array_get_value_delegate>(library); this.grpcsharp_metadata_array_destroy_full = GetMethodDelegate <Delegates.grpcsharp_metadata_array_destroy_full_delegate>(library); this.grpcsharp_redirect_log = GetMethodDelegate <Delegates.grpcsharp_redirect_log_delegate>(library); this.grpcsharp_metadata_credentials_create_from_plugin = GetMethodDelegate <Delegates.grpcsharp_metadata_credentials_create_from_plugin_delegate>(library); this.grpcsharp_metadata_credentials_notify_from_plugin = GetMethodDelegate <Delegates.grpcsharp_metadata_credentials_notify_from_plugin_delegate>(library); this.grpcsharp_ssl_server_credentials_create = GetMethodDelegate <Delegates.grpcsharp_ssl_server_credentials_create_delegate>(library); this.grpcsharp_server_credentials_release = GetMethodDelegate <Delegates.grpcsharp_server_credentials_release_delegate>(library); this.grpcsharp_server_create = GetMethodDelegate <Delegates.grpcsharp_server_create_delegate>(library); this.grpcsharp_server_register_completion_queue = GetMethodDelegate <Delegates.grpcsharp_server_register_completion_queue_delegate>(library); this.grpcsharp_server_add_insecure_http2_port = GetMethodDelegate <Delegates.grpcsharp_server_add_insecure_http2_port_delegate>(library); this.grpcsharp_server_add_secure_http2_port = GetMethodDelegate <Delegates.grpcsharp_server_add_secure_http2_port_delegate>(library); this.grpcsharp_server_start = GetMethodDelegate <Delegates.grpcsharp_server_start_delegate>(library); this.grpcsharp_server_request_call = GetMethodDelegate <Delegates.grpcsharp_server_request_call_delegate>(library); this.grpcsharp_server_cancel_all_calls = GetMethodDelegate <Delegates.grpcsharp_server_cancel_all_calls_delegate>(library); this.grpcsharp_server_shutdown_and_notify_callback = GetMethodDelegate <Delegates.grpcsharp_server_shutdown_and_notify_callback_delegate>(library); this.grpcsharp_server_destroy = GetMethodDelegate <Delegates.grpcsharp_server_destroy_delegate>(library); this.gprsharp_now = GetMethodDelegate <Delegates.gprsharp_now_delegate>(library); this.gprsharp_inf_future = GetMethodDelegate <Delegates.gprsharp_inf_future_delegate>(library); this.gprsharp_inf_past = GetMethodDelegate <Delegates.gprsharp_inf_past_delegate>(library); this.gprsharp_convert_clock_type = GetMethodDelegate <Delegates.gprsharp_convert_clock_type_delegate>(library); this.gprsharp_sizeof_timespec = GetMethodDelegate <Delegates.gprsharp_sizeof_timespec_delegate>(library); this.grpcsharp_test_callback = GetMethodDelegate <Delegates.grpcsharp_test_callback_delegate>(library); this.grpcsharp_test_nop = GetMethodDelegate <Delegates.grpcsharp_test_nop_delegate>(library); }