Add local argument to serial interface to enable serial interface to create local parameters if needed (for example for serial binary)
This commit is contained in:
1 parent
b6d5b5462b
commit
05a68157bc
10 files changed
+147
-106
No files matched your search
@@ -419,15 +419,16 @@ namespace m_tuple {
|
||||
static const char *const field_name[] = \
|
||||
{ M_REDUCE(TUPLE_STRINGIFY_NAME, M_ID, __VA_ARGS__) }; \
|
||||
int index = 0; \
|
||||
m_serial_local_t local; \
|
||||
m_serial_return_code_t ret; \
|
||||
ret = f->interface->write_tuple_start(f); \
|
||||
ret = f->interface->write_tuple_start(local, f); \
|
||||
M_MAP(TUPLE_DEFINE_OUT_SERIAL_FUNC , __VA_ARGS__) \
|
||||
assert( index == field_max); \
|
||||
ret |= f->interface->write_tuple_end(f); \
|
||||
ret |= f->interface->write_tuple_end(local, f); \
|
||||
return ret & M_SERIAL_FAIL; \
|
||||
}
|
||||
#define TUPLE_DEFINE_OUT_SERIAL_FUNC(a) \
|
||||
f->interface->write_tuple_id(f, field_name, field_max, index); \
|
||||
f->interface->write_tuple_id(local, f, field_name, field_max, index); \
|
||||
TUPLE_CALL_OUT_SERIAL(a, f, el -> TUPLE_GET_FIELD a); \
|
||||
index++; \
|
||||
|
||||
@@ -439,10 +440,11 @@ namespace m_tuple {
|
||||
const int field_max = M_NARGS(__VA_ARGS__); \
|
||||
static const char *const field_name[] = \
|
||||
{ M_REDUCE(TUPLE_STRINGIFY_NAME, M_ID, __VA_ARGS__) }; \
|
||||
m_serial_local_t local; \
|
||||
m_serial_return_code_t ret; \
|
||||
ret = f->interface->read_tuple_start(f); \
|
||||
ret = f->interface->read_tuple_start(local, f); \
|
||||
while (ret == M_SERIAL_OK_CONTINUE) { \
|
||||
ret = f->interface->read_tuple_id(f, field_name, field_max, &index); \
|
||||
ret = f->interface->read_tuple_id(local, f, field_name, field_max, &index); \
|
||||
if (ret == M_SERIAL_OK_CONTINUE) { \
|
||||
assert (index >= 0 && index < field_max); \
|
||||
switch (1+index) { \
|
||||
|
||||
Reference in new issue
Block a user