WPILibC++ 2024.3.2
|
Helper class for working with JNI arrays. More...
#include <wpi/jni_util.h>
Public Member Functions | |
JSpanBase (const JSpanBase &)=delete | |
JSpanBase & | operator= (const JSpanBase &)=delete |
JSpanBase (JSpanBase &&other) | |
JSpanBase & | operator= (JSpanBase &&other) |
JSpanBase (JNIEnv *env, jobject bb, size_t size) | |
JSpanBase (JNIEnv *env, jarray_type jarr, size_t size) | |
JSpanBase (JNIEnv *env, jarray_type jarr) | |
~JSpanBase () | |
operator std::span< T, Size > () const | |
std::span< T, Size > | array () const |
T * | begin () const |
T * | end () const |
bool | is_valid () const |
operator bool () const | |
T * | data () const |
size_t | size () const |
const T & | operator[] (size_t i) const |
T & | operator[] (size_t i) |
operator std::string_view () const | |
std::string_view | str () const |
std::span< copy_cv_t< T, uint8_t >, Size > | uarray () const |
Public Attributes | |
template<typename U > | |
operator std::span< U, Size >() const std JNIEnv * | m_env |
jarray_type | m_jarr = nullptr |
size_t | m_size |
std::remove_cv_t< T > * | m_elements |
Helper class for working with JNI arrays.
This class exposes an is_valid() member and an explicit conversion to bool which indicate if the span is valid. Operations on invalid spans are undefined.
Note that Set<PrimitiveType>ArrayRegion may be faster for pure writes since it avoids copying the elements from Java to C++.
T | The element type of the array (e.g., jdouble). |
IsCritical | If true, Get/ReleasePrimitiveArrayCritical will be used instead of Get/Release<PrimitiveType>ArrayElements. |
Size | The number of elements in the span. |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::remove_cv_t<T>* wpi::java::detail::JSpanBase< T, IsCritical, Size >::m_elements |
operator std::span<U, Size> () const std JNIEnv* wpi::java::detail::JSpanBase< T, IsCritical, Size >::m_env |
jarray_type wpi::java::detail::JSpanBase< T, IsCritical, Size >::m_jarr = nullptr |
size_t wpi::java::detail::JSpanBase< T, IsCritical, Size >::m_size |