Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • anders_blomdell/labcomm
  • klaren/labcomm
  • tommyo/labcomm
  • erikj/labcomm
  • sven/labcomm
5 results
Show changes
Showing
with 0 additions and 4241 deletions
#include "labcomm.h"
#include "labcomm_private.h"
#include "gen/c/simple.h"
static unsigned char signature_bytes_an_int[] = {
0, 0, 0, 35,
};
labcomm_signature_t labcomm_signature_simple_an_int = {
LABCOMM_SAMPLE, "an_int",
(int (*)(void *))labcomm_sizeof_simple_an_int,
sizeof(signature_bytes_an_int),
signature_bytes_an_int
};
static unsigned char signature_bytes_a_fixed_int_array[] = {
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
0, 0, 0, 35,
// }
};
labcomm_signature_t labcomm_signature_simple_a_fixed_int_array = {
LABCOMM_SAMPLE, "a_fixed_int_array",
(int (*)(void *))labcomm_sizeof_simple_a_fixed_int_array,
sizeof(signature_bytes_a_fixed_int_array),
signature_bytes_a_fixed_int_array
};
static unsigned char signature_bytes_a_fixed_int_multi_array[] = {
// array [2, 2, 2]
0, 0, 0, 16,
0, 0, 0, 3,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 35,
// }
};
labcomm_signature_t labcomm_signature_simple_a_fixed_int_multi_array = {
LABCOMM_SAMPLE, "a_fixed_int_multi_array",
(int (*)(void *))labcomm_sizeof_simple_a_fixed_int_multi_array,
sizeof(signature_bytes_a_fixed_int_multi_array),
signature_bytes_a_fixed_int_multi_array
};
static unsigned char signature_bytes_a_fixed_int_array_array_array[] = {
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
0, 0, 0, 35,
// }
// }
// }
};
labcomm_signature_t labcomm_signature_simple_a_fixed_int_array_array_array = {
LABCOMM_SAMPLE, "a_fixed_int_array_array_array",
(int (*)(void *))labcomm_sizeof_simple_a_fixed_int_array_array_array,
sizeof(signature_bytes_a_fixed_int_array_array_array),
signature_bytes_a_fixed_int_array_array_array
};
static unsigned char signature_bytes_a_variable_int_array[] = {
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
0, 0, 0, 35,
// }
};
labcomm_signature_t labcomm_signature_simple_a_variable_int_array = {
LABCOMM_SAMPLE, "a_variable_int_array",
(int (*)(void *))labcomm_sizeof_simple_a_variable_int_array,
sizeof(signature_bytes_a_variable_int_array),
signature_bytes_a_variable_int_array
};
static unsigned char signature_bytes_a_variable_int_multi_array[] = {
// array [_, _, _]
0, 0, 0, 16,
0, 0, 0, 3,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 35,
// }
};
labcomm_signature_t labcomm_signature_simple_a_variable_int_multi_array = {
LABCOMM_SAMPLE, "a_variable_int_multi_array",
(int (*)(void *))labcomm_sizeof_simple_a_variable_int_multi_array,
sizeof(signature_bytes_a_variable_int_multi_array),
signature_bytes_a_variable_int_multi_array
};
static unsigned char signature_bytes_a_variable_int_array_array_array[] = {
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
0, 0, 0, 35,
// }
// }
// }
};
labcomm_signature_t labcomm_signature_simple_a_variable_int_array_array_array = {
LABCOMM_SAMPLE, "a_variable_int_array_array_array",
(int (*)(void *))labcomm_sizeof_simple_a_variable_int_array_array_array,
sizeof(signature_bytes_a_variable_int_array_array_array),
signature_bytes_a_variable_int_array_array_array
};
static unsigned char signature_bytes_an_int_struct[] = {
// struct { 2 fields
0, 0, 0, 17,
0, 0, 0, 2,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// int 'b'
0, 0, 0, 1,
98,
0, 0, 0, 35,
// }
};
labcomm_signature_t labcomm_signature_simple_an_int_struct = {
LABCOMM_SAMPLE, "an_int_struct",
(int (*)(void *))labcomm_sizeof_simple_an_int_struct,
sizeof(signature_bytes_an_int_struct),
signature_bytes_an_int_struct
};
static unsigned char signature_bytes_a_void[] = {
// void
0, 0, 0, 17,
0, 0, 0, 0,
};
labcomm_signature_t labcomm_signature_simple_a_void = {
LABCOMM_SAMPLE, "a_void",
(int (*)(void *))labcomm_sizeof_simple_a_void,
sizeof(signature_bytes_a_void),
signature_bytes_a_void
};
static void decode_an_int(
labcomm_decoder_t *d,
void (*handle)(
simple_an_int *v,
void *context
),
void *context
)
{
simple_an_int v;
v = labcomm_decode_int(d);
handle(&v, context);
}
void labcomm_decoder_register_simple_an_int(
struct labcomm_decoder *d,
void (*handler)(
simple_an_int *v,
void *context
),
void *context
)
{
labcomm_internal_decoder_register(
d,
&labcomm_signature_simple_an_int,
(labcomm_decoder_typecast_t)decode_an_int,
(labcomm_handler_typecast_t)handler,
context
);
}
static void encode_an_int(
labcomm_encoder_t *e,
simple_an_int *v
)
{
e->writer.write(&e->writer, labcomm_writer_start);
labcomm_encode_type_index(e, &labcomm_signature_simple_an_int);
{
labcomm_encode_int(e, (*v));
}
e->writer.write(&e->writer, labcomm_writer_end);
}
void labcomm_encode_simple_an_int(
labcomm_encoder_t *e,
simple_an_int *v
)
{
labcomm_internal_encode(e, &labcomm_signature_simple_an_int, v);
}
void labcomm_encoder_register_simple_an_int(
struct labcomm_encoder *e
)
{
labcomm_internal_encoder_register(
e,
&labcomm_signature_simple_an_int,
(labcomm_encode_typecast_t)encode_an_int
);
}
int labcomm_sizeof_simple_an_int(simple_an_int *v)
{
return 8;
}
static void decode_a_fixed_int_array(
labcomm_decoder_t *d,
void (*handle)(
simple_a_fixed_int_array *v,
void *context
),
void *context
)
{
simple_a_fixed_int_array v;
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < 2 ; i_0_0++) {
v.a[i_0_0] = labcomm_decode_int(d);
}
}
handle(&v, context);
}
void labcomm_decoder_register_simple_a_fixed_int_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_fixed_int_array *v,
void *context
),
void *context
)
{
labcomm_internal_decoder_register(
d,
&labcomm_signature_simple_a_fixed_int_array,
(labcomm_decoder_typecast_t)decode_a_fixed_int_array,
(labcomm_handler_typecast_t)handler,
context
);
}
static void encode_a_fixed_int_array(
labcomm_encoder_t *e,
simple_a_fixed_int_array *v
)
{
e->writer.write(&e->writer, labcomm_writer_start);
labcomm_encode_type_index(e, &labcomm_signature_simple_a_fixed_int_array);
{
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < 2 ; i_0_0++) {
labcomm_encode_int(e, (*v).a[i_0_0]);
}
}
}
e->writer.write(&e->writer, labcomm_writer_end);
}
void labcomm_encode_simple_a_fixed_int_array(
labcomm_encoder_t *e,
simple_a_fixed_int_array *v
)
{
labcomm_internal_encode(e, &labcomm_signature_simple_a_fixed_int_array, v);
}
void labcomm_encoder_register_simple_a_fixed_int_array(
struct labcomm_encoder *e
)
{
labcomm_internal_encoder_register(
e,
&labcomm_signature_simple_a_fixed_int_array,
(labcomm_encode_typecast_t)encode_a_fixed_int_array
);
}
int labcomm_sizeof_simple_a_fixed_int_array(simple_a_fixed_int_array *v)
{
return 12;
}
static void decode_a_fixed_int_multi_array(
labcomm_decoder_t *d,
void (*handle)(
simple_a_fixed_int_multi_array *v,
void *context
),
void *context
)
{
simple_a_fixed_int_multi_array v;
{
int i_0_0;
int i_0_1;
int i_0_2;
for (i_0_0 = 0 ; i_0_0 < 2 ; i_0_0++) {
for (i_0_1 = 0 ; i_0_1 < 2 ; i_0_1++) {
for (i_0_2 = 0 ; i_0_2 < 2 ; i_0_2++) {
v.a[i_0_0][i_0_1][i_0_2] = labcomm_decode_int(d);
}
}
}
}
handle(&v, context);
}
void labcomm_decoder_register_simple_a_fixed_int_multi_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_fixed_int_multi_array *v,
void *context
),
void *context
)
{
labcomm_internal_decoder_register(
d,
&labcomm_signature_simple_a_fixed_int_multi_array,
(labcomm_decoder_typecast_t)decode_a_fixed_int_multi_array,
(labcomm_handler_typecast_t)handler,
context
);
}
static void encode_a_fixed_int_multi_array(
labcomm_encoder_t *e,
simple_a_fixed_int_multi_array *v
)
{
e->writer.write(&e->writer, labcomm_writer_start);
labcomm_encode_type_index(e, &labcomm_signature_simple_a_fixed_int_multi_array);
{
{
int i_0_0;
int i_0_1;
int i_0_2;
for (i_0_0 = 0 ; i_0_0 < 2 ; i_0_0++) {
for (i_0_1 = 0 ; i_0_1 < 2 ; i_0_1++) {
for (i_0_2 = 0 ; i_0_2 < 2 ; i_0_2++) {
labcomm_encode_int(e, (*v).a[i_0_0][i_0_1][i_0_2]);
}
}
}
}
}
e->writer.write(&e->writer, labcomm_writer_end);
}
void labcomm_encode_simple_a_fixed_int_multi_array(
labcomm_encoder_t *e,
simple_a_fixed_int_multi_array *v
)
{
labcomm_internal_encode(e, &labcomm_signature_simple_a_fixed_int_multi_array, v);
}
void labcomm_encoder_register_simple_a_fixed_int_multi_array(
struct labcomm_encoder *e
)
{
labcomm_internal_encoder_register(
e,
&labcomm_signature_simple_a_fixed_int_multi_array,
(labcomm_encode_typecast_t)encode_a_fixed_int_multi_array
);
}
int labcomm_sizeof_simple_a_fixed_int_multi_array(simple_a_fixed_int_multi_array *v)
{
return 36;
}
static void decode_a_fixed_int_array_array_array(
labcomm_decoder_t *d,
void (*handle)(
simple_a_fixed_int_array_array_array *v,
void *context
),
void *context
)
{
simple_a_fixed_int_array_array_array v;
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < 2 ; i_0_0++) {
{
int i_1_0;
for (i_1_0 = 0 ; i_1_0 < 2 ; i_1_0++) {
{
int i_2_0;
for (i_2_0 = 0 ; i_2_0 < 2 ; i_2_0++) {
v.a[i_0_0].a[i_1_0].a[i_2_0] = labcomm_decode_int(d);
}
}
}
}
}
}
handle(&v, context);
}
void labcomm_decoder_register_simple_a_fixed_int_array_array_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_fixed_int_array_array_array *v,
void *context
),
void *context
)
{
labcomm_internal_decoder_register(
d,
&labcomm_signature_simple_a_fixed_int_array_array_array,
(labcomm_decoder_typecast_t)decode_a_fixed_int_array_array_array,
(labcomm_handler_typecast_t)handler,
context
);
}
static void encode_a_fixed_int_array_array_array(
labcomm_encoder_t *e,
simple_a_fixed_int_array_array_array *v
)
{
e->writer.write(&e->writer, labcomm_writer_start);
labcomm_encode_type_index(e, &labcomm_signature_simple_a_fixed_int_array_array_array);
{
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < 2 ; i_0_0++) {
{
int i_1_0;
for (i_1_0 = 0 ; i_1_0 < 2 ; i_1_0++) {
{
int i_2_0;
for (i_2_0 = 0 ; i_2_0 < 2 ; i_2_0++) {
labcomm_encode_int(e, (*v).a[i_0_0].a[i_1_0].a[i_2_0]);
}
}
}
}
}
}
}
e->writer.write(&e->writer, labcomm_writer_end);
}
void labcomm_encode_simple_a_fixed_int_array_array_array(
labcomm_encoder_t *e,
simple_a_fixed_int_array_array_array *v
)
{
labcomm_internal_encode(e, &labcomm_signature_simple_a_fixed_int_array_array_array, v);
}
void labcomm_encoder_register_simple_a_fixed_int_array_array_array(
struct labcomm_encoder *e
)
{
labcomm_internal_encoder_register(
e,
&labcomm_signature_simple_a_fixed_int_array_array_array,
(labcomm_encode_typecast_t)encode_a_fixed_int_array_array_array
);
}
int labcomm_sizeof_simple_a_fixed_int_array_array_array(simple_a_fixed_int_array_array_array *v)
{
return 36;
}
static void decode_a_variable_int_array(
labcomm_decoder_t *d,
void (*handle)(
simple_a_variable_int_array *v,
void *context
),
void *context
)
{
simple_a_variable_int_array v;
v.n_0 = labcomm_decode_int(d);
v.a = malloc(sizeof(v.a[0]) * v.n_0);
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < v.n_0 ; i_0_0++) {
int i_0 = i_0_0;
v.a[i_0] = labcomm_decode_int(d);
}
}
handle(&v, context);
{
free(v.a);
}
}
void labcomm_decoder_register_simple_a_variable_int_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_variable_int_array *v,
void *context
),
void *context
)
{
labcomm_internal_decoder_register(
d,
&labcomm_signature_simple_a_variable_int_array,
(labcomm_decoder_typecast_t)decode_a_variable_int_array,
(labcomm_handler_typecast_t)handler,
context
);
}
static void encode_a_variable_int_array(
labcomm_encoder_t *e,
simple_a_variable_int_array *v
)
{
e->writer.write(&e->writer, labcomm_writer_start);
labcomm_encode_type_index(e, &labcomm_signature_simple_a_variable_int_array);
{
labcomm_encode_int(e, (*v).n_0);
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < (*v).n_0 ; i_0_0++) {
int i_0 = i_0_0;
labcomm_encode_int(e, (*v).a[i_0]);
}
}
}
e->writer.write(&e->writer, labcomm_writer_end);
}
void labcomm_encode_simple_a_variable_int_array(
labcomm_encoder_t *e,
simple_a_variable_int_array *v
)
{
labcomm_internal_encode(e, &labcomm_signature_simple_a_variable_int_array, v);
}
void labcomm_encoder_register_simple_a_variable_int_array(
struct labcomm_encoder *e
)
{
labcomm_internal_encoder_register(
e,
&labcomm_signature_simple_a_variable_int_array,
(labcomm_encode_typecast_t)encode_a_variable_int_array
);
}
int labcomm_sizeof_simple_a_variable_int_array(simple_a_variable_int_array *v)
{
int result = 4;
result += 4 * (*v).n_0;
return result;
}
static void decode_a_variable_int_multi_array(
labcomm_decoder_t *d,
void (*handle)(
simple_a_variable_int_multi_array *v,
void *context
),
void *context
)
{
simple_a_variable_int_multi_array v;
v.n_0 = labcomm_decode_int(d);
v.n_1 = labcomm_decode_int(d);
v.n_2 = labcomm_decode_int(d);
v.a = malloc(sizeof(v.a[0]) * v.n_0 * v.n_1 * v.n_2);
{
int i_0_0;
int i_0_1;
int i_0_2;
for (i_0_0 = 0 ; i_0_0 < v.n_0 ; i_0_0++) {
for (i_0_1 = 0 ; i_0_1 < v.n_1 ; i_0_1++) {
for (i_0_2 = 0 ; i_0_2 < v.n_2 ; i_0_2++) {
int i_0 = ((i_0_0) * v.n_1 + i_0_1) * v.n_2 + i_0_2;
v.a[i_0] = labcomm_decode_int(d);
}
}
}
}
handle(&v, context);
{
free(v.a);
}
}
void labcomm_decoder_register_simple_a_variable_int_multi_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_variable_int_multi_array *v,
void *context
),
void *context
)
{
labcomm_internal_decoder_register(
d,
&labcomm_signature_simple_a_variable_int_multi_array,
(labcomm_decoder_typecast_t)decode_a_variable_int_multi_array,
(labcomm_handler_typecast_t)handler,
context
);
}
static void encode_a_variable_int_multi_array(
labcomm_encoder_t *e,
simple_a_variable_int_multi_array *v
)
{
e->writer.write(&e->writer, labcomm_writer_start);
labcomm_encode_type_index(e, &labcomm_signature_simple_a_variable_int_multi_array);
{
labcomm_encode_int(e, (*v).n_0);
labcomm_encode_int(e, (*v).n_1);
labcomm_encode_int(e, (*v).n_2);
{
int i_0_0;
int i_0_1;
int i_0_2;
for (i_0_0 = 0 ; i_0_0 < (*v).n_0 ; i_0_0++) {
for (i_0_1 = 0 ; i_0_1 < (*v).n_1 ; i_0_1++) {
for (i_0_2 = 0 ; i_0_2 < (*v).n_2 ; i_0_2++) {
int i_0 = ((i_0_0) * (*v).n_1 + i_0_1) * (*v).n_2 + i_0_2;
labcomm_encode_int(e, (*v).a[i_0]);
}
}
}
}
}
e->writer.write(&e->writer, labcomm_writer_end);
}
void labcomm_encode_simple_a_variable_int_multi_array(
labcomm_encoder_t *e,
simple_a_variable_int_multi_array *v
)
{
labcomm_internal_encode(e, &labcomm_signature_simple_a_variable_int_multi_array, v);
}
void labcomm_encoder_register_simple_a_variable_int_multi_array(
struct labcomm_encoder *e
)
{
labcomm_internal_encoder_register(
e,
&labcomm_signature_simple_a_variable_int_multi_array,
(labcomm_encode_typecast_t)encode_a_variable_int_multi_array
);
}
int labcomm_sizeof_simple_a_variable_int_multi_array(simple_a_variable_int_multi_array *v)
{
int result = 4;
result += 4 * (*v).n_0 * (*v).n_1 * (*v).n_2;
return result;
}
static void decode_a_variable_int_array_array_array(
labcomm_decoder_t *d,
void (*handle)(
simple_a_variable_int_array_array_array *v,
void *context
),
void *context
)
{
simple_a_variable_int_array_array_array v;
v.n_0 = labcomm_decode_int(d);
v.a = malloc(sizeof(v.a[0]) * v.n_0);
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < v.n_0 ; i_0_0++) {
int i_0 = i_0_0;
v.a[i_0].n_0 = labcomm_decode_int(d);
v.a[i_0].a = malloc(sizeof(v.a[i_0].a[0]) * v.a[i_0].n_0);
{
int i_1_0;
for (i_1_0 = 0 ; i_1_0 < v.a[i_0].n_0 ; i_1_0++) {
int i_1 = i_1_0;
v.a[i_0].a[i_1].n_0 = labcomm_decode_int(d);
v.a[i_0].a[i_1].a = malloc(sizeof(v.a[i_0].a[i_1].a[0]) * v.a[i_0].a[i_1].n_0);
{
int i_2_0;
for (i_2_0 = 0 ; i_2_0 < v.a[i_0].a[i_1].n_0 ; i_2_0++) {
int i_2 = i_2_0;
v.a[i_0].a[i_1].a[i_2] = labcomm_decode_int(d);
}
}
}
}
}
}
handle(&v, context);
{
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < v.n_0 ; i_0_0++) {
int i_0 = i_0_0;
{
int i_1_0;
for (i_1_0 = 0 ; i_1_0 < v.a[i_0].n_0 ; i_1_0++) {
int i_1 = i_1_0;
free(v.a[i_0].a[i_1].a);
}
}
free(v.a[i_0].a);
}
}
free(v.a);
}
}
void labcomm_decoder_register_simple_a_variable_int_array_array_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_variable_int_array_array_array *v,
void *context
),
void *context
)
{
labcomm_internal_decoder_register(
d,
&labcomm_signature_simple_a_variable_int_array_array_array,
(labcomm_decoder_typecast_t)decode_a_variable_int_array_array_array,
(labcomm_handler_typecast_t)handler,
context
);
}
static void encode_a_variable_int_array_array_array(
labcomm_encoder_t *e,
simple_a_variable_int_array_array_array *v
)
{
e->writer.write(&e->writer, labcomm_writer_start);
labcomm_encode_type_index(e, &labcomm_signature_simple_a_variable_int_array_array_array);
{
labcomm_encode_int(e, (*v).n_0);
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < (*v).n_0 ; i_0_0++) {
int i_0 = i_0_0;
labcomm_encode_int(e, (*v).a[i_0].n_0);
{
int i_1_0;
for (i_1_0 = 0 ; i_1_0 < (*v).a[i_0].n_0 ; i_1_0++) {
int i_1 = i_1_0;
labcomm_encode_int(e, (*v).a[i_0].a[i_1].n_0);
{
int i_2_0;
for (i_2_0 = 0 ; i_2_0 < (*v).a[i_0].a[i_1].n_0 ; i_2_0++) {
int i_2 = i_2_0;
labcomm_encode_int(e, (*v).a[i_0].a[i_1].a[i_2]);
}
}
}
}
}
}
}
e->writer.write(&e->writer, labcomm_writer_end);
}
void labcomm_encode_simple_a_variable_int_array_array_array(
labcomm_encoder_t *e,
simple_a_variable_int_array_array_array *v
)
{
labcomm_internal_encode(e, &labcomm_signature_simple_a_variable_int_array_array_array, v);
}
void labcomm_encoder_register_simple_a_variable_int_array_array_array(
struct labcomm_encoder *e
)
{
labcomm_internal_encoder_register(
e,
&labcomm_signature_simple_a_variable_int_array_array_array,
(labcomm_encode_typecast_t)encode_a_variable_int_array_array_array
);
}
int labcomm_sizeof_simple_a_variable_int_array_array_array(simple_a_variable_int_array_array_array *v)
{
int result = 4;
{
int i_0_0;
for (i_0_0 = 0 ; i_0_0 < (*v).n_0 ; i_0_0++) {
int i_0 = i_0_0;
{
int i_1_0;
for (i_1_0 = 0 ; i_1_0 < (*v).a[i_0].n_0 ; i_1_0++) {
int i_1 = i_1_0;
result += 4 * (*v).a[i_0].a[i_1].n_0;
}
}
}
}
return result;
}
static void decode_an_int_struct(
labcomm_decoder_t *d,
void (*handle)(
simple_an_int_struct *v,
void *context
),
void *context
)
{
simple_an_int_struct v;
v.a = labcomm_decode_int(d);
v.b = labcomm_decode_int(d);
handle(&v, context);
}
void labcomm_decoder_register_simple_an_int_struct(
struct labcomm_decoder *d,
void (*handler)(
simple_an_int_struct *v,
void *context
),
void *context
)
{
labcomm_internal_decoder_register(
d,
&labcomm_signature_simple_an_int_struct,
(labcomm_decoder_typecast_t)decode_an_int_struct,
(labcomm_handler_typecast_t)handler,
context
);
}
static void encode_an_int_struct(
labcomm_encoder_t *e,
simple_an_int_struct *v
)
{
e->writer.write(&e->writer, labcomm_writer_start);
labcomm_encode_type_index(e, &labcomm_signature_simple_an_int_struct);
{
labcomm_encode_int(e, (*v).a);
labcomm_encode_int(e, (*v).b);
}
e->writer.write(&e->writer, labcomm_writer_end);
}
void labcomm_encode_simple_an_int_struct(
labcomm_encoder_t *e,
simple_an_int_struct *v
)
{
labcomm_internal_encode(e, &labcomm_signature_simple_an_int_struct, v);
}
void labcomm_encoder_register_simple_an_int_struct(
struct labcomm_encoder *e
)
{
labcomm_internal_encoder_register(
e,
&labcomm_signature_simple_an_int_struct,
(labcomm_encode_typecast_t)encode_an_int_struct
);
}
int labcomm_sizeof_simple_an_int_struct(simple_an_int_struct *v)
{
return 12;
}
static void decode_a_void(
labcomm_decoder_t *d,
void (*handle)(
simple_a_void *v,
void *context
),
void *context
)
{
simple_a_void v;
handle(&v, context);
}
void labcomm_decoder_register_simple_a_void(
struct labcomm_decoder *d,
void (*handler)(
simple_a_void *v,
void *context
),
void *context
)
{
labcomm_internal_decoder_register(
d,
&labcomm_signature_simple_a_void,
(labcomm_decoder_typecast_t)decode_a_void,
(labcomm_handler_typecast_t)handler,
context
);
}
static void encode_a_void(
labcomm_encoder_t *e,
simple_a_void *v
)
{
e->writer.write(&e->writer, labcomm_writer_start);
labcomm_encode_type_index(e, &labcomm_signature_simple_a_void);
{
}
e->writer.write(&e->writer, labcomm_writer_end);
}
void labcomm_encode_simple_a_void(
labcomm_encoder_t *e,
simple_a_void *v
)
{
labcomm_internal_encode(e, &labcomm_signature_simple_a_void, v);
}
void labcomm_encoder_register_simple_a_void(
struct labcomm_encoder *e
)
{
labcomm_internal_encoder_register(
e,
&labcomm_signature_simple_a_void,
(labcomm_encode_typecast_t)encode_a_void
);
}
int labcomm_sizeof_simple_a_void(simple_a_void *v)
{
return 4;
}
/* LabComm declarations:
sample int an_int;
sample int a_fixed_int_array[2];
sample int a_fixed_int_multi_array[2, 2, 2];
sample int a_fixed_int_array_array_array[2][2][2];
sample int a_variable_int_array[_];
sample int a_variable_int_multi_array[_, _, _];
sample int a_variable_int_array_array_array[_][_][_];
sample struct {
int a;
int b;
} an_int_struct;
sample void a_void;
*/
#ifndef __LABCOMM_simple_H__
#define __LABCOMM_simple_H__
#include "labcomm.h"
#ifndef PREDEFINED_simple_an_int
typedef int simple_an_int;
#endif
void labcomm_decoder_register_simple_an_int(
struct labcomm_decoder *d,
void (*handler)(
simple_an_int *v,
void *context
),
void *context
);
void labcomm_encoder_register_simple_an_int(
struct labcomm_encoder *e);
void labcomm_encode_simple_an_int(
struct labcomm_encoder *e,
simple_an_int *v
);
extern int labcomm_sizeof_simple_an_int(simple_an_int *v);
#ifndef PREDEFINED_simple_a_fixed_int_array
typedef struct {
int a[2];
} simple_a_fixed_int_array;
#endif
void labcomm_decoder_register_simple_a_fixed_int_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_fixed_int_array *v,
void *context
),
void *context
);
void labcomm_encoder_register_simple_a_fixed_int_array(
struct labcomm_encoder *e);
void labcomm_encode_simple_a_fixed_int_array(
struct labcomm_encoder *e,
simple_a_fixed_int_array *v
);
extern int labcomm_sizeof_simple_a_fixed_int_array(simple_a_fixed_int_array *v);
#ifndef PREDEFINED_simple_a_fixed_int_multi_array
typedef struct {
int a[2][2][2];
} simple_a_fixed_int_multi_array;
#endif
void labcomm_decoder_register_simple_a_fixed_int_multi_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_fixed_int_multi_array *v,
void *context
),
void *context
);
void labcomm_encoder_register_simple_a_fixed_int_multi_array(
struct labcomm_encoder *e);
void labcomm_encode_simple_a_fixed_int_multi_array(
struct labcomm_encoder *e,
simple_a_fixed_int_multi_array *v
);
extern int labcomm_sizeof_simple_a_fixed_int_multi_array(simple_a_fixed_int_multi_array *v);
#ifndef PREDEFINED_simple_a_fixed_int_array_array_array
typedef struct {
struct {
struct {
int a[2];
} a[2];
} a[2];
} simple_a_fixed_int_array_array_array;
#endif
void labcomm_decoder_register_simple_a_fixed_int_array_array_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_fixed_int_array_array_array *v,
void *context
),
void *context
);
void labcomm_encoder_register_simple_a_fixed_int_array_array_array(
struct labcomm_encoder *e);
void labcomm_encode_simple_a_fixed_int_array_array_array(
struct labcomm_encoder *e,
simple_a_fixed_int_array_array_array *v
);
extern int labcomm_sizeof_simple_a_fixed_int_array_array_array(simple_a_fixed_int_array_array_array *v);
#ifndef PREDEFINED_simple_a_variable_int_array
typedef struct {
int n_0;
int *a;
} simple_a_variable_int_array;
#endif
void labcomm_decoder_register_simple_a_variable_int_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_variable_int_array *v,
void *context
),
void *context
);
void labcomm_encoder_register_simple_a_variable_int_array(
struct labcomm_encoder *e);
void labcomm_encode_simple_a_variable_int_array(
struct labcomm_encoder *e,
simple_a_variable_int_array *v
);
extern int labcomm_sizeof_simple_a_variable_int_array(simple_a_variable_int_array *v);
#ifndef PREDEFINED_simple_a_variable_int_multi_array
typedef struct {
int n_0;
int n_1;
int n_2;
int *a;
} simple_a_variable_int_multi_array;
#endif
void labcomm_decoder_register_simple_a_variable_int_multi_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_variable_int_multi_array *v,
void *context
),
void *context
);
void labcomm_encoder_register_simple_a_variable_int_multi_array(
struct labcomm_encoder *e);
void labcomm_encode_simple_a_variable_int_multi_array(
struct labcomm_encoder *e,
simple_a_variable_int_multi_array *v
);
extern int labcomm_sizeof_simple_a_variable_int_multi_array(simple_a_variable_int_multi_array *v);
#ifndef PREDEFINED_simple_a_variable_int_array_array_array
typedef struct {
int n_0;
struct {
int n_0;
struct {
int n_0;
int *a;
} *a;
} *a;
} simple_a_variable_int_array_array_array;
#endif
void labcomm_decoder_register_simple_a_variable_int_array_array_array(
struct labcomm_decoder *d,
void (*handler)(
simple_a_variable_int_array_array_array *v,
void *context
),
void *context
);
void labcomm_encoder_register_simple_a_variable_int_array_array_array(
struct labcomm_encoder *e);
void labcomm_encode_simple_a_variable_int_array_array_array(
struct labcomm_encoder *e,
simple_a_variable_int_array_array_array *v
);
extern int labcomm_sizeof_simple_a_variable_int_array_array_array(simple_a_variable_int_array_array_array *v);
#ifndef PREDEFINED_simple_an_int_struct
typedef struct {
int a;
int b;
} simple_an_int_struct;
#endif
void labcomm_decoder_register_simple_an_int_struct(
struct labcomm_decoder *d,
void (*handler)(
simple_an_int_struct *v,
void *context
),
void *context
);
void labcomm_encoder_register_simple_an_int_struct(
struct labcomm_encoder *e);
void labcomm_encode_simple_an_int_struct(
struct labcomm_encoder *e,
simple_an_int_struct *v
);
extern int labcomm_sizeof_simple_an_int_struct(simple_an_int_struct *v);
#ifndef PREDEFINED_simple_a_void
typedef char simple_a_void;
#endif
void labcomm_decoder_register_simple_a_void(
struct labcomm_decoder *d,
void (*handler)(
simple_a_void *v,
void *context
),
void *context
);
void labcomm_encoder_register_simple_a_void(
struct labcomm_encoder *e);
void labcomm_encode_simple_a_void(
struct labcomm_encoder *e,
simple_a_void *v
);
extern int labcomm_sizeof_simple_a_void(simple_a_void *v);
#define LABCOMM_FORALL_SAMPLES_simple(func, sep) \
func(an_int, simple_an_int) sep \
func(a_fixed_int_array, simple_a_fixed_int_array) sep \
func(a_fixed_int_multi_array, simple_a_fixed_int_multi_array) sep \
func(a_fixed_int_array_array_array, simple_a_fixed_int_array_array_array) sep \
func(a_variable_int_array, simple_a_variable_int_array) sep \
func(a_variable_int_multi_array, simple_a_variable_int_multi_array) sep \
func(a_variable_int_array_array_array, simple_a_variable_int_array_array_array) sep \
func(an_int_struct, simple_an_int_struct) sep \
func(a_void, simple_a_void)
#endif
using System;
using se.lth.control.labcomm;
/*
sample struct {
int aa;
boolean bb;
int_array_ss ias;
} struct_array_ss[1][_][_];
*/
public class struct_array_ss : LabCommSample {
public int aa;
public boolean bb;
public int[][,,][] ias;
public interface Handler : LabCommHandler {
void handle(struct_array_ss[][][] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(struct_array_ss);
}
public String getName() {
return "struct_array_ss";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(struct_array_ss.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_array_ss[][][] value) {
e.begin(typeof(struct_array_ss));
int i_0_max = 1;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0].GetLength(0));
int i_1_max = value[i_0].GetLength(0);
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
e.encodeInt(value[i_0][i_1].GetLength(0));
int i_2_max = value[i_0][i_1].GetLength(0);
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
e.encodeInt(value[i_0][i_1][i_2].aa);
e.encodeBoolean(value[i_0][i_1][i_2].bb);
int i_3_max = 1;
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
e.encodeInt(value[i_0][i_1][i_2].ias[i_3].GetLength(0));
int i_4_max = value[i_0][i_1][i_2].ias[i_3].GetLength(0);
int i_5_max = 3;
e.encodeInt(value[i_0][i_1][i_2].ias[i_3].GetLength(2));
int i_6_max = value[i_0][i_1][i_2].ias[i_3].GetLength(2);
for (int i_4 = 0 ; i_4 < i_4_max ; i_4++) {
for (int i_5 = 0 ; i_5 < i_5_max ; i_5++) {
for (int i_6 = 0 ; i_6 < i_6_max ; i_6++) {
int i_7_max = 5;
for (int i_7 = 0 ; i_7 < i_7_max ; i_7++) {
e.encodeInt(value[i_0][i_1][i_2].ias[i_3][i_4, i_5, i_6][i_7]);
}
}
}
}
}
}
}
}
e.end(typeof(struct_array_ss));
}
public static struct_array_ss[][][] decode(LabCommDecoder d) {
struct_array_ss[][][] result;
{
int i_0_max = 1;
result = new struct_array_ss[i_0_max]
[][];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
{
int i_1_max = d.decodeInt();
result[i_0] = new struct_array_ss[i_1_max]
[];
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
{
int i_2_max = d.decodeInt();
result[i_0][i_1] = new struct_array_ss[i_2_max]
;
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
result[i_0][i_1][i_2] = new struct_array_ss();
result[i_0][i_1][i_2].aa = d.decodeInt();
result[i_0][i_1][i_2].bb = d.decodeBoolean();
{
int i_3_max = 1;
result[i_0][i_1][i_2].ias = new int[i_3_max]
[][,,];
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
{
int i_4_max = d.decodeInt();
int i_5_max = 3;
int i_6_max = d.decodeInt();
result[i_0][i_1][i_2].ias[i_3] = new int[i_4_max, i_5_max, i_6_max]
[];
for (int i_4 = 0 ; i_4 < i_4_max ; i_4++) {
for (int i_5 = 0 ; i_5 < i_5_max ; i_5++) {
for (int i_6 = 0 ; i_6 < i_6_max ; i_6++) {
{
int i_7_max = 5;
result[i_0][i_1][i_2].ias[i_3][i_4, i_5, i_6] = new int[i_7_max]
;
for (int i_7 = 0 ; i_7 < i_7_max ; i_7++) {
result[i_0][i_1][i_2].ias[i_3][i_4, i_5, i_6][i_7] = d.decodeInt();
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [1]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 1,
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
// struct { 3 fields
0, 0, 0, 17,
0, 0, 0, 3,
// int 'aa'
0, 0, 0, 2,
97, 97,
0, 0, 0, 35,
// boolean 'bb'
0, 0, 0, 2,
98, 98,
0, 0, 0, 32,
// int_array_ss 'ias'
0, 0, 0, 3,
105, 97, 115,
// array [1]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 1,
// array [_, 3, _]
0, 0, 0, 16,
0, 0, 0, 3,
0, 0, 0, 0,
0, 0, 0, 3,
0, 0, 0, 0,
// array [5]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 5,
0, 0, 0, 35,
// }
// }
// }
// }
// }
// }
// }
};
}
/*
typedef struct {
int a;
} struct_t;
*/
public class struct_t : LabCommType {
public int a;
public static void encode(LabCommEncoder e, struct_t value) {
e.encodeInt(value.a);
}
public static struct_t decode(LabCommDecoder d) {
struct_t result;
result = new struct_t();
result.a = d.decodeInt();
return result;
}
}
/*
typedef struct {
int a;
} struct_array_t[2];
*/
public class struct_array_t : LabCommType {
public int a;
public static void encode(LabCommEncoder e, struct_array_t[] value) {
int i_0_max = 2;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0].a);
}
}
public static struct_array_t[] decode(LabCommDecoder d) {
struct_array_t[] result;
{
int i_0_max = 2;
result = new struct_array_t[i_0_max]
;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
result[i_0] = new struct_array_t();
result[i_0].a = d.decodeInt();
}
}
return result;
}
}
/*
typedef struct {
struct {
int a;
} a;
} struct_struct_t;
*/
public class struct_struct_t : LabCommType {
public static class struct_a {
public int a;
}
public struct_a a;
public static void encode(LabCommEncoder e, struct_struct_t value) {
e.encodeInt(value.a.a);
}
public static struct_struct_t decode(LabCommDecoder d) {
struct_struct_t result;
result = new struct_struct_t();
result.a = new struct_a();
result.a.a = d.decodeInt();
return result;
}
}
/*
sample int int_s;
*/
public class int_s : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(int_s);
}
public String getName() {
return "int_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(int_s.decode(d));
}
}
public static void encode(LabCommEncoder e, int value) {
e.begin(typeof(int_s));
e.encodeInt(value);
e.end(typeof(int_s));
}
public static int decode(LabCommDecoder d) {
int result;
result = d.decodeInt();
return result;
}
private static byte[] signature = new byte[] {
0, 0, 0, 35,
};
}
/*
sample int int_array_s[1][_, 3, _][5];
*/
public class int_array_s : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int[][,,][] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(int_array_s);
}
public String getName() {
return "int_array_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(int_array_s.decode(d));
}
}
public static void encode(LabCommEncoder e, int[][,,][] value) {
e.begin(typeof(int_array_s));
int i_0_max = 1;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0].GetLength(0));
int i_1_max = value[i_0].GetLength(0);
int i_2_max = 3;
e.encodeInt(value[i_0].GetLength(2));
int i_3_max = value[i_0].GetLength(2);
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
int i_4_max = 5;
for (int i_4 = 0 ; i_4 < i_4_max ; i_4++) {
e.encodeInt(value[i_0][i_1, i_2, i_3][i_4]);
}
}
}
}
}
e.end(typeof(int_array_s));
}
public static int[][,,][] decode(LabCommDecoder d) {
int[][,,][] result;
{
int i_0_max = 1;
result = new int[i_0_max]
[][,,];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
{
int i_1_max = d.decodeInt();
int i_2_max = 3;
int i_3_max = d.decodeInt();
result[i_0] = new int[i_1_max, i_2_max, i_3_max]
[];
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
{
int i_4_max = 5;
result[i_0][i_1, i_2, i_3] = new int[i_4_max]
;
for (int i_4 = 0 ; i_4 < i_4_max ; i_4++) {
result[i_0][i_1, i_2, i_3][i_4] = d.decodeInt();
}
}
}
}
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [1]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 1,
// array [_, 3, _]
0, 0, 0, 16,
0, 0, 0, 3,
0, 0, 0, 0,
0, 0, 0, 3,
0, 0, 0, 0,
// array [5]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 5,
0, 0, 0, 35,
// }
// }
// }
};
}
/*
sample struct {
int a;
double bcd;
} struct_s;
*/
public class struct_s : LabCommSample {
public int a;
public double bcd;
public interface Handler : LabCommHandler {
void handle(struct_s value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(struct_s);
}
public String getName() {
return "struct_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(struct_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_s value) {
e.begin(typeof(struct_s));
e.encodeInt(value.a);
e.encodeDouble(value.bcd);
e.end(typeof(struct_s));
}
public static struct_s decode(LabCommDecoder d) {
struct_s result;
result = new struct_s();
result.a = d.decodeInt();
result.bcd = d.decodeDouble();
return result;
}
private static byte[] signature = new byte[] {
// struct { 2 fields
0, 0, 0, 17,
0, 0, 0, 2,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// double 'bcd'
0, 0, 0, 3,
98, 99, 100,
0, 0, 0, 38,
// }
};
}
/*
sample struct {
int a;
} struct_array_s[2];
*/
public class struct_array_s : LabCommSample {
public int a;
public interface Handler : LabCommHandler {
void handle(struct_array_s[] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(struct_array_s);
}
public String getName() {
return "struct_array_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(struct_array_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_array_s[] value) {
e.begin(typeof(struct_array_s));
int i_0_max = 2;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0].a);
}
e.end(typeof(struct_array_s));
}
public static struct_array_s[] decode(LabCommDecoder d) {
struct_array_s[] result;
{
int i_0_max = 2;
result = new struct_array_s[i_0_max]
;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
result[i_0] = new struct_array_s();
result[i_0].a = d.decodeInt();
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
// }
};
}
/*
sample struct {
struct {
int a;
} a;
} struct_struct_s;
*/
public class struct_struct_s : LabCommSample {
public static class struct_a {
public int a;
}
public struct_a a;
public interface Handler : LabCommHandler {
void handle(struct_struct_s value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(struct_struct_s);
}
public String getName() {
return "struct_struct_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(struct_struct_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_struct_s value) {
e.begin(typeof(struct_struct_s));
e.encodeInt(value.a.a);
e.end(typeof(struct_struct_s));
}
public static struct_struct_s decode(LabCommDecoder d) {
struct_struct_s result;
result = new struct_struct_s();
result.a = new struct_a();
result.a.a = d.decodeInt();
return result;
}
private static byte[] signature = new byte[] {
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// struct 'a'
0, 0, 0, 1,
97,
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
// }
};
}
/*
sample int_t int_t_s;
*/
public class int_t_s : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(int_t_s);
}
public String getName() {
return "int_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(int_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, int value) {
e.begin(typeof(int_t_s));
e.encodeInt(value);
e.end(typeof(int_t_s));
}
public static int decode(LabCommDecoder d) {
int result;
result = d.decodeInt();
return result;
}
private static byte[] signature = new byte[] {
0, 0, 0, 35,
};
}
/*
sample int_array_t int_array_t_s;
*/
public class int_array_t_s : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int[,][][] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(int_array_t_s);
}
public String getName() {
return "int_array_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(int_array_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, int[,][][] value) {
e.begin(typeof(int_array_t_s));
int i_0_max = 1;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
int i_1_max = 2;
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
int i_2_max = 3;
int i_3_max = 4;
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
e.encodeInt(value[i_0][i_1][i_2, i_3]);
}
}
}
}
e.end(typeof(int_array_t_s));
}
public static int[,][][] decode(LabCommDecoder d) {
int[,][][] result;
{
int i_0_max = 1;
result = new int[i_0_max]
[,][];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
{
int i_1_max = 2;
result[i_0] = new int[i_1_max]
[,];
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
{
int i_2_max = 3;
int i_3_max = 4;
result[i_0][i_1] = new int[i_2_max, i_3_max]
;
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
result[i_0][i_1][i_2, i_3] = d.decodeInt();
}
}
}
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [1]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 1,
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// array [3, 4]
0, 0, 0, 16,
0, 0, 0, 2,
0, 0, 0, 3,
0, 0, 0, 4,
0, 0, 0, 35,
// }
// }
// }
};
}
/*
sample struct_t struct_t_s;
*/
public class struct_t_s : LabCommSample {
public interface Handler : LabCommHandler {
void handle(struct_t value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(struct_t_s);
}
public String getName() {
return "struct_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(struct_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_t value) {
e.begin(typeof(struct_t_s));
struct_t.encode(e, value);
e.end(typeof(struct_t_s));
}
public static struct_t decode(LabCommDecoder d) {
struct_t result;
result = struct_t.decode(d);
return result;
}
private static byte[] signature = new byte[] {
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
};
}
/*
sample struct_array_t struct_array_t_s;
*/
public class struct_array_t_s : LabCommSample {
public interface Handler : LabCommHandler {
void handle(struct_array_t[] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(struct_array_t_s);
}
public String getName() {
return "struct_array_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(struct_array_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_array_t[] value) {
e.begin(typeof(struct_array_t_s));
struct_array_t.encode(e, value);
e.end(typeof(struct_array_t_s));
}
public static struct_array_t[] decode(LabCommDecoder d) {
struct_array_t[] result;
result = struct_array_t.decode(d);
return result;
}
private static byte[] signature = new byte[] {
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
// }
};
}
/*
sample struct_struct_t struct_struct_t_s;
*/
public class struct_struct_t_s : LabCommSample {
public interface Handler : LabCommHandler {
void handle(struct_struct_t value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(struct_struct_t_s);
}
public String getName() {
return "struct_struct_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(struct_struct_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_struct_t value) {
e.begin(typeof(struct_struct_t_s));
struct_struct_t.encode(e, value);
e.end(typeof(struct_struct_t_s));
}
public static struct_struct_t decode(LabCommDecoder d) {
struct_struct_t result;
result = struct_struct_t.decode(d);
return result;
}
private static byte[] signature = new byte[] {
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// struct 'a'
0, 0, 0, 1,
97,
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
// }
};
}
using System;
using se.lth.control.labcomm;
/*
sample int an_int;
*/
public class an_int : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(an_int);
}
public String getName() {
return "an_int";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(an_int.decode(d));
}
}
public static void encode(LabCommEncoder e, int value) {
e.begin(typeof(an_int));
e.encodeInt(value);
e.end(typeof(an_int));
}
public static int decode(LabCommDecoder d) {
int result;
result = d.decodeInt();
return result;
}
private static byte[] signature = new byte[] {
0, 0, 0, 35,
};
}
/*
sample int a_fixed_int_array[2];
*/
public class a_fixed_int_array : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int[] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(a_fixed_int_array);
}
public String getName() {
return "a_fixed_int_array";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(a_fixed_int_array.decode(d));
}
}
public static void encode(LabCommEncoder e, int[] value) {
e.begin(typeof(a_fixed_int_array));
int i_0_max = 2;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0]);
}
e.end(typeof(a_fixed_int_array));
}
public static int[] decode(LabCommDecoder d) {
int[] result;
{
int i_0_max = 2;
result = new int[i_0_max]
;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
result[i_0] = d.decodeInt();
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
0, 0, 0, 35,
// }
};
}
/*
sample int a_fixed_int_multi_array[2, 2, 2];
*/
public class a_fixed_int_multi_array : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int[,,] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(a_fixed_int_multi_array);
}
public String getName() {
return "a_fixed_int_multi_array";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(a_fixed_int_multi_array.decode(d));
}
}
public static void encode(LabCommEncoder e, int[,,] value) {
e.begin(typeof(a_fixed_int_multi_array));
int i_0_max = 2;
int i_1_max = 2;
int i_2_max = 2;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
e.encodeInt(value[i_0, i_1, i_2]);
}
}
}
e.end(typeof(a_fixed_int_multi_array));
}
public static int[,,] decode(LabCommDecoder d) {
int[,,] result;
{
int i_0_max = 2;
int i_1_max = 2;
int i_2_max = 2;
result = new int[i_0_max, i_1_max, i_2_max]
;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
result[i_0, i_1, i_2] = d.decodeInt();
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [2, 2, 2]
0, 0, 0, 16,
0, 0, 0, 3,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 35,
// }
};
}
/*
sample int a_fixed_int_array_array_array[2][2][2];
*/
public class a_fixed_int_array_array_array : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int[][][] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(a_fixed_int_array_array_array);
}
public String getName() {
return "a_fixed_int_array_array_array";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(a_fixed_int_array_array_array.decode(d));
}
}
public static void encode(LabCommEncoder e, int[][][] value) {
e.begin(typeof(a_fixed_int_array_array_array));
int i_0_max = 2;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
int i_1_max = 2;
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
int i_2_max = 2;
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
e.encodeInt(value[i_0][i_1][i_2]);
}
}
}
e.end(typeof(a_fixed_int_array_array_array));
}
public static int[][][] decode(LabCommDecoder d) {
int[][][] result;
{
int i_0_max = 2;
result = new int[i_0_max]
[][];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
{
int i_1_max = 2;
result[i_0] = new int[i_1_max]
[];
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
{
int i_2_max = 2;
result[i_0][i_1] = new int[i_2_max]
;
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
result[i_0][i_1][i_2] = d.decodeInt();
}
}
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
0, 0, 0, 35,
// }
// }
// }
};
}
/*
sample int a_variable_int_array[_];
*/
public class a_variable_int_array : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int[] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(a_variable_int_array);
}
public String getName() {
return "a_variable_int_array";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(a_variable_int_array.decode(d));
}
}
public static void encode(LabCommEncoder e, int[] value) {
e.begin(typeof(a_variable_int_array));
e.encodeInt(value.GetLength(0));
int i_0_max = value.GetLength(0);
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0]);
}
e.end(typeof(a_variable_int_array));
}
public static int[] decode(LabCommDecoder d) {
int[] result;
{
int i_0_max = d.decodeInt();
result = new int[i_0_max]
;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
result[i_0] = d.decodeInt();
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
0, 0, 0, 35,
// }
};
}
/*
sample int a_variable_int_multi_array[_, _, _];
*/
public class a_variable_int_multi_array : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int[,,] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(a_variable_int_multi_array);
}
public String getName() {
return "a_variable_int_multi_array";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(a_variable_int_multi_array.decode(d));
}
}
public static void encode(LabCommEncoder e, int[,,] value) {
e.begin(typeof(a_variable_int_multi_array));
e.encodeInt(value.GetLength(0));
int i_0_max = value.GetLength(0);
e.encodeInt(value.GetLength(1));
int i_1_max = value.GetLength(1);
e.encodeInt(value.GetLength(2));
int i_2_max = value.GetLength(2);
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
e.encodeInt(value[i_0, i_1, i_2]);
}
}
}
e.end(typeof(a_variable_int_multi_array));
}
public static int[,,] decode(LabCommDecoder d) {
int[,,] result;
{
int i_0_max = d.decodeInt();
int i_1_max = d.decodeInt();
int i_2_max = d.decodeInt();
result = new int[i_0_max, i_1_max, i_2_max]
;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
result[i_0, i_1, i_2] = d.decodeInt();
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [_, _, _]
0, 0, 0, 16,
0, 0, 0, 3,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 35,
// }
};
}
/*
sample int a_variable_int_array_array_array[_][_][_];
*/
public class a_variable_int_array_array_array : LabCommSample {
public interface Handler : LabCommHandler {
void handle(int[][][] value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(a_variable_int_array_array_array);
}
public String getName() {
return "a_variable_int_array_array_array";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(a_variable_int_array_array_array.decode(d));
}
}
public static void encode(LabCommEncoder e, int[][][] value) {
e.begin(typeof(a_variable_int_array_array_array));
e.encodeInt(value.GetLength(0));
int i_0_max = value.GetLength(0);
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0].GetLength(0));
int i_1_max = value[i_0].GetLength(0);
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
e.encodeInt(value[i_0][i_1].GetLength(0));
int i_2_max = value[i_0][i_1].GetLength(0);
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
e.encodeInt(value[i_0][i_1][i_2]);
}
}
}
e.end(typeof(a_variable_int_array_array_array));
}
public static int[][][] decode(LabCommDecoder d) {
int[][][] result;
{
int i_0_max = d.decodeInt();
result = new int[i_0_max]
[][];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
{
int i_1_max = d.decodeInt();
result[i_0] = new int[i_1_max]
[];
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
{
int i_2_max = d.decodeInt();
result[i_0][i_1] = new int[i_2_max]
;
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
result[i_0][i_1][i_2] = d.decodeInt();
}
}
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
0, 0, 0, 35,
// }
// }
// }
};
}
/*
sample struct {
int a;
int b;
} an_int_struct;
*/
public class an_int_struct : LabCommSample {
public int a;
public int b;
public interface Handler : LabCommHandler {
void handle(an_int_struct value);
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(an_int_struct);
}
public String getName() {
return "an_int_struct";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
((Handler)h).handle(an_int_struct.decode(d));
}
}
public static void encode(LabCommEncoder e, an_int_struct value) {
e.begin(typeof(an_int_struct));
e.encodeInt(value.a);
e.encodeInt(value.b);
e.end(typeof(an_int_struct));
}
public static an_int_struct decode(LabCommDecoder d) {
an_int_struct result;
result = new an_int_struct();
result.a = d.decodeInt();
result.b = d.decodeInt();
return result;
}
private static byte[] signature = new byte[] {
// struct { 2 fields
0, 0, 0, 17,
0, 0, 0, 2,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// int 'b'
0, 0, 0, 1,
98,
0, 0, 0, 35,
// }
};
}
/*
sample void a_void;
*/
public class a_void : LabCommSample {
public interface Handler : LabCommHandler {
void handle();
}
public static void register(LabCommDecoder d, Handler h) {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) {
e.register(new Dispatcher());
}
private class Dispatcher : LabCommDispatcher {
public Type getSampleClass() {
return typeof(a_void);
}
public String getName() {
return "a_void";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d, LabCommHandler h) {
a_void.decode(d);
((Handler)h).handle();
}
}
public static void encode(LabCommEncoder e) {
e.begin(typeof(a_void));
e.end(typeof(a_void));
}
public static void decode(LabCommDecoder d) {
}
private static byte[] signature = new byte[] {
// void
0, 0, 0, 17,
0, 0, 0, 0,
};
}
using System;
using System.IO;
using se.lth.control.labcomm;
class x :
struct_array_ss.Handler,
int_s.Handler,
int_array_s.Handler,
struct_s.Handler,
struct_array_s.Handler,
struct_struct_s.Handler,
int_t_s.Handler,
int_array_t_s.Handler,
struct_t_s.Handler,
struct_array_t_s.Handler,
struct_struct_t_s.Handler
{
LabCommEncoderChannel encoder;
void struct_array_ss.Handler.handle(struct_array_ss[][][] data) {
Console.Error.WriteLine("struct_array_ss");
struct_array_ss.encode(encoder, data);
}
void int_s.Handler.handle(int data) {
Console.Error.WriteLine("int_s");
int_s.encode(encoder, data);
}
void int_array_s.Handler.handle(int[][,,][] data) {
Console.Error.WriteLine("int_array_s");
int_array_s.encode(encoder, data);
}
void struct_s.Handler.handle(struct_s data) {
Console.Error.WriteLine("struct_s");
struct_s.encode(encoder, data);
}
void struct_array_s.Handler.handle(struct_array_s[] data) {
Console.Error.WriteLine("struct_array_s");
struct_array_s.encode(encoder, data);
}
void struct_struct_s.Handler.handle(struct_struct_s data) {
Console.Error.WriteLine("struct_struct_s");
struct_struct_s.encode(encoder, data);
}
void int_t_s.Handler.handle(int data) {
Console.Error.WriteLine("int_t_s");
int_t_s.encode(encoder, data);
}
void int_array_t_s.Handler.handle(int[,][][] data) {
Console.Error.WriteLine("int_array_t_s");
int_array_t_s.encode(encoder, data);
}
void struct_t_s.Handler.handle(struct_t data) {
Console.Error.WriteLine("struct_t_s");
struct_t_s.encode(encoder, data);
}
void struct_array_t_s.Handler.handle(struct_array_t[] data) {
Console.Error.WriteLine("struct_array_t_s");
struct_array_t_s.encode(encoder, data);
}
void struct_struct_t_s.Handler.handle(struct_struct_t data) {
Console.Error.WriteLine("struct_struct_t_s");
struct_struct_t_s.encode(encoder, data);
}
public x(String InName, String OutName) {
FileStream InFile = new FileStream(InName,
FileMode.Open,
FileAccess.Read);
LabCommDecoderChannel d = new LabCommDecoderChannel(InFile);
FileStream OutFile = new FileStream(OutName,
FileMode.OpenOrCreate,
FileAccess.Write);
encoder = new LabCommEncoderChannel(OutFile);
struct_array_ss.register(d, this);
int_s.register(d, this);
int_array_s.register(d, this);
struct_s.register(d, this);
struct_array_s.register(d, this);
struct_struct_s.register(d, this);
int_t_s.register(d, this);
int_array_t_s.register(d, this);
struct_t_s.register(d, this);
struct_array_t_s.register(d, this);
struct_struct_t_s.register(d, this);
struct_array_ss.register(encoder);
int_s.register(encoder);
int_array_s.register(encoder);
struct_s.register(encoder);
struct_array_s.register(encoder);
struct_struct_s.register(encoder);
int_t_s.register(encoder);
int_array_t_s.register(encoder);
struct_t_s.register(encoder);
struct_array_t_s.register(encoder);
struct_struct_t_s.register(encoder);
try {
d.run();
} catch (EndOfStreamException) {
}
}
static void Main(String[] arg) {
new x(arg[0], arg[1]);
}
}
using System;
using System.IO;
using se.lth.control.labcomm;
class x :
an_int.Handler,
a_fixed_int_array.Handler,
a_fixed_int_multi_array.Handler,
a_fixed_int_array_array_array.Handler,
a_variable_int_array.Handler,
a_variable_int_multi_array.Handler,
a_variable_int_array_array_array.Handler,
an_int_struct.Handler,
a_void.Handler
{
LabCommEncoderChannel encoder;
void an_int.Handler.handle(int data) {
Console.Error.WriteLine("an_int");
an_int.encode(encoder, data);
}
void a_fixed_int_array.Handler.handle(int[] data) {
Console.Error.WriteLine("a_fixed_int_array");
a_fixed_int_array.encode(encoder, data);
}
void a_fixed_int_multi_array.Handler.handle(int[,,] data) {
Console.Error.WriteLine("a_fixed_int_multi_array");
a_fixed_int_multi_array.encode(encoder, data);
}
void a_fixed_int_array_array_array.Handler.handle(int[][][] data) {
Console.Error.WriteLine("a_fixed_int_array_array_array");
a_fixed_int_array_array_array.encode(encoder, data);
}
void a_variable_int_array.Handler.handle(int[] data) {
Console.Error.WriteLine("a_variable_int_array");
a_variable_int_array.encode(encoder, data);
}
void a_variable_int_multi_array.Handler.handle(int[,,] data) {
Console.Error.WriteLine("a_variable_int_multi_array");
a_variable_int_multi_array.encode(encoder, data);
}
void a_variable_int_array_array_array.Handler.handle(int[][][] data) {
Console.Error.WriteLine("a_variable_int_array_array_array");
a_variable_int_array_array_array.encode(encoder, data);
}
void an_int_struct.Handler.handle(an_int_struct data) {
Console.Error.WriteLine("an_int_struct");
an_int_struct.encode(encoder, data);
}
void a_void.Handler.handle() {
Console.Error.WriteLine("a_void");
a_void.encode(encoder);
}
public x(String InName, String OutName) {
FileStream InFile = new FileStream(InName,
FileMode.Open,
FileAccess.Read);
LabCommDecoderChannel d = new LabCommDecoderChannel(InFile);
FileStream OutFile = new FileStream(OutName,
FileMode.OpenOrCreate,
FileAccess.Write);
encoder = new LabCommEncoderChannel(OutFile);
an_int.register(d, this);
a_fixed_int_array.register(d, this);
a_fixed_int_multi_array.register(d, this);
a_fixed_int_array_array_array.register(d, this);
a_variable_int_array.register(d, this);
a_variable_int_multi_array.register(d, this);
a_variable_int_array_array_array.register(d, this);
an_int_struct.register(d, this);
a_void.register(d, this);
an_int.register(encoder);
a_fixed_int_array.register(encoder);
a_fixed_int_multi_array.register(encoder);
a_fixed_int_array_array_array.register(encoder);
a_variable_int_array.register(encoder);
a_variable_int_multi_array.register(encoder);
a_variable_int_array_array_array.register(encoder);
an_int_struct.register(encoder);
a_void.register(encoder);
try {
d.run();
} catch (EndOfStreamException) {
}
}
static void Main(String[] arg) {
new x(arg[0], arg[1]);
}
}
/*
sample int int_array_s[1][_, 3, _][5];
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class int_array_s implements LabCommSample {
public interface Handler extends LabCommHandler {
public void handle_int_array_s(int[][][][][] value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return int_array_s.class;
}
public String getName() {
return "int_array_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_int_array_s(int_array_s.decode(d));
}
}
public static void encode(LabCommEncoder e, int[][][][][] value) throws IOException {
e.begin(int_array_s.class);
int i_0_max = 1;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0].length);
int i_1_max = value[i_0].length;
int i_2_max = 3;
e.encodeInt(value[i_0][0][0].length);
int i_3_max = value[i_0][0][0].length;
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
int i_4_max = 5;
for (int i_4 = 0 ; i_4 < i_4_max ; i_4++) {
e.encodeInt(value[i_0][i_1][i_2][i_3][i_4]);
}
}
}
}
}
e.end(int_array_s.class);
}
public static int[][][][][] decode(LabCommDecoder d) throws IOException {
int[][][][][] result;
{
int i_0_max = 1;
result = new int[i_0_max][][][][];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
{
int i_1_max = d.decodeInt();
int i_2_max = 3;
int i_3_max = d.decodeInt();
result[i_0] = new int[i_1_max][][][];
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
result[i_0][i_1] = new int[i_2_max][][];
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
result[i_0][i_1][i_2] = new int[i_3_max][];
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
{
int i_4_max = 5;
result[i_0][i_1][i_2][i_3] = new int[i_4_max];
for (int i_4 = 0 ; i_4 < i_4_max ; i_4++) {
result[i_0][i_1][i_2][i_3][i_4] = d.decodeInt();
}
}
}
}
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [1]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 1,
// array [_, 3, _]
0, 0, 0, 16,
0, 0, 0, 3,
0, 0, 0, 0,
0, 0, 0, 3,
0, 0, 0, 0,
// array [5]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 5,
0, 0, 0, 35,
// }
// }
// }
};
}
/*
sample int_array_t int_array_t_s;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class int_array_t_s implements LabCommSample {
public interface Handler extends LabCommHandler {
public void handle_int_array_t_s(int[][][][] value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return int_array_t_s.class;
}
public String getName() {
return "int_array_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_int_array_t_s(int_array_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, int[][][][] value) throws IOException {
e.begin(int_array_t_s.class);
int i_0_max = 1;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
int i_1_max = 2;
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
int i_2_max = 3;
int i_3_max = 4;
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
e.encodeInt(value[i_0][i_1][i_2][i_3]);
}
}
}
}
e.end(int_array_t_s.class);
}
public static int[][][][] decode(LabCommDecoder d) throws IOException {
int[][][][] result;
{
int i_0_max = 1;
result = new int[i_0_max][][][];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
{
int i_1_max = 2;
result[i_0] = new int[i_1_max][][];
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
{
int i_2_max = 3;
int i_3_max = 4;
result[i_0][i_1] = new int[i_2_max][];
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
result[i_0][i_1][i_2] = new int[i_3_max];
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
result[i_0][i_1][i_2][i_3] = d.decodeInt();
}
}
}
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [1]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 1,
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// array [3, 4]
0, 0, 0, 16,
0, 0, 0, 2,
0, 0, 0, 3,
0, 0, 0, 4,
0, 0, 0, 35,
// }
// }
// }
};
}
/*
sample int int_s;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class int_s implements LabCommSample {
public interface Handler extends LabCommHandler {
public void handle_int_s(int value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return int_s.class;
}
public String getName() {
return "int_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_int_s(int_s.decode(d));
}
}
public static void encode(LabCommEncoder e, int value) throws IOException {
e.begin(int_s.class);
e.encodeInt(value);
e.end(int_s.class);
}
public static int decode(LabCommDecoder d) throws IOException {
int result;
result = d.decodeInt();
return result;
}
private static byte[] signature = new byte[] {
0, 0, 0, 35,
};
}
/*
sample int_t int_t_s;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class int_t_s implements LabCommSample {
public interface Handler extends LabCommHandler {
public void handle_int_t_s(int value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return int_t_s.class;
}
public String getName() {
return "int_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_int_t_s(int_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, int value) throws IOException {
e.begin(int_t_s.class);
e.encodeInt(value);
e.end(int_t_s.class);
}
public static int decode(LabCommDecoder d) throws IOException {
int result;
result = d.decodeInt();
return result;
}
private static byte[] signature = new byte[] {
0, 0, 0, 35,
};
}
/*
sample struct {
int a;
} struct_array_s[2];
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class struct_array_s implements LabCommSample {
public int a;
public interface Handler extends LabCommHandler {
public void handle_struct_array_s(struct_array_s[] value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return struct_array_s.class;
}
public String getName() {
return "struct_array_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_struct_array_s(struct_array_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_array_s[] value) throws IOException {
e.begin(struct_array_s.class);
int i_0_max = 2;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0].a);
}
e.end(struct_array_s.class);
}
public static struct_array_s[] decode(LabCommDecoder d) throws IOException {
struct_array_s[] result;
{
int i_0_max = 2;
result = new struct_array_s[i_0_max];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
result[i_0] = new struct_array_s();
result[i_0].a = d.decodeInt();
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
// }
};
}
/*
sample struct {
int aa;
boolean bb;
int_array_ss ias;
} struct_array_ss[1][_][_];
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class struct_array_ss implements LabCommSample {
public int aa;
public boolean bb;
public int[][][][][] ias;
public interface Handler extends LabCommHandler {
public void handle_struct_array_ss(struct_array_ss[][][] value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return struct_array_ss.class;
}
public String getName() {
return "struct_array_ss";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_struct_array_ss(struct_array_ss.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_array_ss[][][] value) throws IOException {
e.begin(struct_array_ss.class);
int i_0_max = 1;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0].length);
int i_1_max = value[i_0].length;
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
e.encodeInt(value[i_0][i_1].length);
int i_2_max = value[i_0][i_1].length;
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
e.encodeInt(value[i_0][i_1][i_2].aa);
e.encodeBoolean(value[i_0][i_1][i_2].bb);
int i_3_max = 1;
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
e.encodeInt(value[i_0][i_1][i_2].ias[i_3].length);
int i_4_max = value[i_0][i_1][i_2].ias[i_3].length;
int i_5_max = 3;
e.encodeInt(value[i_0][i_1][i_2].ias[i_3][0][0].length);
int i_6_max = value[i_0][i_1][i_2].ias[i_3][0][0].length;
for (int i_4 = 0 ; i_4 < i_4_max ; i_4++) {
for (int i_5 = 0 ; i_5 < i_5_max ; i_5++) {
for (int i_6 = 0 ; i_6 < i_6_max ; i_6++) {
int i_7_max = 5;
for (int i_7 = 0 ; i_7 < i_7_max ; i_7++) {
e.encodeInt(value[i_0][i_1][i_2].ias[i_3][i_4][i_5][i_6][i_7]);
}
}
}
}
}
}
}
}
e.end(struct_array_ss.class);
}
public static struct_array_ss[][][] decode(LabCommDecoder d) throws IOException {
struct_array_ss[][][] result;
{
int i_0_max = 1;
result = new struct_array_ss[i_0_max][][];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
{
int i_1_max = d.decodeInt();
result[i_0] = new struct_array_ss[i_1_max][];
for (int i_1 = 0 ; i_1 < i_1_max ; i_1++) {
{
int i_2_max = d.decodeInt();
result[i_0][i_1] = new struct_array_ss[i_2_max];
for (int i_2 = 0 ; i_2 < i_2_max ; i_2++) {
result[i_0][i_1][i_2] = new struct_array_ss();
result[i_0][i_1][i_2].aa = d.decodeInt();
result[i_0][i_1][i_2].bb = d.decodeBoolean();
{
int i_3_max = 1;
result[i_0][i_1][i_2].ias = new int[i_3_max][][][][];
for (int i_3 = 0 ; i_3 < i_3_max ; i_3++) {
{
int i_4_max = d.decodeInt();
int i_5_max = 3;
int i_6_max = d.decodeInt();
result[i_0][i_1][i_2].ias[i_3] = new int[i_4_max][][][];
for (int i_4 = 0 ; i_4 < i_4_max ; i_4++) {
result[i_0][i_1][i_2].ias[i_3][i_4] = new int[i_5_max][][];
for (int i_5 = 0 ; i_5 < i_5_max ; i_5++) {
result[i_0][i_1][i_2].ias[i_3][i_4][i_5] = new int[i_6_max][];
for (int i_6 = 0 ; i_6 < i_6_max ; i_6++) {
{
int i_7_max = 5;
result[i_0][i_1][i_2].ias[i_3][i_4][i_5][i_6] = new int[i_7_max];
for (int i_7 = 0 ; i_7 < i_7_max ; i_7++) {
result[i_0][i_1][i_2].ias[i_3][i_4][i_5][i_6][i_7] = d.decodeInt();
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return result;
}
private static byte[] signature = new byte[] {
// array [1]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 1,
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
// array [_]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 0,
// struct { 3 fields
0, 0, 0, 17,
0, 0, 0, 3,
// int 'aa'
0, 0, 0, 2,
97, 97,
0, 0, 0, 35,
// boolean 'bb'
0, 0, 0, 2,
98, 98,
0, 0, 0, 32,
// int_array_ss 'ias'
0, 0, 0, 3,
105, 97, 115,
// array [1]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 1,
// array [_, 3, _]
0, 0, 0, 16,
0, 0, 0, 3,
0, 0, 0, 0,
0, 0, 0, 3,
0, 0, 0, 0,
// array [5]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 5,
0, 0, 0, 35,
// }
// }
// }
// }
// }
// }
// }
};
}
/*
typedef struct {
int a;
} struct_array_t[2];
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommType;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommDecoder;
public class struct_array_t implements LabCommType {
public int a;
public static void encode(LabCommEncoder e, struct_array_t[] value) throws IOException {
int i_0_max = 2;
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
e.encodeInt(value[i_0].a);
}
}
public static struct_array_t[] decode(LabCommDecoder d) throws IOException {
struct_array_t[] result;
{
int i_0_max = 2;
result = new struct_array_t[i_0_max];
for (int i_0 = 0 ; i_0 < i_0_max ; i_0++) {
result[i_0] = new struct_array_t();
result[i_0].a = d.decodeInt();
}
}
return result;
}
}
/*
sample struct_array_t struct_array_t_s;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class struct_array_t_s implements LabCommSample {
public interface Handler extends LabCommHandler {
public void handle_struct_array_t_s(struct_array_t[] value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return struct_array_t_s.class;
}
public String getName() {
return "struct_array_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_struct_array_t_s(struct_array_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_array_t[] value) throws IOException {
e.begin(struct_array_t_s.class);
struct_array_t.encode(e, value);
e.end(struct_array_t_s.class);
}
public static struct_array_t[] decode(LabCommDecoder d) throws IOException {
struct_array_t[] result;
result = struct_array_t.decode(d);
return result;
}
private static byte[] signature = new byte[] {
// array [2]
0, 0, 0, 16,
0, 0, 0, 1,
0, 0, 0, 2,
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
// }
};
}
/*
sample struct {
int a;
double bcd;
} struct_s;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class struct_s implements LabCommSample {
public int a;
public double bcd;
public interface Handler extends LabCommHandler {
public void handle_struct_s(struct_s value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return struct_s.class;
}
public String getName() {
return "struct_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_struct_s(struct_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_s value) throws IOException {
e.begin(struct_s.class);
e.encodeInt(value.a);
e.encodeDouble(value.bcd);
e.end(struct_s.class);
}
public static struct_s decode(LabCommDecoder d) throws IOException {
struct_s result;
result = new struct_s();
result.a = d.decodeInt();
result.bcd = d.decodeDouble();
return result;
}
private static byte[] signature = new byte[] {
// struct { 2 fields
0, 0, 0, 17,
0, 0, 0, 2,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// double 'bcd'
0, 0, 0, 3,
98, 99, 100,
0, 0, 0, 38,
// }
};
}
/*
sample struct {
struct {
int a;
} a;
} struct_struct_s;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class struct_struct_s implements LabCommSample {
public static class struct_a {
public int a;
}
public struct_a a;
public interface Handler extends LabCommHandler {
public void handle_struct_struct_s(struct_struct_s value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return struct_struct_s.class;
}
public String getName() {
return "struct_struct_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_struct_struct_s(struct_struct_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_struct_s value) throws IOException {
e.begin(struct_struct_s.class);
e.encodeInt(value.a.a);
e.end(struct_struct_s.class);
}
public static struct_struct_s decode(LabCommDecoder d) throws IOException {
struct_struct_s result;
result = new struct_struct_s();
result.a = new struct_a();
result.a.a = d.decodeInt();
return result;
}
private static byte[] signature = new byte[] {
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// struct 'a'
0, 0, 0, 1,
97,
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
// }
};
}
/*
typedef struct {
struct {
int a;
} a;
} struct_struct_t;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommType;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommDecoder;
public class struct_struct_t implements LabCommType {
public static class struct_a {
public int a;
}
public struct_a a;
public static void encode(LabCommEncoder e, struct_struct_t value) throws IOException {
e.encodeInt(value.a.a);
}
public static struct_struct_t decode(LabCommDecoder d) throws IOException {
struct_struct_t result;
result = new struct_struct_t();
result.a = new struct_a();
result.a.a = d.decodeInt();
return result;
}
}
/*
sample struct_struct_t struct_struct_t_s;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class struct_struct_t_s implements LabCommSample {
public interface Handler extends LabCommHandler {
public void handle_struct_struct_t_s(struct_struct_t value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return struct_struct_t_s.class;
}
public String getName() {
return "struct_struct_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_struct_struct_t_s(struct_struct_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_struct_t value) throws IOException {
e.begin(struct_struct_t_s.class);
struct_struct_t.encode(e, value);
e.end(struct_struct_t_s.class);
}
public static struct_struct_t decode(LabCommDecoder d) throws IOException {
struct_struct_t result;
result = struct_struct_t.decode(d);
return result;
}
private static byte[] signature = new byte[] {
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// struct 'a'
0, 0, 0, 1,
97,
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
// }
};
}
/*
typedef struct {
int a;
} struct_t;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommType;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommDecoder;
public class struct_t implements LabCommType {
public int a;
public static void encode(LabCommEncoder e, struct_t value) throws IOException {
e.encodeInt(value.a);
}
public static struct_t decode(LabCommDecoder d) throws IOException {
struct_t result;
result = new struct_t();
result.a = d.decodeInt();
return result;
}
}
/*
sample struct_t struct_t_s;
*/
import java.io.IOException;
import se.lth.control.labcomm.LabCommDecoder;
import se.lth.control.labcomm.LabCommDispatcher;
import se.lth.control.labcomm.LabCommEncoder;
import se.lth.control.labcomm.LabCommHandler;
import se.lth.control.labcomm.LabCommSample;
public class struct_t_s implements LabCommSample {
public interface Handler extends LabCommHandler {
public void handle_struct_t_s(struct_t value) throws Exception;
}
public static void register(LabCommDecoder d, Handler h) throws IOException {
d.register(new Dispatcher(), h);
}
public static void register(LabCommEncoder e) throws IOException {
e.register(new Dispatcher());
}
private static class Dispatcher implements LabCommDispatcher {
public Class getSampleClass() {
return struct_t_s.class;
}
public String getName() {
return "struct_t_s";
}
public byte[] getSignature() {
return signature;
}
public void decodeAndHandle(LabCommDecoder d,
LabCommHandler h) throws Exception {
((Handler)h).handle_struct_t_s(struct_t_s.decode(d));
}
}
public static void encode(LabCommEncoder e, struct_t value) throws IOException {
e.begin(struct_t_s.class);
struct_t.encode(e, value);
e.end(struct_t_s.class);
}
public static struct_t decode(LabCommDecoder d) throws IOException {
struct_t result;
result = struct_t.decode(d);
return result;
}
private static byte[] signature = new byte[] {
// struct { 1 fields
0, 0, 0, 17,
0, 0, 0, 1,
// int 'a'
0, 0, 0, 1,
97,
0, 0, 0, 35,
// }
};
}