Functions | |
| void | throwIllegalArgumentException (const char *text1, const char *text2) |
| void | throwIllegalStateException (const char *text1, const char *text2) |
| void | throwLastError (obx_err err=obx_last_error_code(), const char *contextPrefix=nullptr) |
| void | appendLastErrorText (obx_err err, std::string &outMessage) |
| void | throwError (obx_err err, const std::string &message) |
| void | checkErrOrThrow (obx_err err) |
| bool | checkSuccessOrThrow (obx_err err) |
| void | checkPtrOrThrow (const void *ptr, const char *contextPrefix=nullptr) |
| void | checkIdOrThrow (uint64_t id, const char *contextPrefix=nullptr) |
| template<typename T > | |
| T * | checkedPtrOrThrow (T *ptr, const char *contextPrefix=nullptr) |
| "Pass-through" variant of checkPtrOrThrow() - prefer the latter if this is not required (less templating). | |
| template<typename EX = IllegalStateException, typename T > | |
| T & | toRef (T *ptr, const char *message="Can not dereference a null pointer") |
| Dereferences the given pointer, which must be non-null. | |
| const OBX_id_array | cIdArrayRef (const std::vector< obx_id > &ids) |
| Produces an OBX_id_array with internal data referencing the given ids vector. You must ensure the given vector outlives the returned OBX_id_array. Additionally, you must NOT call obx_id_array_free(), because the result is not allocated by C, thus it must not free it. | |
| std::vector< obx_id > | idVectorOrThrow (OBX_id_array *cIds) |
| Consumes an OBX_id_array, producing a vector of IDs and freeing the array afterwards. Must be called right after the C-API call producing cIds in order to check and throw on error correctly. Example: idVectorOrThrow(obx_query_find_ids(cQuery_, offset_, limit_)) Note: even if this function throws the given OBX_id_array is freed. | |
| TreePutResult | mapErrorToTreePutResult (obx_err err) |
| void obx::internal::appendLastErrorText | ( | obx_err | err, |
| std::string & | outMessage | ||
| ) |
| T * obx::internal::checkedPtrOrThrow | ( | T * | ptr, |
| const char * | contextPrefix = nullptr |
||
| ) |
"Pass-through" variant of checkPtrOrThrow() - prefer the latter if this is not required (less templating).
| void obx::internal::checkErrOrThrow | ( | obx_err | err | ) |
| void obx::internal::checkIdOrThrow | ( | uint64_t | id, |
| const char * | contextPrefix = nullptr |
||
| ) |
| void obx::internal::checkPtrOrThrow | ( | const void * | ptr, |
| const char * | contextPrefix = nullptr |
||
| ) |
| bool obx::internal::checkSuccessOrThrow | ( | obx_err | err | ) |
| const OBX_id_array obx::internal::cIdArrayRef | ( | const std::vector< obx_id > & | ids | ) |
Produces an OBX_id_array with internal data referencing the given ids vector. You must ensure the given vector outlives the returned OBX_id_array. Additionally, you must NOT call obx_id_array_free(), because the result is not allocated by C, thus it must not free it.
| std::vector< obx_id > obx::internal::idVectorOrThrow | ( | OBX_id_array * | cIds | ) |
Consumes an OBX_id_array, producing a vector of IDs and freeing the array afterwards. Must be called right after the C-API call producing cIds in order to check and throw on error correctly. Example: idVectorOrThrow(obx_query_find_ids(cQuery_, offset_, limit_)) Note: even if this function throws the given OBX_id_array is freed.
| TreePutResult obx::internal::mapErrorToTreePutResult | ( | obx_err | err | ) |
| void obx::internal::throwError | ( | obx_err | err, |
| const std::string & | message | ||
| ) |
| Exception | or subclass depending on the given err, with the given message |
| void obx::internal::throwIllegalArgumentException | ( | const char * | text1, |
| const char * | text2 | ||
| ) |
| void obx::internal::throwIllegalStateException | ( | const char * | text1, |
| const char * | text2 | ||
| ) |
| void obx::internal::throwLastError | ( | obx_err | err = obx_last_error_code(), |
| const char * | contextPrefix = nullptr |
||
| ) |
| Exception | using the given error (defaults to obx_last_error_code()) |
| T & obx::internal::toRef | ( | T * | ptr, |
| const char * | message = "Can not dereference a null pointer" |
||
| ) |
Dereferences the given pointer, which must be non-null.
| IllegalStateException | if ptr is nullptr |