QJniArrayBase Class
QJniArrayBase 클래스는 ` QJniArray`에 대한 공통적이고 유형에 구애받지 않는 API를 제공합니다. 더 보기...
| 헤더: | #include <QJniArrayBase> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| 다음부터: | Qt 6.8 |
| 상속 대상: |
공개 유형
공개 함수
| bool | isEmpty() const |
| bool | isValid() const |
| T | object() const |
| QJniArrayBase::size_type | size() const |
| operator QJniObject() const |
정적 공용 멤버
| auto | fromContainer(Container &&container) |
보호된 함수
| QJniArrayBase() | |
| QJniArrayBase(const QJniArrayBase &other) | |
| QJniArrayBase(QJniArrayBase &&other) | |
| ~QJniArrayBase() | |
| void | swap(QJniArrayBase &other) |
| QJniArrayBase & | operator=(QJniArrayBase &&other) |
| QJniArrayBase & | operator=(const QJniArrayBase &other) |
멤버 함수 설명서
[noexcept protected default] QJniArrayBase::QJniArrayBase()
QJniArrayBase 의 인스턴스를 기본 생성합니다.
[explicit noexcept protected default] QJniArrayBase::QJniArrayBase(const QJniArrayBase &other)
QJniArrayBase 의 인스턴스를 복사하여 생성합니다.
[explicit noexcept protected default] QJniArrayBase::QJniArrayBase(QJniArrayBase &&other)
QJniArrayBase 의 인스턴스를 이동 생성합니다.
[noexcept protected default] QJniArrayBase::~QJniArrayBase()
QJniArrayBase 의 인스턴스를 삭제합니다.
[static] template <typename Container> requires if_compatible_source_container<Container> auto QJniArrayBase::fromContainer(Container &&container)
container 에 포함된 데이터를 담는 Java 배열을 생성하고, 이를 감싸는 QJniArray 인스턴스를 반환합니다.
제약 조건
Container 가 JNI type 또는 이에 상응하는 C++ 유형의 요소를 저장하고 포워드 이터레이터를 제공하는 컨테이너인 경우에만 오버로드 해결에 참여합니다.
생성된 QJniArray 의 특화 형태는 container 의 값 유형에 따라 달라집니다. Container<T> (예: QList<T>)의 경우 일반적으로 QJniArray<T> 가 되지만, 다음의 예외가 있습니다:
| 컨테이너 | 특화형 |
|---|---|
| QByteArray | QJniArray<jbyte> |
| QStringList | QJniArray<jstring> |
| 컨테이너::value_type | 특화 |
| QJniObject | QJniArray<jobject> |
QJniArray::toContainer()도 참조하십시오 .
bool QJniArrayBase::isEmpty() const
배열의 크기가 0이면 ` true `를 반환하고, 그렇지 않으면 ` false`를 반환합니다.
invalid 배열은 항상 비어 있습니다.
isValid(), size()
bool QJniArrayBase::isValid() const
QJniArray 객체가 유효한 `jobject`를 감싸고 있는지 여부를 반환합니다. 유효하지 않은 QJniArray 인스턴스의 경우, object()은 nullptr 를 반환합니다. 유효하지 않은 객체에 대해 반복 처리를 수행하는 것은 안전하며(begin()은 end()와 동일한 결과를 반환함), 유효하지 않은 배열에 대해 toContainer()을 호출하면 빈 컨테이너가 반환됩니다.
QJniObject::isValid(), object(), QJniArray::toContainer()도 참조하십시오 .
template <typename T = jobject> T QJniArrayBase::object() const
QJniArray 가 보유한 객체를 T 유형으로 반환하며, T는 다음 중 하나일 수 있습니다. JNI Object Types.
QJniArrayBase::size_type QJniArrayBase::size() const
배열의 크기를 반환합니다.
[noexcept protected] void QJniArrayBase::swap(QJniArrayBase &other)
이 배열 객체를 ` other`와 서로 바꿉니다. 이 작업은 매우 빠르며 절대 실패하지 않습니다.
QJniArrayBase::operator QJniObject() const
이 QJniArray 인스턴스와 동일한 jobject 을 감싸는 QJniObject 을 반환합니다.
[noexcept protected default] QJniArrayBase &QJniArrayBase::operator=(QJniArrayBase &&other)
other 를 이 QJniArrayBase 인스턴스에 할당합니다.
[noexcept protected default] QJniArrayBase &QJniArrayBase::operator=(const QJniArrayBase &other)
other 를 이 QJniArrayBase 인스턴스에 복사-할당합니다.
© 2026 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.