44 #include "RTOp_obj_value_value_vtbl.h"
45 #include "RTOp_obj_free_free.h"
51 static int get_obj_type_num_entries(
53 ,
const void* instance_data
70 static int obj_create(
const struct RTOp_obj_type_vtbl_t* vtbl,
const void* instance_data,
void** obj )
72 struct RTOp_value_value_type* vi_obj;
73 const int mem_size =
sizeof(
struct RTOp_value_value_type);
77 *obj = malloc( mem_size );
78 vi_obj = (
struct RTOp_value_value_type*)*obj;
84 static int obj_reinit(
const struct RTOp_obj_type_vtbl_t* vtbl,
const void* instance_data,
void* obj )
86 struct RTOp_value_value_type* vi_obj;
90 vi_obj = (
struct RTOp_value_value_type*)obj;
96 static int extract_state(
98 ,
const void * instance_data
101 ,RTOp_value_type value_data[]
103 ,RTOp_index_type index_data[]
105 ,RTOp_char_type char_data[]
108 struct RTOp_value_value_type* vi_obj;
111 assert( num_values == 2 );
112 assert( num_indexes == 0 );
113 assert( num_chars == 0 );
115 vi_obj = (
struct RTOp_value_value_type*)obj;
116 value_data[0] = vi_obj->value1;
117 value_data[1] = vi_obj->value2;
121 static int load_state(
123 ,
const void * instance_data
125 ,
const RTOp_value_type value_data[]
127 ,
const RTOp_index_type index_data[]
129 ,
const RTOp_char_type char_data[]
133 struct RTOp_value_value_type* vi_obj;
136 assert( num_values == 2 );
137 assert( num_indexes == 0 );
138 assert( num_chars == 0 );
141 obj_create(vtbl,instance_data,obj);
142 vi_obj = (
struct RTOp_value_value_type*)*obj;
143 vi_obj->value1 = value_data[0];
144 vi_obj->value2 = value_data[1];
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)