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

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

#include <cursor.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)
 
int pop ()
 Pop value scope.
 
int next ()
 Move to next member/element.
 
int member (const char *name)
 Move to member by name.
 
int elem (int32_t elem)
 Move to element by index.
 
bool is_collection ()
 Test if current scope is a collection type.
 
flecs::string_view get_member () const
 Get member name.
 
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.
 
int set_bool (bool value)
 Set boolean value.
 
int set_char (char value)
 Set char value.
 
int set_int (int64_t value)
 Set signed int value.
 
int set_uint (uint64_t value)
 Set unsigned int value.
 
int set_float (double value)
 Set float value.
 
int set_string (const char *value)
 Set string value.
 
int set_string_literal (const char *value)
 Set string literal value.
 
int set_entity (flecs::entity_t value)
 Set entity value.
 
int set_id (flecs::id_t value)
 Set (component) id value.
 
int set_null ()
 Set null value.
 
bool get_bool () const
 Get boolean value.
 
char get_char () const
 Get char value.
 
int64_t get_int () const
 Get signed int value.
 
uint64_t get_uint () const
 Get unsigned int value.
 
double get_float () const
 Get float value.
 
const char * get_string () const
 Get string value.
 
flecs::entity get_entity () const
 Get entity value.
 

Public Attributes

ecs_meta_cursor_t cursor_
 Cursor object.
 

Detailed Description

Class for reading/writing dynamic values.

Definition at line 22 of file cursor.hpp.

Constructor & Destructor Documentation

◆ cursor()

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

Definition at line 23 of file cursor.hpp.

Member Function Documentation

◆ elem()

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

Move to element by index.

Definition at line 48 of file cursor.hpp.

◆ get_bool()

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

Get boolean value.

Definition at line 124 of file cursor.hpp.

◆ get_char()

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

Get char value.

Definition at line 129 of file cursor.hpp.

◆ get_float()

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

Get float value.

Definition at line 144 of file cursor.hpp.

◆ get_int()

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

Get signed int value.

Definition at line 134 of file cursor.hpp.

◆ get_member()

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

Get member name.

Definition at line 58 of file cursor.hpp.

◆ get_ptr()

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

Get untyped pointer to value.

Definition at line 69 of file cursor.hpp.

◆ get_string()

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

Get string value.

Definition at line 149 of file cursor.hpp.

◆ get_uint()

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

Get unsigned int value.

Definition at line 139 of file cursor.hpp.

◆ is_collection()

bool flecs::cursor::is_collection ( )
inline

Test if current scope is a collection type.

Definition at line 53 of file cursor.hpp.

◆ member()

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

Move to member by name.

Definition at line 43 of file cursor.hpp.

◆ next()

int flecs::cursor::next ( )
inline

Move to next member/element.

Definition at line 38 of file cursor.hpp.

◆ pop()

int flecs::cursor::pop ( )
inline

Pop value scope.

Definition at line 33 of file cursor.hpp.

◆ push()

int flecs::cursor::push ( )
inline

Push value scope (such as a nested struct)

Definition at line 28 of file cursor.hpp.

◆ set_bool()

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

Set boolean value.

Definition at line 74 of file cursor.hpp.

◆ set_char()

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

Set char value.

Definition at line 79 of file cursor.hpp.

◆ set_entity()

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

Set entity value.

Definition at line 109 of file cursor.hpp.

◆ set_float()

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

Set float value.

Definition at line 94 of file cursor.hpp.

◆ set_id()

int flecs::cursor::set_id ( flecs::id_t value)
inline

Set (component) id value.

Definition at line 114 of file cursor.hpp.

◆ set_int()

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

Set signed int value.

Definition at line 84 of file cursor.hpp.

◆ set_null()

int flecs::cursor::set_null ( )
inline

Set null value.

Definition at line 119 of file cursor.hpp.

◆ set_string()

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

Set string value.

Definition at line 99 of file cursor.hpp.

◆ set_string_literal()

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

Set string literal value.

Definition at line 104 of file cursor.hpp.

◆ set_uint()

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

Set unsigned int value.

Definition at line 89 of file cursor.hpp.

Member Data Documentation

◆ cursor_

ecs_meta_cursor_t flecs::cursor::cursor_

Cursor object.

Definition at line 157 of file cursor.hpp.


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