QAndroidBinder Class
안드로이드 바인더 클래스의 가장 중요한 메서드를 래핑합니다. 더 보기...
Header: | #include <QtCore/private/qandroidextras_p.h> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::CorePrivate) |
qmake: | QT += core-private |
이후: | Qt 6.2 |
상태: | 예비 |
이 클래스는 개발 중이며 변경될 수 있습니다.
공용 유형
enum class | CallType { Normal, OneWay } |
공용 함수
QAndroidBinder() | |
QAndroidBinder(const QJniObject &binder) | |
QJniObject | handle() const |
virtual bool | onTransact(int code, const QAndroidParcel &data, const QAndroidParcel &reply, QAndroidBinder::CallType flags) |
bool | transact(int code, const QAndroidParcel &data, QAndroidParcel *reply = nullptr, QAndroidBinder::CallType flags = CallType::Normal) const |
상세 설명
QAndroidBinder는 가장 중요한 안드로이드 바인더 메서드를 감싸는 편의 클래스입니다.
멤버 유형 문서
enum class QAndroidBinder::CallType
이 열거형은 QAndroidBinder::transact()와 함께 사용되어 IPC 호출이 수행되는 모드를 설명합니다.
Constant | 값 | 설명 |
---|---|---|
QAndroidBinder::CallType::Normal | 0 | 일반 IPC: 호출자가 수신자의 결과를 기다리는 것을 의미합니다. |
QAndroidBinder::CallType::OneWay | 1 | 단방향 IPC: 호출자가 수신자의 결과를 기다리지 않고 즉시 반환하는 것을 의미합니다. |
멤버 함수 문서
[explicit]
QAndroidBinder::QAndroidBinder()
IPC를 수행하는 데 사용할 수 있는 새 객체를 만듭니다.
onTransact 및 transact 을참조하세요 .
QAndroidBinder::QAndroidBinder(const QJniObject &binder)
binder Java 객체에서 새 객체를 만듭니다.
transact 를참조하세요 .
QJniObject QAndroidBinder::handle() const
반환 값은 이 래퍼에 포함되지 않는 다른 Java API를 호출하는 데 유용합니다.
[virtual]
bool QAndroidBinder::onTransact(int code, const QAndroidParcel &data, const QAndroidParcel &reply, QAndroidBinder::CallType flags)
기본 구현은 거짓을 반환하는 스텁입니다. 사용자는 이 메서드를 재정의하여 호출자로부터 트랜잭션 데이터를 가져와야 합니다.
code 은 수행할 작업입니다. data 은 호출자가 보낸 마샬링된 데이터입니다.
The reply is the marshaled data to be sent to the caller.
The flags are the additional operation flags.
경고: 이 메서드는 이 객체가 생성된 스레드와 다른 바인더의 스레드에서 호출됩니다.
transact 를참조하세요 .
bool QAndroidBinder::transact(int code, const QAndroidParcel &data, QAndroidParcel *reply = nullptr, QAndroidBinder::CallType flags = CallType::Normal) const
IPC 호출 수행
code 은 수행할 작업입니다. 첫 번째_콜_트랜스액션과 마지막_콜_트랜스액션 사이에 있어야 합니다.
The data is the marshaled data to send to the target.
The reply (if specified) is the marshaled data to be received from the target. May be nullptr if you are not interested in the return value.
The flags are the additional operation flags.
성공 시 참을 반환합니다.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.