Optim Data Privacy Providers  11.3.0
 All Data Structures Files Functions Variables Macros Groups Pages
Structure Members
DP_ROW_DEF Struct Reference

#include <ODPPCmnAPI.h>

Collaboration diagram for DP_ROW_DEF:
Collaboration graph

Structure Members

struct DP_ROW_DEFpNext
 
unsigned char cEyeCatcher [4]
 
short sStructVer
 
short sStructLen
 
char bProcessed
 
char bHasError
 
short sCount
 
DP_FIELD_DATA_DEFpFldDataDefine
 

Structure Description

Structure Member Documentation

struct DP_ROW_DEF* pNext
  • Use:
    This member is used to point to the next row.
  • Description:
    This is a pointer to the next element in the chain of DP_ROW_DEF structures. A row is represented by a DP_ROW_DEF structure instance and multiple rows must be chained together using this member.

    Example:
    DP_ROWSET_DEF RowSetDef; //Row Set Definition
    DP_ROW_DEF **pRow; //Pointer used to create the list of rows in RowSetDef
    DP_FIELD_DATA_DEF FldDataDef1[MAX_FIELDS]; //Array of DP_FIELD_DATA_DEF structures for the first row. Assume MAX_FIELDS is 2.
    DP_FIELD_DATA_DEF FldDataDef2[MAX_FIELDS]; //Array of DP_FIELD_DATA_DEF structures for the second row.
    memset(&RowSetDef, 0, sizeof(DP_ROWSET_DEF)); //Clear the Row Set Definition
    pRow = &RowSetDef.pRowDefine; //Set pRow to point to the address of the first element in the list of Row Defines
    (*pRow) = (DP_ROW_DEF*)malloc(sizeof(DP_ROW_DEF)); //Allocate memory for the first row
    if(NULL == (*pRow)) //Check if memory was allocated successfully
    {
    printf("Failed to allocate memory for the first row");
    return ODPPFAILURE;
    }
    memset(*pRow, 0, sizeof(DP_ROW_DEF)); //Clear the allocated memory for the Row Define
    //Initialize the data fields in the FldDataDef1 array
    (*pRow)->sCount = 2; //Assume there are two data fields
    (*pRow)->pFldDataDefine = &FldDataDef1[0]; //Copy pointer to the first DP_FIELD_DATA_DEF structure to the Row Definition
    pRow = &(*pRow)->pNext; //Move to the next row in the list
    (*pRow) = (DP_ROW_DEF*)malloc(sizeof(DP_ROW_DEF)); //Allocate memory for the second row
    if(NULL == (*pRow)) //Check if memory was allocated successfully
    {
    printf("Failed to allocate memory for the second row");
    free(RowSetDef.pRowDefine);
    return ODPPFAILURE;
    }
    memset(*pRow, 0, sizeof(DP_ROW_DEF)); //Clear the allocated memory for the Row Define
    //Initialize the data fields in the FldDataDef2 array
    (*pRow)->sCount = 2; //Assume there are 2 data fields
    (*pRow)->pFldDataDefine = &FldDataDef2[0]; //Copy pointer to the first DP_FIELD_DATA_DEF structure to the Row Definition
    RowSetDef.iCount = 2; //Assume there are two rows

    [Alternate method of sending multiple rows]
    ODPP also provides an alternate method of sending multiple rows as an ARRAY. The user can declare an array of DP_ROW_DEF structures where each element will represent a single row. When using this method it is mandatory to set member #iCount of parent structure DP_ROWSET_DEF equal to the number of elements in the DP_ROW_DEF array.

    Example:
    DP_ROWSET_DEF RowSetDef; //Row Set Definition
    DP_ROW_DEF RowDef[MAX_ROWS]; //Array of DP_ROW_DEF structures
    DP_FIELD_DATA_DEF FldDataDef1[MAX_FIELDS]; //Array of DP_FIELD_DATA_DEF structures for the first row. Assume MAX_FIELDS is 2.
    DP_FIELD_DATA_DEF FldDataDef2[MAX_FIELDS]; //Array of DP_FIELD_DATA_DEF structures for the second row.
    memset(&RowSetDef, 0, sizeof(DP_ROWSET_DEF)); //Clear the Row Set Definition
    memset(RowDef, 0, MAX_ROWS * sizeof(DP_ROW_DEF)); //Clear the Row Definition
    //Initialize the data fields in the FldDataDef1 array
    RowDef[0].sCount = 2; //Assume there are 2 data fields
    RowDef[0].pFldDataDefine = &FldDataDef1[0]; //Copy pointer to the first DP_FIELD_DATA_DEF structure to the Row Definition
    //Initialize the data fields in the FldDataDef2 array
    RowDef[1].sCount = 2; //Assume there are 2 data fields
    RowDef[1].pFldDataDefine = &FldDataDef2[0]; //Copy pointer to the first DP_FIELD_DATA_DEF structure to the Row Definition
    RowSetDef.pRowDefine = &RowDef[0]; //Copy pointer to the first DP_ROW_DEF structure to the Row Set Definition
    RowSetDef.iCount = 2; //Assume there are two rows
  • Optional:
    N/A
unsigned char cEyeCatcher[4]
  • Use:
    For Internal use only.
  • Description:
    This is commonly used as structure identifier, specially helpful during debugging, and is set using INITIALIZE_ODPP_STRUCT_PTR to Initialize the structure instance.
  • Optional:
    N/A
short sStructVer
  • Use:
    For Internal use only.
  • Description:
    This is commonly used to hold structure version, specially helpful during debugging, and is set using INITIALIZE_ODPP_STRUCT_PTR to Initialize the structure instance.
  • Optional:
    N/A
short sStructLen
  • Use:
    [FOR FUTURE USE]
  • Description:
    [FOR FUTURE USE]
  • Optional:
    [FOR FUTURE USE]
char bProcessed
  • Use:
    This member is used to indicate whether this row has been processed by the Service Provider or not.
  • Description:
    The Service Provider sets this member to TRUE when this DP_ROW_DEF structure has been processed. This member must be set to FALSE for each row in the first call to Provider_Service(). Consider a scenario where the parameter ODPP_OPR_DISCARD_LIMIT is specified during Provider_Init() and the call to Provider_Service() returns because the discard limit has been reached. In this scenario, if Provider_Service() is called once again with the same set of rows then the Service Provider uses the bProcessed value to determine whether the row has already been processed in the previous call to Provider_Service(). Rows that have already been processed will not be processed once again.
char bHasError
  • Use:
    This member is used to indicate whether an error occurred during the processing of this row.
  • Description:
    The Service Provider sets this value to TRUE if any DP_FIELD_DATA_DEF structure in this row has an error code. This member must be set to FALSE for each row in the first call to Provider_Service(). For warnings and informational messages an error code is returned in member iErrorCode of the DP_FIELD_DATA_DEF being processed but the bHasError member is set to FALSE.
short sCount
  • Use:
    This member is used to specify the count of data fields in this row.
  • Description:
    This is a 2 byte integer which contains the number of elements in the chain of DP_FIELD_DATA_DEF structures pointed to by member pFldDataDefine. This value must be specified if the list of data fields is specified as an array of DP_FIELD_DATA_DEF structures. If the data fields are chained together then this value need not be specified if the member "pNext" of the last DP_FIELD_DATA_DEF structure is set to NULL. However it is recommended to always set this value to the number of DP_FIELD_DATA_DEF structures in the current row.
  • Optional:
    No
DP_FIELD_DATA_DEF* pFldDataDefine
  • Use:
    This member is used to specify the list of data fields in this row.
  • Description:
    This is a pointer to an array of DP_FIELD_DATA_DEF structures or a pointer to the first element in the chain of DP_FIELD_DATA_DEF structures for the current row. Each DP_FIELD_DATA_DEF structure represents a data field and this member is used to pass on the list of data fields for the current row to the Service Provider. The member sCount must be set to the number of DP_FIELD_DATA_DEF elements in the list of data fields pointed to by this member.
  • Optional:
    No