inkcpp
Loading...
Searching...
No Matches
ink::runtime::value Struct Reference

A Ink variable. More...

#include <types.h>

Public Types

enum class  Type {
  Bool , Uint32 , Int32 , String ,
  Float , List
}
 Type labels for ink::runtime::value
More...
 

Public Member Functions

template<Type Ty>
const auto & get () const
 Get value to corresponding type.
 
 value (bool v)
 Construct value from corresponding type.
 
 value (uint32_t v)
 Construct value from corresponding type.
 
 value (int32_t v)
 Construct value from corresponding type.
 
 value (const char *v)
 Construct value from corresponding type.
 
 value (float v)
 Construct value from corresponding type.
 
 value (list_interface *list)
 Construct value from corresponding type.
 
 value (const value &v)
 Construct value from corresponding type.
 

Public Attributes

enum ink::runtime::value::Type type
 Label of type currently contained in value.
 

Detailed Description

A Ink variable.

Used for accassing, writing and observing global variables ink::runtime::globals_interface::get() ink::runtime::globals_interface::set() ink::runtime::globals_interface::observe()

and for the execution of extern functions ink::runtime::runner_interface::bind()

Member Enumeration Documentation

◆ Type

enum class ink::runtime::value::Type
strong

Type labels for ink::runtime::value

Enumerator
Bool 

containing bool

Uint32 

containing uint32_t

Int32 

containing int32_t

String 

contaning a const char*

Float 

containing a float

List 

containing a list_interface

Member Function Documentation

◆ get()

template<Type Ty>
const auto & ink::runtime::value::get ( ) const
inline

Get value to corresponding type.

Template Parameters
TyType label of type to get
Attention
behavior if undefined if Ty != value.type

The documentation for this struct was generated from the following file: