[PATCH 2.3.1 3/5] QPID: Add support for Vector Bool and Vector Char field types.


Alireza Assadzadeh <Alireza.Assadzadeh@...>
 

Signed-off-by: Alireza Assadzadeh <Alireza.Assadzadeh@solacesystems.com>
---
mama/c_cpp/src/c/payload/qpidmsg/field.c | 12 +++++++++++-
mama/c_cpp/src/c/payload/qpidmsg/payload.c | 20 ++++++++++++++++++--
2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/mama/c_cpp/src/c/payload/qpidmsg/field.c b/mama/c_cpp/src/c/payload/qpidmsg/field.c
index ae988e9..49ac087 100644
--- a/mama/c_cpp/src/c/payload/qpidmsg/field.c
+++ b/mama/c_cpp/src/c/payload/qpidmsg/field.c
@@ -919,7 +919,7 @@ qpidmsgFieldPayload_getVectorBool (const msgFieldPayload field,
const mama_bool_t** result,
mama_size_t* size)
{
- return MAMA_STATUS_NOT_IMPLEMENTED;
+ GET_VECTOR_FIELD (_bool, mama_bool_t);
}

mama_status
@@ -1264,6 +1264,16 @@ qpidmsgFieldPayload_getAsString (const msgFieldPayload field,
long long unsigned);
break;
}
+ case MAMA_FIELD_TYPE_VECTOR_BOOL:
+ {
+ EXPAND_PRINT_VECTOR_MACROS (mama_bool_t, Bool, "%u", mama_bool_t);
+ break;
+ }
+ case MAMA_FIELD_TYPE_VECTOR_CHAR:
+ {
+ EXPAND_PRINT_VECTOR_MACROS (char, Char, "%c", char);
+ break;
+ }
case MAMA_FIELD_TYPE_VECTOR_I8:
{
EXPAND_PRINT_VECTOR_MACROS (mama_i8_t, I8, "%d", mama_i8_t);
diff --git a/mama/c_cpp/src/c/payload/qpidmsg/payload.c b/mama/c_cpp/src/c/payload/qpidmsg/payload.c
index 09daab4..2e69769 100644
--- a/mama/c_cpp/src/c/payload/qpidmsg/payload.c
+++ b/mama/c_cpp/src/c/payload/qpidmsg/payload.c
@@ -1166,6 +1166,16 @@ qpidmsgPayload_apply (msgPayload dest,
UPDATE_VECTOR_FIELD (U8, mama_u8_t);
break;
}
+ case MAMA_FIELD_TYPE_VECTOR_BOOL:
+ {
+ UPDATE_VECTOR_FIELD (Bool, mama_bool_t);
+ break;
+ }
+ case MAMA_FIELD_TYPE_VECTOR_CHAR:
+ {
+ UPDATE_VECTOR_FIELD (Char, char);
+ break;
+ }
case MAMA_FIELD_TYPE_VECTOR_I8:
{
UPDATE_VECTOR_FIELD (I8, mama_i8_t);
@@ -3733,6 +3743,12 @@ qpidmsgPayloadImpl_addFieldToPayload (msgPayload msg,
return status;
break;
}
+ case MAMA_FIELD_TYPE_VECTOR_BOOL:
+ ADD_VECTOR_FIELD_VALUE_TO_MESSAGE(Bool, mama_bool_t);
+ break;
+ case MAMA_FIELD_TYPE_VECTOR_CHAR:
+ ADD_VECTOR_FIELD_VALUE_TO_MESSAGE(Char, char);
+ break;
case MAMA_FIELD_TYPE_VECTOR_I8:
ADD_VECTOR_FIELD_VALUE_TO_MESSAGE(I8, mama_i8_t);
break;
@@ -3912,14 +3928,14 @@ qpidmsgPayloadImpl_arrayToMamaType (pn_type_t type)
switch(type)
{
case PN_NULL: return MAMA_FIELD_TYPE_UNKNOWN;
- case PN_BOOL: return MAMA_FIELD_TYPE_VECTOR_U8;
+ case PN_BOOL: return MAMA_FIELD_TYPE_VECTOR_BOOL;
case PN_UBYTE: return MAMA_FIELD_TYPE_VECTOR_U8;
case PN_BYTE: return MAMA_FIELD_TYPE_VECTOR_I8;
case PN_USHORT: return MAMA_FIELD_TYPE_VECTOR_U16;
case PN_SHORT: return MAMA_FIELD_TYPE_VECTOR_I16;
case PN_UINT: return MAMA_FIELD_TYPE_VECTOR_U32;
case PN_INT: return MAMA_FIELD_TYPE_VECTOR_I32;
- case PN_CHAR: return MAMA_FIELD_TYPE_VECTOR_U8;
+ case PN_CHAR: return MAMA_FIELD_TYPE_VECTOR_CHAR;
case PN_ULONG: return MAMA_FIELD_TYPE_VECTOR_U64;
case PN_LONG: return MAMA_FIELD_TYPE_VECTOR_I64;
case PN_TIMESTAMP: return MAMA_FIELD_TYPE_VECTOR_TIME;
--
1.9.3