§tiro::native
Refers to a native object.
#include "tiropp/objects.hpp"
Inherits from handle
§Public Functions
Name | |
---|---|
native(handle h) | |
native(const native & ) =default | |
native(native && ) =default | |
native & | operator=(const native & ) =default |
native & | operator=(native && ) =default |
const tiro_native_type_t * | type_descriptor() const Returns the native point descriptor. |
void * | data() const Returns a pointer to this object's internal storage. |
size_t | size() const Returns the size (in bytes) of the storage pointed to by data(). |
§Additional inherited members
Protected Classes inherited from handle
Name | |
---|---|
struct | check_kind_t |
Public Functions inherited from handle
Name | |
---|---|
template <typename T > T | as() const Converts this value to the target type. |
template <typename T > T | as() Converts this value to the target type. |
handle(tiro_vm_t raw_vm) Constructs a new handle instance. | |
handle(const handle & other) Constructs a new handle and initialize is it with the same value as other . | |
handle(handle && other) =default Move constructs a handle. | |
~handle() =default | |
bool | valid() const Returns true if this handle points to an object (i.e. it was not moved from). |
value_kind | kind() const Returns the kind of the value currently held by this handle. |
template <typename T > bool | is() const Returns true if this value is of the target type. |
type | type_of() const Returns the type of the value currently held by this handle. |
string | to_string() const Returns a string that represents the current value. |
tiro_vm_t | raw_vm() const Returns the raw vm instance associated with this handle. |
tiro_handle_t | raw_handle() const Returns the raw handle instance (nullptr for invalid handles). |
Protected Functions inherited from handle
Name | |
---|---|
handle(check_kind_t , handle && other, value_kind expected) |
Protected Attributes inherited from handle
Name | |
---|---|
constexpr check_kind_t | check_kind |
§Public Functions Documentation
§function native
inline explicit native(handle h)
§function native
native(const native &) =default
§function native
native(native &&) =default
§function operator=
native & operator=(const native &) =default
§function operator=
native & operator=(native &&) =default
§function type_descriptor
inline const tiro_native_type_t * type_descriptor() const
Returns the native point descriptor.
§function data
inline void * data() const
Returns a pointer to this object's internal storage.
Warning: The pointer returned by this function points into the object's current storage. Because objects may move on the heap (e.g. because of garbage collection), this data may be invalidated. The data may only be used immediately after calling this function in native code that is guaranteed to NOT allocate on the tiro heap. It MUST NOT be used as input tiro an allocating function (which includes most functions of this API), or after such a function has been called.
§function size
inline size_t size() const
Returns the size (in bytes) of the storage pointed to by data().
Updated on 2022-02-27 at 21:17:13 +0100