rtEXIStateTable.h File Reference

EXI state table for schema-informed decoding. More...

#include "rtexisrc/rtEXIEvent.h"

Go to the source code of this file.


Classes

struct  OSEXIStateTableRecord
struct  OSEXIStateTable

Defines

#define OSEXI_XSITYPE_STX   16000
#define OSEXI_XSINIL_STX   16001
#define IS_XSI_OSEXISTX(stx)   (stx == OSEXI_XSITYPE_STX || stx == OSEXI_XSINIL_STX)
#define OSEXINULLEVENTID   OSUINT16_MAX

Functions

EXTERNEXI OSEXIStateTablertEXINewStateTable (OSCTXT *pctxt, const OSEXIStateTableRecord *pStabRecArray, OSUINT16 numStabRecs)
 This allocates and initializes a new state table structure.
EXTERNEXI void rtEXIInitStateTableRecord (OSEXIStateTableRecord *pRecord, OSUINT16 eventId, OSUINT16 stateId, OSINT16 nextStateIdx, OSINT16 repStateIdx, const OSUTF8CHAR *localName, OSEXIEventType eventType, OSUINT8 eventCode, OSUINT8 eventNBits, OSUINT8 maxEvtCode, OSUINT32 maxRepeats)
 This function sets all items in the given state table record to the given values.
EXTERNEXI OSINT16 rtEXIStateTransition (OSCTXT *pctxt)
 This function transitions from the current encode state in the state table to the next encode state.
EXTERNEXI OSINT16 rtEXILookupEventInState (OSCTXT *pctxt, OSUINT16 eventId)
 This function is used to lookup the given event ID in the state table.
EXTERNEXI OSINT16 rtEXILookupEventTypeInState (OSCTXT *pctxt, OSEXIEventType eventType)
 This function is used to lookup the given event type in the state table.

Detailed Description

EXI state table for schema-informed decoding.

Definition in file rtEXIStateTable.h.


Function Documentation

EXTERNEXI void rtEXIInitStateTableRecord ( OSEXIStateTableRecord pRecord,
OSUINT16  eventId,
OSUINT16  stateId,
OSINT16  nextStateIdx,
OSINT16  repStateIdx,
const OSUTF8CHAR *  localName,
OSEXIEventType  eventType,
OSUINT8  eventCode,
OSUINT8  eventNBits,
OSUINT8  maxEvtCode,
OSUINT32  maxRepeats 
)

This function sets all items in the given state table record to the given values.

Parameters:
pRecord Pointer to state table record structure.
eventId A unique event identifier.
stateId A unique state identifier.
nextStateIdx Next state index.
repStateIdx Repeating state index.
localName Local name for start element or attribute event.
eventType Event type (SE, AT, EE, etc.)
eventCode Part 1 of event code (other parts are not used).
eventNBits Number of bits eventCode to be encoded into.
maxEvtCode Maximum event code for this state.
maxRepeats Maximum number of times this state can repeat.

EXTERNEXI OSINT16 rtEXILookupEventInState ( OSCTXT *  pctxt,
OSUINT16  eventId 
)

This function is used to lookup the given event ID in the state table.

It is assumed state table information in the EXI context is set to point at the first state record in a group.

Parameters:
pctxt Pointer to OSCTXT structure
eventId ID of event to be searched for.
Returns:
Index to row containing event or -1 if not found.

EXTERNEXI OSINT16 rtEXILookupEventTypeInState ( OSCTXT *  pctxt,
OSEXIEventType  eventType 
)

This function is used to lookup the given event type in the state table.

It is assumed state table information in the EXI context is set to point at the first state record in a group.

Parameters:
pctxt Pointer to OSCTXT structure
eventType Type of event (SE, AT, EE, etc.)
Returns:
Index to row containing event or -1 if not found.

EXTERNEXI OSEXIStateTable* rtEXINewStateTable ( OSCTXT *  pctxt,
const OSEXIStateTableRecord pStabRecArray,
OSUINT16  numStabRecs 
)

This allocates and initializes a new state table structure.

Parameters:
pctxt Pointer to OSCTXT structure
pStabRecArray Pointer to array of state table records.
numStabRecs Number of records in state table array.
Returns:
Pointer to allocated array or NULL if no memory.

EXTERNEXI OSINT16 rtEXIStateTransition ( OSCTXT *  pctxt  ) 

This function transitions from the current encode state in the state table to the next encode state.

For encoding, a repeating state is handled as part of the transition.

Parameters:
pctxt Pointer to OSCTXT structure
Returns:
Index to next state or -1 if end or error.