Exemplo n.º 1
0
AwaFloat AwaFloatArrayIterator_GetValue(const AwaFloatArrayIterator * iterator)
{
    AwaFloat value = 0;
    AwaFloat * valuePtr = NULL;

    valuePtr = ArrayIterator_GetValue((AwaArrayIterator *)iterator);

    if(valuePtr)
    {
        value = *valuePtr;
    }

    return value;
}
Exemplo n.º 2
0
AwaObjectLink AwaObjectLinkArrayIterator_GetValue(const AwaObjectLinkArrayIterator * iterator)
{
    AwaObjectLink value;

    void * valuePtr = ArrayIterator_GetValue((const AwaArrayIterator *)iterator);

    memset(&value, 0, sizeof(AwaObjectLink));

    if (valuePtr != NULL)
    {
        memcpy(&value, valuePtr, sizeof(AwaObjectLink));
    }

    return value;
}
Exemplo n.º 3
0
static AwaError ClientSetOperation_AddValues(AwaClientSetOperation * operation, const char * path, const AwaArray * array, AwaResourceType type)
{
    AwaError result = AwaError_Unspecified;

    AwaArrayIterator * iterator = ArrayIterator_New(array);

    if (iterator)
    {
        while(ArrayIterator_Next(iterator))
        {
            AwaArrayIndex index = ArrayIterator_GetIndex(iterator);
            void * value = ArrayIterator_GetValue(iterator);
            size_t length = ArrayIterator_GetValueLength(iterator);

            if (type == AwaResourceType_OpaqueArray)
            {
                AwaOpaque * opaque = value;
                value = opaque->Data;
                length = opaque->Size;
            }

            LogDebug("Adding value %p", value);

            if (value)
            {
                result = ClientSetOperation_AddValue(operation, path, index, value, length, type, SetArrayMode_Replace);
                if (result != AwaError_Success)
                {
                    LogError("Unable to add array resource Instance");
                    break;
                }
            }
            else
            {
                result = LogErrorWithEnum(AwaError_Internal , "Problem with array");
                break;
            }
        }

        ArrayIterator_Free(&iterator);
    }
    else
    {
        result = LogErrorWithEnum(AwaError_OperationInvalid, "Operation is NULL");
    }

    return result;
}
Exemplo n.º 4
0
const char * AwaCStringArrayIterator_GetValueAsCString(const AwaCStringArrayIterator * iterator)
{
    return ArrayIterator_GetValue((AwaArrayIterator *)iterator);
}