§tiro::array

Refers to an array value.

#include "tiropp/objects.hpp"

Inherits from handle

§Public Functions

Name
array(handle h)
array(const array & ) =default
array(array && ) =default
array &operator=(const array & ) =default
array &operator=(array && ) =default
size_tsize() const
Returns the number of elements in this array.
handleget(size_t index) const
Returns the value at the given index (0 <= index < size).
voidset(size_t index, const handle & value)
Sets the value at the given index (0 <= index < size) to value.
voidpush(const handle & value)
Appends value at the end of the array.
voidpop()
Removes the last element from the array.
voidclear()
Removes all elements from the array.

§Additional inherited members

Protected Classes inherited from handle

Name
structcheck_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
boolvalid() const
Returns true if this handle points to an object (i.e. it was not moved from).
value_kindkind() 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.
typetype_of() const
Returns the type of the value currently held by this handle.
stringto_string() const
Returns a string that represents the current value.
tiro_vm_traw_vm() const
Returns the raw vm instance associated with this handle.
tiro_handle_traw_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_tcheck_kind

§Public Functions Documentation

§function array

inline explicit array(
handle h
)

§function array

array(
const array &
) =default

§function array

array(
array &&
) =default

§function operator=

array & operator=(
const array &
) =default

§function operator=

array & operator=(
array &&
) =default

§function size

inline size_t size() const

Returns the number of elements in this array.

§function get

inline handle get(
size_t index
) const

Returns the value at the given index (0 <= index < size).

§function set

inline void set(
size_t index,
const handle & value
)

Sets the value at the given index (0 <= index < size) to value.

§function push

inline void push(
const handle & value
)

Appends value at the end of the array.

§function pop

inline void pop()

Removes the last element from the array.

§function clear

inline void clear()

Removes all elements from the array.


Updated on 2022-02-27 at 21:17:13 +0100