Home > Support > Documentation

rtEXIAutomaton.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00031 #ifndef _RTEXIAUTOMATON_H_
00032 #define _RTEXIAUTOMATON_H_
00033 
00034 #include "rtexisrc/rtEXIEvent.h"
00035 #include "rtexisrc/rtEXIEventCodeGroup.h"
00036 #include "rtxmlsrc/osrtxml.h"
00037 #include "rtxsrc/rtxArrayList.h"
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042 
00043 typedef OSINT16 OSEXIState;
00044 
00045 typedef enum { OSEXIEncAtm, OSEXIDecAtm } OSEXIAtmType;
00046 
00050 typedef struct {
00051    OSEXIState fromState;
00052    OSEXIState toState;
00053    const OSEXIEvent* pEvent;
00054    OSEXIEventCode* pEventCode;
00055    OSUINT32 valueChannel;
00056 } OSEXIStateEvent;
00057 
00061 typedef struct {
00065    OSEXIState numberOfStates;
00066     
00070    OSEXIState currentState;
00071     
00075    OSEXIState acceptingState;
00076     
00081    const OSXMLFullQName* elementName;
00082     
00088    OSRTArrayList eventCodeGroups;
00089     
00095    OSBOOL isClosed;
00096         
00102    OSBOOL matchedBaseEvent;
00103 
00110    OSRTArrayList eventStates;  /* Array of OSEXIStateEvent structures */
00111 
00120    OSEXIEvent* pDynEvent;
00121 
00125    OSUINT32 valueChannel; 
00126 
00130    OSEXIStateEvent* pAttrEventState; 
00131 
00132 } OSEXIAutomaton;
00133 
00138 typedef struct {
00142    OSEXIState currentState;
00143 
00144 } OSEXIAtmState;
00145 
00149 typedef int(*OSEXIAtmAddTransFunc)(OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, 
00150                                    OSEXIState fromState, OSEXIState toState, 
00151                                    const OSEXIEvent* pEvent, 
00152                                    const OSEXIEventCode* pEventCode);
00153 
00162 EXTERNEXI void rtEXIAutomatonInit 
00163 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, const OSXMLFullQName* pElemName, 
00164  OSEXIState numStates);
00165 
00176 EXTERNEXI OSEXIAutomaton* rtEXINewAutomaton 
00177 (OSCTXT* pctxt, const OSXMLFullQName* pElemName, OSEXIState numStates);
00178 
00187 EXTERNEXI OSEXIAutomaton* rtEXIAutomatonCopy 
00188 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton);
00189 
00198 EXTERNEXI void rtEXIAutomatonFreeMem 
00199 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSBOOL dynamic);
00200 
00211 EXTERNEXI OSEXIAutomaton* rtEXIAutomatonAddTransition 
00212 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSEXIState fromState, 
00213  OSEXIState toState, const OSEXIEventCode* pEventCode);
00214 
00232 EXTERNEXI int rtEXIAtmAddUndeclaredItems
00233 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSEXIState fromState, 
00234  OSEXIState toState, OSEXIEventCode* pEventCode, 
00235  size_t numDeclAttrs, const OSXMLFullQName* declAttrs, 
00236  OSEXIAtmAddTransFunc addTransFunc);
00237 
00255 EXTERNEXI int rtEXIAtmAddUndeclaredStartTagItems
00256 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSEXIState fromState, 
00257  OSEXIState toState, OSEXIEventCode* pEventCode, 
00258  size_t numDeclAttrs, const OSXMLFullQName* declAttrs, 
00259  OSEXIAtmAddTransFunc addTransFunc);
00260 
00274 EXTERNEXI int rtEXIAtmAddUndeclaredContentItems
00275 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSEXIState fromState, 
00276  OSEXIState toState, OSEXIEventCode* pEventCode, 
00277  OSEXIAtmAddTransFunc addTransFunc);
00278 
00288 EXTERNEXI OSEXIAutomaton* rtEXIAutomatonInitCopy 
00289 (OSCTXT* pctxt, OSEXIAutomaton* pDestAtm, OSEXIAutomaton* pSrcAtm);
00290 
00298 EXTERNEXI int rtEXIAutomatonPush (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton);
00299 
00307 EXTERNEXI OSEXIAutomaton* rtEXIAutomatonPop (OSCTXT* pctxt);
00308 
00316 EXTERNEXI OSEXIEventCodeGroup* 
00317 rtEXIAtmGetCurrentEventCodeGroup (OSEXIAutomaton* pAutomaton);
00318 
00330 EXTERNEXI OSEXIAutomaton* rtEXIGetDocAutomaton 
00331 (OSCTXT* pctxt, size_t numGblElems, const OSXMLFullQName* gblElems, 
00332  OSEXIAtmAddTransFunc addTransFunc);
00333 
00344 EXTERNEXI OSEXIAutomaton* rtEXIGetElemAutomaton 
00345 (OSCTXT* pctxt, OSXMLFullQName* pqname, 
00346  int (*addTransFunc)(OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, 
00347                      OSEXIState fromState, OSEXIState toState, 
00348                      const OSEXIEvent* pEvent, 
00349                      const OSEXIEventCode* pEventCode));
00350 
00351 #ifdef _TRACE
00352 
00359 EXTERNEXI void rtEXIAutomatonPrint 
00360 (OSCTXT* pctxt, const OSEXIAutomaton* pAutomaton);
00361 #endif
00362 
00363 #ifdef __cplusplus
00364 }
00365 #endif
00366 
00369 #endif