Flecs v3.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::meta::cursor Struct Reference

Class for reading/writing dynamic values. More...

#include <decl.hpp>

Public Member Functions

 cursor (flecs::world_t *world, flecs::entity_t type_id, void *ptr)
 
int push ()
 Push value scope (such as a nested struct) More...
 
int pop ()
 Pop value scope. More...
 
int next ()
 Move to next member/element. More...
 
int member (const char *name)
 Move to member by name. More...
 
int elem (int32_t elem)
 Move to element by index. More...
 
bool is_collection ()
 Test if current scope is a collection type. More...
 
flecs::string_view get_member () const
 Get member name. More...
 
flecs::entity get_type () const
 Get type of value.
 
flecs::entity get_unit () const
 Get unit of value.
 
void * get_ptr ()
 Get untyped pointer to value. More...
 
int set_bool (bool value)
 Set boolean value. More...
 
int set_char (char value)
 Set char value. More...
 
int set_int (int64_t value)
 Set signed int value. More...
 
int set_uint (uint64_t value)
 Set unsigned int value. More...
 
int set_float (double value)
 Set float value. More...
 
int set_string (const char *value)
 Set string value. More...
 
int set_string_literal (const char *value)
 Set string literal value. More...
 
int set_entity (flecs::entity_t value)
 Set entity value. More...
 
int set_null ()
 Set null value. More...
 
bool get_bool () const
 Get boolean value. More...
 
char get_char () const
 Get char value. More...
 
int64_t get_int () const
 Get signed int value. More...
 
uint64_t get_uint () const
 Get unsigned int value. More...
 
double get_float () const
 Get float value. More...
 
const char * get_string () const
 Get string value. More...
 
flecs::entity get_entity () const
 Get entity value.
 

Public Attributes

ecs_meta_cursor_t m_cursor
 Cursor object. More...
 

Detailed Description

Class for reading/writing dynamic values.

Definition at line 125 of file decl.hpp.

Constructor & Destructor Documentation

◆ cursor()

flecs::meta::cursor::cursor ( flecs::world_t *  world,
flecs::entity_t  type_id,
void *  ptr 
)
inline

Definition at line 126 of file decl.hpp.

Member Function Documentation

◆ elem()

int flecs::meta::cursor::elem ( int32_t  elem)
inline

Move to element by index.

Definition at line 151 of file decl.hpp.

◆ get_bool()

bool flecs::meta::cursor::get_bool ( ) const
inline

Get boolean value.

Definition at line 222 of file decl.hpp.

◆ get_char()

char flecs::meta::cursor::get_char ( ) const
inline

Get char value.

Definition at line 227 of file decl.hpp.

◆ get_float()

double flecs::meta::cursor::get_float ( ) const
inline

Get float value.

Definition at line 242 of file decl.hpp.

◆ get_int()

int64_t flecs::meta::cursor::get_int ( ) const
inline

Get signed int value.

Definition at line 232 of file decl.hpp.

◆ get_member()

flecs::string_view flecs::meta::cursor::get_member ( ) const
inline

Get member name.

Definition at line 161 of file decl.hpp.

◆ get_ptr()

void * flecs::meta::cursor::get_ptr ( )
inline

Get untyped pointer to value.

Definition at line 172 of file decl.hpp.

◆ get_string()

const char * flecs::meta::cursor::get_string ( ) const
inline

Get string value.

Definition at line 247 of file decl.hpp.

◆ get_uint()

uint64_t flecs::meta::cursor::get_uint ( ) const
inline

Get unsigned int value.

Definition at line 237 of file decl.hpp.

◆ is_collection()

bool flecs::meta::cursor::is_collection ( )
inline

Test if current scope is a collection type.

Definition at line 156 of file decl.hpp.

◆ member()

int flecs::meta::cursor::member ( const char *  name)
inline

Move to member by name.

Definition at line 146 of file decl.hpp.

◆ next()

int flecs::meta::cursor::next ( )
inline

Move to next member/element.

Definition at line 141 of file decl.hpp.

◆ pop()

int flecs::meta::cursor::pop ( )
inline

Pop value scope.

Definition at line 136 of file decl.hpp.

◆ push()

int flecs::meta::cursor::push ( )
inline

Push value scope (such as a nested struct)

Definition at line 131 of file decl.hpp.

◆ set_bool()

int flecs::meta::cursor::set_bool ( bool  value)
inline

Set boolean value.

Definition at line 177 of file decl.hpp.

◆ set_char()

int flecs::meta::cursor::set_char ( char  value)
inline

Set char value.

Definition at line 182 of file decl.hpp.

◆ set_entity()

int flecs::meta::cursor::set_entity ( flecs::entity_t  value)
inline

Set entity value.

Definition at line 212 of file decl.hpp.

◆ set_float()

int flecs::meta::cursor::set_float ( double  value)
inline

Set float value.

Definition at line 197 of file decl.hpp.

◆ set_int()

int flecs::meta::cursor::set_int ( int64_t  value)
inline

Set signed int value.

Definition at line 187 of file decl.hpp.

◆ set_null()

int flecs::meta::cursor::set_null ( )
inline

Set null value.

Definition at line 217 of file decl.hpp.

◆ set_string()

int flecs::meta::cursor::set_string ( const char *  value)
inline

Set string value.

Definition at line 202 of file decl.hpp.

◆ set_string_literal()

int flecs::meta::cursor::set_string_literal ( const char *  value)
inline

Set string literal value.

Definition at line 207 of file decl.hpp.

◆ set_uint()

int flecs::meta::cursor::set_uint ( uint64_t  value)
inline

Set unsigned int value.

Definition at line 192 of file decl.hpp.

Member Data Documentation

◆ m_cursor

ecs_meta_cursor_t flecs::meta::cursor::m_cursor

Cursor object.

Definition at line 255 of file decl.hpp.


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