# ndk::ICInterface


**This is an abstract class.**


`#include <binder_interface_utils.h>`

wrapper analog to IInterface

## Summary

### Inheritance

Inherits from: [ndk::SharedRefBase](https://developer.android.com/ndk/reference/classndk/1-1-shared-ref-base)

| ### Constructors and Destructors ||
|---|---|
| `https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface_1a20e8eac2f337a4576264d2f2ce7f6aec()` ||
| `https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface_1a8529b9552704f6c89342a4575999f8da()` ||

| ### Public functions ||
|---|---|
| `https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface_1a2287a60355c6cca8c49e4cbc8e253252()=0` | `virtual https://developer.android.com/ndk/reference/classndk/1-1-sp-a-i-binder#classndk_1_1_sp_a_i_binder` This either returns the single existing implementation or creates a new implementation. |
| `https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface_1a91c81f99c7b8ee334e562398934bcda4(int fd, const char **args, uint32_t numArgs)` | `virtual https://developer.android.com/ndk/reference/group/ndk-binder#group___ndk_binder_1ga26845d019135385e22a356743fdf639f` Dumps information about the interface. |
| `https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface_1a43e875f0ba7f52d4b5e86b4dece8dbe6()=0` | `virtual bool` Returns whether this interface is in a remote process. |

| ### Public static functions ||
|---|---|
| `https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface_1a5331d17da8d807b8c72e2665c03a4c42(AIBinder *binder)` | `std::shared_ptr< https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface >` Interprets this binder as this underlying interface if this has stored an [ICInterface](https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface) in the binder's user data. |
| `https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface_1a90d695e8b932640d70c98e37d3725f4e(const char *interfaceDescriptor, https://developer.android.com/ndk/reference/group/ndk-binder#group___ndk_binder_1gaccd8f0f08b77c34c8e9beb1630430ee1 onTransact)` | `AIBinder_Class *` Helper method to create a class. |

## Public functions

### ICInterface

```
 ICInterface()
```

### asBinder

```
virtual SpAIBinder asBinder()=0
```
This either returns the single existing implementation or creates a new implementation.

### dump

```
virtual binder_status_t dump(
  int fd,
  const char **args,
  uint32_t numArgs
)
```
Dumps information about the interface.

By default, dumps nothing.

This method is not given ownership of the FD.

### isRemote

```
virtual bool isRemote()=0
```
Returns whether this interface is in a remote process.

If it cannot be determined locally, this will be checked using AIBinder_isRemote.

### \~ICInterface

```
virtual  ~ICInterface()
```

## Public static functions

### asInterface

```
std::shared_ptr< ICInterface > asInterface(
  AIBinder *binder
)
```
Interprets this binder as this underlying interface if this has stored an [ICInterface](https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface) in the binder's user data.

This does not do type checking and should only be used when the binder is known to originate from [ICInterface](https://developer.android.com/ndk/reference/classndk/1-1-i-c-interface#classndk_1_1_i_c_interface). Most likely, you want to use I\*::fromBinder.

### defineClass

```
AIBinder_Class * defineClass(
  const char *interfaceDescriptor,
  AIBinder_Class_onTransact onTransact
)
```
Helper method to create a class.