Flecs: flecs::opaque< T, ElemType > Struct Template Reference
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.1 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
flecs::opaque< T, ElemType > Struct Template Reference
C++ API » Addons » Meta

Type safe interface for opaque types. More...

`#include <opaque.hpp>`

## Public Member Functions
| opaque (flecs::world_t *w=nullptr)
opaque & | as_type (flecs::id_t func)
| Type that describes the type kind/structure of the opaque type.
opaque & | serialize (flecs::serialize< T > func)
| Serialize function.
opaque & | serialize_member (flecs::serialize_member< T > func)
| Serialize member function.
opaque & | serialize_element (flecs::serialize_element< T > func)
| Serialize element function.
opaque & | assign_bool (void(*func)(T *dst, bool value))
| Assign bool value.
opaque & | assign_char (void(*func)(T *dst, char value))
| Assign char value.
opaque & | assign_int (void(*func)(T *dst, int64_t value))
| Assign int value.
opaque & | assign_uint (void(*func)(T *dst, uint64_t value))
| Assign unsigned int value.
opaque & | assign_float (void(*func)(T *dst, double value))
| Assign float value.
opaque & | assign_string (void(*func)(T *dst, const char *value))
| Assign string value.
opaque & | assign_entity (void(*func)(T *dst, ecs_world_t *world, ecs_entity_t entity))
| Assign entity value.
opaque & | assign_id (void(*func)(T *dst, ecs_world_t *world, ecs_id_t id))
| Assign (component) id value.
opaque & | assign_null (void(*func)(T *dst))
| Assign null value.
opaque & | clear (void(*func)(T *dst))
| Clear collection elements.
opaque & | ensure_element (ElemType *(*func)(T *dst, size_t elem))
| Ensure & get collection element.
opaque & | ensure_member (void *(*func)(T *dst, const char *member))
| Ensure & get element.
opaque & | count (size_t(*func)(const T *dst))
| Return number of elements.
opaque & | resize (void(*func)(T *dst, size_t count))
| Resize to number of elements.

## Public Attributes
flecs::world_t * | world = nullptr
| Opaque type descriptor.
ecs_opaque_desc_t | desc = {}

## Detailed Description

template<typename T, typename ElemType = void>
struct flecs::opaque< T, ElemType >

Type safe interface for opaque types.

Definition at line 39 of file opaque.hpp.

## Constructor & Destructor Documentation

## ◆ opaque()

template<typename T, typename ElemType = void>

flecs::opaque< T, ElemType >::opaque | ( | flecs::world_t * | w = nullptr | ) |
| inline

Definition at line 40 of file opaque.hpp.

## ◆ ~opaque()

template<typename T, typename ElemType = void>

flecs::opaque< T, ElemType >::~opaque | ( |  | ) |
| inline

Definition at line 192 of file opaque.hpp.

## Member Function Documentation

## ◆ as_type()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::as_type | ( | flecs::id_t | func | ) |
| inline

Type that describes the type kind/structure of the opaque type.

Definition at line 47 of file opaque.hpp.

## ◆ assign_bool()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::assign_bool | ( | void(* | func )(T *dst, bool value) | ) |
| inline

Assign bool value.

Definition at line 77 of file opaque.hpp.

## ◆ assign_char()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::assign_char | ( | void(* | func )(T *dst, char value) | ) |
| inline

Assign char value.

Definition at line 85 of file opaque.hpp.

## ◆ assign_entity()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::assign_entity | ( | void(* | func )(T *dst, ecs_world_t *world, ecs_entity_t entity) | ) |
| inline

Assign entity value.

Definition at line 125 of file opaque.hpp.

## ◆ assign_float()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::assign_float | ( | void(* | func )(T *dst, double value) | ) |
| inline

Assign float value.

Definition at line 109 of file opaque.hpp.

## ◆ assign_id()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::assign_id | ( | void(* | func )(T *dst, ecs_world_t *world, ecs_id_t id) | ) |
| inline

Assign (component) id value.

Definition at line 135 of file opaque.hpp.

## ◆ assign_int()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::assign_int | ( | void(* | func )(T *dst, int64_t value) | ) |
| inline

Assign int value.

Definition at line 93 of file opaque.hpp.

## ◆ assign_null()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::assign_null | ( | void(* | func )(T *dst) | ) |
| inline

Assign null value.

Definition at line 145 of file opaque.hpp.

## ◆ assign_string()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::assign_string | ( | void(* | func )(T *dst, const char *value) | ) |
| inline

Assign string value.

Definition at line 117 of file opaque.hpp.

## ◆ assign_uint()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::assign_uint | ( | void(* | func )(T *dst, uint64_t value) | ) |
| inline

Assign unsigned int value.

Definition at line 101 of file opaque.hpp.

## ◆ clear()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::clear | ( | void(* | func )(T *dst) | ) |
| inline

Clear collection elements.

Definition at line 153 of file opaque.hpp.

## ◆ count()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::count | ( | size_t(* | func )(const T *dst) | ) |
| inline

Return number of elements.

Definition at line 177 of file opaque.hpp.

## ◆ ensure_element()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::ensure_element | ( | ElemType *(* | func )(T *dst, size_t elem) | ) |
| inline

Ensure & get collection element.

Definition at line 161 of file opaque.hpp.

## ◆ ensure_member()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::ensure_member | ( | void *(* | func )(T *dst, const char *member) | ) |
| inline

Ensure & get element.

Definition at line 169 of file opaque.hpp.

## ◆ resize()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::resize | ( | void(* | func )(T *dst, size_t count) | ) |
| inline

Resize to number of elements.

Definition at line 185 of file opaque.hpp.

## ◆ serialize()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::serialize | ( | flecs::serialize< T > | func | ) |
| inline

Serialize function.

Definition at line 53 of file opaque.hpp.

## ◆ serialize_element()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::serialize_element | ( | flecs::serialize_element< T > | func | ) |
| inline

Serialize element function.

Definition at line 69 of file opaque.hpp.

## ◆ serialize_member()

template<typename T, typename ElemType = void>

opaque & flecs::opaque< T, ElemType >::serialize_member | ( | flecs::serialize_member< T > | func | ) |
| inline

Serialize member function.

Definition at line 61 of file opaque.hpp.

## Member Data Documentation

## ◆ desc

template<typename T, typename ElemType = void>

ecs_opaque_desc_t flecs::opaque< T, ElemType >::desc = {}

Definition at line 200 of file opaque.hpp.

## ◆ world

template<typename T, typename ElemType = void>

flecs::world_t* flecs::opaque< T, ElemType >::world = nullptr

Opaque type descriptor.

Definition at line 199 of file opaque.hpp.

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

- include/flecs/addons/cpp/mixins/meta/opaque.hpp