Lines Matching refs:INTERFACE
47 template<typename INTERFACE>
48 inline sp<INTERFACE> interface_cast(const sp<IBinder>& obj)
50 return INTERFACE::asInterface(obj);
57 template<typename INTERFACE>
58 inline sp<INTERFACE> checked_interface_cast(const sp<IBinder>& obj)
60 if (obj->getInterfaceDescriptor() != INTERFACE::descriptor) {
64 return interface_cast<INTERFACE>(obj);
69 template <typename INTERFACE>
70 class LIBBINDER_EXPORTED BnInterface : public INTERFACE, public BBinder {
74 typedef INTERFACE BaseInterface;
82 template <typename INTERFACE>
83 class LIBBINDER_EXPORTED BpInterface : public INTERFACE, public BpRefBase {
86 typedef INTERFACE BaseInterface;
94 #define DECLARE_META_INTERFACE(INTERFACE) \
97 static ::android::sp<I##INTERFACE> asInterface(const ::android::sp<::android::IBinder>& obj); \
99 I##INTERFACE(); \
100 virtual ~I##INTERFACE(); \
101 static bool setDefaultImpl(::android::sp<I##INTERFACE> impl); \
102 static const ::android::sp<I##INTERFACE>& getDefaultImpl(); \
105 static ::android::sp<I##INTERFACE> default_impl; \
113 #define IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \
121 DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(INTERFACE, NAME)
125 #define IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \
126 DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \
160 #define DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \
161 const ::android::StaticString16 I##INTERFACE##_descriptor_static_str16( \
163 const ::android::String16 I##INTERFACE::descriptor(I##INTERFACE##_descriptor_static_str16); \
164 DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE0(I##INTERFACE, I##INTERFACE, Bp##INTERFACE)
170 #define DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(PARENT, INTERFACE, NAME) \
171 const ::android::String16 PARENT::I##INTERFACE::descriptor(NAME); \
172 DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE0(PARENT::I##INTERFACE, I##INTERFACE, \
173 PARENT::Bp##INTERFACE)
184 template<typename INTERFACE>
185 inline sp<IInterface> BnInterface<INTERFACE>::queryLocalInterface(
188 if (_descriptor == INTERFACE::descriptor) return sp<IInterface>::fromExisting(this);
192 template<typename INTERFACE>
193 inline const String16& BnInterface<INTERFACE>::getInterfaceDescriptor() const
195 return INTERFACE::getInterfaceDescriptor();
198 template<typename INTERFACE>
199 IBinder* BnInterface<INTERFACE>::onAsBinder()
204 template<typename INTERFACE>
205 inline BpInterface<INTERFACE>::BpInterface(const sp<IBinder>& remote)
210 template<typename INTERFACE>
211 inline IBinder* BpInterface<INTERFACE>::onAsBinder()