Flecs v3.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
Values

Construct, destruct, copy and move dynamically created values. More...

Functions

int ecs_value_init (const ecs_world_t *world, ecs_entity_t type, void *ptr)
 Construct a value in existing storage. More...
 
int ecs_value_init_w_type_info (const ecs_world_t *world, const ecs_type_info_t *ti, void *ptr)
 Construct a value in existing storage. More...
 
void * ecs_value_new (ecs_world_t *world, ecs_entity_t type)
 Construct a value in new storage. More...
 
int ecs_value_fini_w_type_info (const ecs_world_t *world, const ecs_type_info_t *ti, void *ptr)
 Destruct a value. More...
 
int ecs_value_fini (const ecs_world_t *world, ecs_entity_t type, void *ptr)
 Destruct a value. More...
 
int ecs_value_free (ecs_world_t *world, ecs_entity_t type, void *ptr)
 Destruct a value, free storage. More...
 
int ecs_value_copy_w_type_info (const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, const void *src)
 Copy value. More...
 
int ecs_value_copy (const ecs_world_t *world, ecs_entity_t type, void *dst, const void *src)
 Copy value. More...
 
int ecs_value_move_w_type_info (const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, void *src)
 Move value. More...
 
int ecs_value_move (const ecs_world_t *world, ecs_entity_t type, void *dst, void *src)
 Move value. More...
 
int ecs_value_move_ctor_w_type_info (const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, void *src)
 Move construct value. More...
 
int ecs_value_move_ctor (const ecs_world_t *world, ecs_entity_t type, void *dst, void *src)
 Move construct value. More...
 

Detailed Description

Construct, destruct, copy and move dynamically created values.

Function Documentation

◆ ecs_value_copy()

int ecs_value_copy ( const ecs_world_t world,
ecs_entity_t  type,
void *  dst,
const void *  src 
)

Copy value.

Parameters
worldThe world.
typeThe type of the value to copy.
dstPointer to the storage to copy to.
srcPointer to the value to copy.
Returns
Zero if success, nonzero if failed.

◆ ecs_value_copy_w_type_info()

int ecs_value_copy_w_type_info ( const ecs_world_t world,
const ecs_type_info_t ti,
void *  dst,
const void *  src 
)

Copy value.

Parameters
worldThe world.
tiType info of the value to copy.
dstPointer to the storage to copy to.
srcPointer to the value to copy.
Returns
Zero if success, nonzero if failed.

◆ ecs_value_fini()

int ecs_value_fini ( const ecs_world_t world,
ecs_entity_t  type,
void *  ptr 
)

Destruct a value.

Parameters
worldThe world.
typeThe type of the value to destruct.
ptrPointer to constructed value of type 'type'.
Returns
Zero if success, nonzero if failed.

◆ ecs_value_fini_w_type_info()

int ecs_value_fini_w_type_info ( const ecs_world_t world,
const ecs_type_info_t ti,
void *  ptr 
)

Destruct a value.

Parameters
worldThe world.
tiType info of the value to destruct.
ptrPointer to constructed value of type 'type'.
Returns
Zero if success, nonzero if failed.

◆ ecs_value_free()

int ecs_value_free ( ecs_world_t world,
ecs_entity_t  type,
void *  ptr 
)

Destruct a value, free storage.

Parameters
worldThe world.
typeThe type of the value to destruct.
Returns
Zero if success, nonzero if failed.

◆ ecs_value_init()

int ecs_value_init ( const ecs_world_t world,
ecs_entity_t  type,
void *  ptr 
)

Construct a value in existing storage.

Parameters
worldThe world.
typeThe type of the value to create.
ptrPointer to a value of type 'type'
Returns
Zero if success, nonzero if failed.

◆ ecs_value_init_w_type_info()

int ecs_value_init_w_type_info ( const ecs_world_t world,
const ecs_type_info_t ti,
void *  ptr 
)

Construct a value in existing storage.

Parameters
worldThe world.
tiThe type info of the type to create.
ptrPointer to a value of type 'type'
Returns
Zero if success, nonzero if failed.

◆ ecs_value_move()

int ecs_value_move ( const ecs_world_t world,
ecs_entity_t  type,
void *  dst,
void *  src 
)

Move value.

Parameters
worldThe world.
typeThe type of the value to move.
dstPointer to the storage to move to.
srcPointer to the value to move.
Returns
Zero if success, nonzero if failed.

◆ ecs_value_move_ctor()

int ecs_value_move_ctor ( const ecs_world_t world,
ecs_entity_t  type,
void *  dst,
void *  src 
)

Move construct value.

Parameters
worldThe world.
typeThe type of the value to move.
dstPointer to the storage to move to.
srcPointer to the value to move.
Returns
Zero if success, nonzero if failed.

◆ ecs_value_move_ctor_w_type_info()

int ecs_value_move_ctor_w_type_info ( const ecs_world_t world,
const ecs_type_info_t ti,
void *  dst,
void *  src 
)

Move construct value.

Parameters
worldThe world.
tiType info of the value to move.
dstPointer to the storage to move to.
srcPointer to the value to move.
Returns
Zero if success, nonzero if failed.

◆ ecs_value_move_w_type_info()

int ecs_value_move_w_type_info ( const ecs_world_t world,
const ecs_type_info_t ti,
void *  dst,
void *  src 
)

Move value.

Parameters
worldThe world.
tiType info of the value to move.
dstPointer to the storage to move to.
srcPointer to the value to move.
Returns
Zero if success, nonzero if failed.

◆ ecs_value_new()

void * ecs_value_new ( ecs_world_t world,
ecs_entity_t  type 
)

Construct a value in new storage.

Parameters
worldThe world.
typeThe type of the value to create.
Returns
Pointer to type if success, NULL if failed.