Struct anj_dm_res_struct

Struct Documentation

struct anj_dm_res_struct

Struct defining a Resource.

Public Members

anj_rid_t rid

Resource ID.

anj_data_type_t type

Resource data type.

anj_dm_res_kind_t kind

Resource kind.

const anj_riid_t *insts

Pointer to the array of Resource Instance IDs.

The array must have a size equal to max_inst_count. Unused slots must be explicitly set to ANJ_ID_INVALID.

This array is never modified by the library. If handlers such as anj_dm_res_inst_create_t or anj_dm_res_inst_delete_t are defined for this Resource, the user is responsible for updating the contents of this array accordingly.

When passed to anj_dm_add_obj, all valid IDs must be sorted in strictly ascending order. Gaps or duplicate values are not allowed — the list must contain only unique, valid IDs packed at the beginning of the array.

For Single-Instance Resources, this field is ignored. For Multi-Instance Resources, this field must be a valid pointer if max_inst_count is greater than 0.

uint16_t max_inst_count

Maximum number of instances allowed for this Resource. Ignored for Single-Instance Resources.