Core types to define data descriptors. More...
Data Structures | |
| struct | nm_data_properties_s |
| block of static properties for a given data descriptor More... | |
| struct | nm_data_op_context_nop_s |
| struct | nm_data_op_context_copy_from_s |
| struct | nm_data_op_context_copy_to_s |
| struct | nm_data_op_context_dynamic_s |
| struct | nm_data_op_context_getprops_s |
| struct | nm_data_op_context_chunk_s |
| struct | nm_data_op_context_slicer_coroutine_s |
| struct | nm_data_op_s |
| struct | nm_data_ops_s |
| set of operations available on data type. More... | |
| struct | nm_data_s |
| a data descriptor, used to pack/unpack data from app layout to/from contiguous buffers More... | |
| struct | nm_datav_s |
| encapsulate a dynamic vector of nm_data More... | |
Macros | |
| #define | _NM_DATA_CONTENT_SIZE 64 |
| maximum size of content descriptor for nm_data | |
| #define | NM_DATA_TYPE(ENAME, CONTENT_TYPE, OPS) |
| macro to generate typed functions to init/access data fields. | |
| #define | NM_DATAV_INIT_SIZE 4 |
| initial size of an nm_datav | |
Typedefs | |
| typedef void(* | nm_data_apply_t) (void *ptr, nm_len_t len, void *_context) |
| function to apply to each data chunk upon traversal | |
| typedef enum nm_data_op_kind_e | nm_data_op_t |
| operation to apply to data in traversal & slicer | |
| typedef void(* | nm_data_traversal_t) (const void *_data_content, struct nm_data_op_s *p_op) |
| funtion to traverse data with app layout, i.e. | |
| typedef void(* | nm_data_properties_compute_t) (struct nm_data_s *p_data) |
| function to compute data properties | |
Enumerations | |
| enum | nm_data_op_kind_e { NM_DATA_OP_NONE = 0 , NM_DATA_OP_NOP , NM_DATA_OP_COPY_FROM , NM_DATA_OP_COPY_TO , NM_DATA_OP_DYNAMIC , NM_DATA_OP_GETPROPS , NM_DATA_OP_CHUNK , NM_DATA_OP_SLICER_COROUTINE } |
| operation to apply to data in traversal & slicer More... | |
Functions | |
| void | nm_data_default_properties_compute (struct nm_data_s *p_data) |
| static void | nm_data_propertie_gpu_preinit (struct nm_data_properties_s *p_props) |
| pre-init GPU part of data properties | |
| static void | nm_data_propertie_gpu_postinit (const struct nm_data_properties_s *p_props) |
| post-init GPU part of data properties: check that p_properties_compute function actually filled the GPU part. | |
| void | nm_data_properties_gpu_fill (struct nm_data_properties_s *p_props, const void *p_ptr) |
| fill in the GPU part of data properties, following pointer 'p_ptr' | |
| static void | nm_datav_init (struct nm_datav_s *p_datav) |
| initialize a datav | |
| static void | nm_datav_destroy (struct nm_datav_s *p_datav) |
| destroys a datav | |
| static void | nm_datav_add_chunk_data (struct nm_datav_s *p_datav, const struct nm_data_s *p_data) |
| add a chunk of data to datav; given p_data content is copied. | |
| static void | nm_datav_add_chunk (struct nm_datav_s *p_datav, const void *ptr, nm_len_t len) |
| add a chunk of contiguous data to a datav | |
| static void | nm_datav_add_chunk_excerpt (struct nm_datav_s *p_datav, struct nm_data_s *p_data, nm_len_t chunk_offset, nm_len_t chunk_len) |
| add an excerpt of data to datav; given p_data content is not copied. | |
| static nm_len_t | nm_datav_size (struct nm_datav_s *p_datav) |
| get the size (number of bytes) of data contained in the datav | |
| static void | nm_datav_uncommit (struct nm_datav_s *p_datav) |
| 'uncommit' a datav: explicitely declare that nm_data pointing to this datav has been destroyed. | |
Detailed Description
Core types to define data descriptors.
Macro Definition Documentation
◆ _NM_DATA_CONTENT_SIZE
| #define _NM_DATA_CONTENT_SIZE 64 |
◆ NM_DATA_TYPE
| #define NM_DATA_TYPE | ( | ENAME, | |
| CONTENT_TYPE, | |||
| OPS | |||
| ) |
macro to generate typed functions to init/access data fields.
- Parameters
-
ENAME is the base name used to build symbols (must be a valid C token) CONTENT_TYPE is the iterator internal state OPS is a collection of operations of type nm_data_ops_s for the given type. At least nm_data_ops_s::p_traversal field must be non-NULL; other fields may be NULL and will be filled with default values.
- Examples
- nm_sr_custom_data.c.
◆ NM_DATAV_INIT_SIZE
Typedef Documentation
◆ nm_data_apply_t
◆ nm_data_op_t
| typedef enum nm_data_op_kind_e nm_data_op_t |
operation to apply to data in traversal & slicer
◆ nm_data_properties_compute_t
◆ nm_data_traversal_t
| typedef void(* nm_data_traversal_t) (const void *_data_content, struct nm_data_op_s *p_op) |
Enumeration Type Documentation
◆ nm_data_op_kind_e
| enum nm_data_op_kind_e |
operation to apply to data in traversal & slicer
Function Documentation
◆ nm_data_default_properties_compute()
| void nm_data_default_properties_compute | ( | struct nm_data_s * | p_data | ) |
compute data properties; not for enduser, exported for use by inline function
◆ nm_data_propertie_gpu_postinit()
|
inlinestatic |
post-init GPU part of data properties: check that p_properties_compute function actually filled the GPU part.
◆ nm_data_propertie_gpu_preinit()
|
inlinestatic |
pre-init GPU part of data properties
◆ nm_data_properties_gpu_fill()
| void nm_data_properties_gpu_fill | ( | struct nm_data_properties_s * | p_props, |
| const void * | p_ptr | ||
| ) |
fill in the GPU part of data properties, following pointer 'p_ptr'
Referenced by nm_data_op_apply_getprops().
◆ nm_datav_add_chunk()
|
inlinestatic |
add a chunk of contiguous data to a datav
Definition at line 850 of file nm_data.h.
References len, nm_data_contiguous_build(), and nm_datav_add_chunk_data().

◆ nm_datav_add_chunk_data()
|
inlinestatic |
add a chunk of data to datav; given p_data content is copied.
Definition at line 829 of file nm_data.h.
References nm_datav_s::allocated, assert(), nm_datav_s::commited, nm_datav_s::data, nm_datav_s::n_data, NM_DATAV_INIT_SIZE, nm_datav_s::p_data, and p_data.
Referenced by nm_datav_add_chunk(), nm_datav_add_chunk_excerpt(), nm_rpc_irecv_body_data(), and nm_rpc_recv_header_data().

◆ nm_datav_add_chunk_excerpt()
|
inlinestatic |
add an excerpt of data to datav; given p_data content is not copied.
Definition at line 857 of file nm_data.h.
References chunk_len, chunk_offset, nm_data_excerpt_build(), nm_datav_add_chunk_data(), and p_data.
Referenced by nm_coll_datav_descendants().

◆ nm_datav_destroy()
|
inlinestatic |
destroys a datav
Definition at line 819 of file nm_data.h.
References assert(), nm_datav_s::data, and nm_datav_s::p_data.

◆ nm_datav_init()
|
inlinestatic |
initialize a datav
Definition at line 811 of file nm_data.h.
References nm_datav_s::allocated, nm_datav_s::commited, nm_datav_s::data, nm_datav_s::n_data, and nm_datav_s::p_data.
◆ nm_datav_size()
|
inlinestatic |
get the size (number of bytes) of data contained in the datav
Definition at line 864 of file nm_data.h.
References nm_datav_s::n_data, nm_data_size(), nm_datav_s::p_data, and size.
Referenced by nm_rpc_recv_header_data().

◆ nm_datav_uncommit()
|
inlinestatic |
'uncommit' a datav: explicitely declare that nm_data pointing to this datav has been destroyed.
Use with care!
Definition at line 875 of file nm_data.h.
References assert(), and nm_datav_s::commited.
Referenced by nm_rpc_recv_header_data().
