/*
 * zResult.h
 * 
 * The Zen API 
 * Copyright (C) 2008-2009 by LMI Technologies Inc.
 * 
 * Licensed under The MIT License.
 * Redistributions of files must retain the above copyright notice.
 */
#ifndef LMITECH_ZRESULT_H_INCLUDED
#define LMITECH_ZRESULT_H_INCLUDED

#include <zApi.h>
#include <zSerializer.h>
#include <zApiBegin.h>
       
typedef zHandle zResult;        // Represents a sensor/station data message or set of health/event indicators.

ZAPI_EXPORT(zStatus) zResult_Destroy(zResult reslt); //
//
//  Description:
//      Destroys a zResult object. 
//  Arguments:
//      reslt - zResult object. 

ZAPI_EXPORT(zStatus) zResult_Clone(zResult reslt, zResult* clone); //
//
//  Description:
//      Creates a new zResult object with the same content as the source result.
//  Arguments:
//      reslt - zResult object. 
//      clone - zResult clone. 

ZAPI_EXPORT(zStatus) zResult_Read(zResult* reslt, zSerializer reader); //
//
//  Description: 
//      Reads a result from a binary serializer. 
//  Arguments: 
//      reslt - Destination for the constructed object handle. 
//      reader - Binary serializer. 

ZAPI_EXPORT(zStatus) zResult_Write(zResult reslt, zSerializer writer); //
//
//  Description: 
//      Writes a result to a binary serializer. 
//  Arguments: 
//      reslt - zResult object. 
//      writer - Binary serializer. 
 
ZAPI_EXPORT(z64s) zResult_Id(zResult reslt); //
//
//  Description:
//      Reports the message id for this result object.
//  Arguments:
//      reslt - zResult object. 

ZAPI_EXPORT(z32u) zResult_AttributeCount(zResult reslt); //
//
//  Description:
//      Reports the count of result attributes.
//  Arguments:
//      reslt - zResult object. 

ZAPI_EXPORT(z64s) zResult_AttributeAt(zResult reslt, z32u index); //
//
//  Description:
//      Accesses the result attribute at the specified index.
//  Arguments:
//      reslt - zResult object. 
//      index - Attribute index.

ZAPI_EXPORT(z64s*) zResult_AttributeData(zResult reslt); //
//
//  Description:
//      Returns a pointer to the first element in the attribute array.
//  Arguments:
//      reslt - zResult object. 

ZAPI_EXPORT(z32u) zResult_ItemCount(zResult reslt); //
//
//  Description:
//      Reports the count of data blocks contained in this result object.
//  Arguments:
//      reslt - zResult object. 

ZAPI_EXPORT(zType) zResult_ItemType(zResult reslt, z32u itemIndex); //
//
//  Description:
//      Reports the data type of the elements within a result data block.
//  Arguments:
//      reslt - zResult object. 
//      itemIndex - Data block index.

ZAPI_EXPORT(z32u) zResult_ItemLength(zResult reslt, z32u itemIndex, z32u dimension); //
//
//  Description:
//      Reports the length of a specific dimension for a result data block.
//  Arguments:
//      reslt - zResult object. 
//      itemIndex - Data block index.
//      dimension - index of dimension (0, 1, or 2)

ZAPI_EXPORT(z32u) zResult_ItemTotalLength(zResult reslt, z32u itemIndex); //
//
//  Description:
//      Reports the total count of elements in the specified data block. 
//  Arguments:
//      reslt - zResult object. 
//      itemIndex - Data block index.

ZAPI_EXPORT(zUIntPtr) zResult_Size(zResult reslt); //
//
//  Description:
//      Returns the total amount of memory (bytes) used by the result object.
//  Arguments:
//      reslt - zResult object. 

ZAPI_EXPORT(void*) zResult_ItemAt(zResult reslt, z32u itemIndex, z32u index0, z32u index1, z32u index2); //
//
//  Description:
//      Returns a pointer to the specified element within a data block.
//  Arguments:
//      reslt - zResult object. 
//      itemIndex - Data block index.
//      index0 - Index in first dimension.
//      index1 - Index in second dimension.
//      index2 - Index in third dimension.

ZAPI_EXPORT(void*) zResult_ItemData(zResult reslt, z32u itemIndex); //
//
//  Description:
//      Returns a pointer to the first element within a data block.
//  Arguments:
//      reslt - zResult object. 
//      itemIndex - Data block index.

#include <zApiEnd.h>

#endif          /* #ifndef LMITECH_ZRESULT_H_INCLUDED */
