rtXmlKeyArray.h File Reference

  • Implementation of a dynamic pointer sorted array.
More...

#include "rtxsrc/rtxContext.h"
#include "rtxmlsrc/rtXmlExternDefs.h"

Go to the source code of this file.

Functions

int rtXmlKeyArrayInit (OSCTXT *pctxt, OSXSDKeyArray *pArray, OSUINT32 nmFields, OSBOOL key, const char *name)
 Initialize the array by allocating memory for it.
void rtXmlKeyArraySetString (OSXSDKeyArray *pArray, const OSUTF8CHAR *pValue, OSUINT32 fldNum)
 Set the given field's value to the given string value.
void rtXmlKeyArraySetInt (OSXSDKeyArray *pArray, OSINT32 value, OSUINT32 fldNum)
 Set the given field's value to the given integer value.
void rtXmlKeyArraySetUInt (OSXSDKeyArray *pArray, OSUINT32 value, OSUINT32 fldNum)
 Set the given field's value to the given unsigned integer value.
void rtXmlKeyArraySetDecimal (OSXSDKeyArray *pArray, const OSREAL *value, OSUINT32 fldNum)
 Set the given field's value to the given decimal value.
int rtXmlKeyArrayAdd (OSCTXT *pctxt, OSXSDKeyArray *pArray)
 Once all the fields for a key are set, invoke this method to add the key.
int rtXmlKeyArrayContains (OSCTXT *pctxt, OSXSDKeyArray *pArray)
 Once all the fields for a key are set, this method is used to check whether the key is already present in the array of keys.

Detailed Description

  • Implementation of a dynamic pointer sorted array.

Definition in file rtXmlKeyArray.h.


Function Documentation

int rtXmlKeyArrayAdd ( OSCTXT *  pctxt,
OSXSDKeyArray *  pArray 
)

Once all the fields for a key are set, invoke this method to add the key.

It will report an error if any of the following are true:

  • a field was skipped and the constraint is a key constraint
  • a field was set more than once This method adds the "new" key (pointed to by pArray) into the correct place within the array of keys (and their fields), also pointed to by pArray.
int rtXmlKeyArrayContains ( OSCTXT *  pctxt,
OSXSDKeyArray *  pArray 
)

Once all the fields for a key are set, this method is used to check whether the key is already present in the array of keys.

Thus, to check a key ref, you set all the fields, then invoke this method. You do NOT invoke rtXmlKeyArrayAdd.

Returns:
0 if key is found as expected
int rtXmlKeyArrayInit ( OSCTXT *  pctxt,
OSXSDKeyArray *  pArray,
OSUINT32  nmFields,
OSBOOL  key,
const char *  name 
)

Initialize the array by allocating memory for it.

Parameters:
pctxt 
pArray The array whose data should be initialized.
nmFields The number of fields in the key whose data will be held in pArray->data.
key TRUE if the data is for a key; FALSE if for a unique identity constraint.
name of the identity constraint
void rtXmlKeyArraySetDecimal ( OSXSDKeyArray *  pArray,
const OSREAL *  value,
OSUINT32  fldNum 
)

Set the given field's value to the given decimal value.

see comment on set* methods above.

void rtXmlKeyArraySetInt ( OSXSDKeyArray *  pArray,
OSINT32  value,
OSUINT32  fldNum 
)

Set the given field's value to the given integer value.

see comment on set* methods above.

void rtXmlKeyArraySetString ( OSXSDKeyArray *  pArray,
const OSUTF8CHAR *  pValue,
OSUINT32  fldNum 
)

Set the given field's value to the given string value.

see comment on set* methods above.

void rtXmlKeyArraySetUInt ( OSXSDKeyArray *  pArray,
OSUINT32  value,
OSUINT32  fldNum 
)

Set the given field's value to the given unsigned integer value.

see comment on set* methods above.