46 #include "RTOp_obj_value_vtbl.h"
47 #include "RTOp_obj_free_free.h"
53 static int get_obj_type_num_entries(
55 ,
const void* instance_data
67 static int obj_create(
70 const int mem_size =
sizeof(RTOp_value_type);
71 *obj = malloc( mem_size );
72 *((RTOp_value_type*)*obj) = 0.0;
76 static int obj_reinit(
79 *((RTOp_value_type*)obj) = 0.0;
83 static int extract_state(
85 ,
const void * instance_data
88 ,RTOp_value_type value_data[]
90 ,RTOp_index_type index_data[]
92 ,RTOp_char_type char_data[]
96 assert( num_values == 1 );
97 assert( num_indexes == 0 );
98 assert( num_chars == 0 );
99 value_data[0] = *((RTOp_value_type*)obj);
103 static int load_state(
105 ,
const void * instance_data
107 ,
const RTOp_value_type value_data[]
109 ,
const RTOp_index_type index_data[]
111 ,
const RTOp_char_type char_data[]
116 assert( num_values == 1 );
117 assert( num_indexes == 0 );
118 assert( num_chars == 0 );
120 obj_create(vtbl,instance_data,obj);
121 *((RTOp_value_type*)*obj) = value_data[0];
int(* get_obj_type_num_entries)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, int *num_values, int *num_indexes, int *num_chars)
int(* obj_create)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void **obj)
int(* extract_state)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void *obj, int num_values, RTOp_value_type value_data[], int num_indexes, RTOp_index_type index_data[], int num_chars, RTOp_char_type char_data[])
int(* obj_reinit)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void *obj)
int(* load_state)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, int num_values, const RTOp_value_type value_data[], int num_indexes, const RTOp_index_type index_data[], int num_chars, const RTOp_char_type char_data[], void **obj)