This PR defines a helper class to allow error messages in case of mismatched external pointer tags to be more informative. In the example below, before this PR the message would have been "expected '130' but received '70'" showing the (integer) value of the tag. With the PR this mapped to a char* that can be used in the error message.
> dim <- tiledb_dim("dim", c(1L, 100L), 100L, "INT32") # create an object, here a Dimension
> dim # which has an R-level pretty-print method
tiledb_dim(name="dim", domain=c(1L,100L), tile=100L, type="INT32")
> tiledb:::libtiledb_query_submit(dim@ptr) # pass pointer to low-leve method expecting a pointer
Error: Wrong tag type: expected 'Query' but received 'Dimension'
>
The tagging of external pointers (in place for quite some time) avoids hard-to-debug and likely catastrophic run-time errors given that the use of SEXP forces type detection to the run-time.
This PR defines a helper class to allow error messages in case of mismatched external pointer tags to be more informative. In the example below, before this PR the message would have been "expected '130' but received '70'" showing the (integer) value of the tag. With the PR this mapped to a char* that can be used in the error message.
The tagging of external pointers (in place for quite some time) avoids hard-to-debug and likely catastrophic run-time errors given that the use of
SEXP
forces type detection to the run-time.