XmlBlasterConnectionUnparsed.h

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------
00002 Name:      XmlBlasterConnectionUnparsed.h
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 Comment:   Include this header in your client code
00006            The returned strings are not parsed, we need another layer
00007            doing XML parsing with expat.
00008            This library is thread safe, multiple client connections may
00009            be established in parallel.
00010 Author:    "Marcel Ruff" <xmlBlaster@marcelruff.info>
00011 Date:      05/2003
00012 See:       http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.html
00013 -----------------------------------------------------------------------------*/
00014 #ifndef XMLBLASTER_XmlBlasterConnectionUnparsed_H
00015 #define XMLBLASTER_XmlBlasterConnectionUnparsed_H
00016 
00017 #ifdef __cplusplus
00018 #ifndef XMLBLASTER_C_COMPILE_AS_CPP /* 'g++ -DXMLBLASTER_C_COMPILE_AS_CPP ...' allows to compile the lib as C++ code */
00019 extern "C" {
00020 #endif
00021 #endif
00022 
00023 #include <util/msgUtil.h>
00024 #include <util/queue/QueueInterface.h>
00025 #include <util/Properties.h>
00026 
00027 struct XmlBlasterZlibWriteBuffers;
00028 struct XmlBlasterConnectionUnparsedStruct;
00029 typedef struct XmlBlasterConnectionUnparsedStruct XmlBlasterConnectionUnparsed;
00030 
00031 /* Declare function pointers to use in struct to simulate object oriented access */
00032 typedef bool  ( * XmlBlasterConnectionUnparsedInitConnection)(XmlBlasterConnectionUnparsed *xb, XmlBlasterException *exception);
00033 typedef bool  ( * XmlBlasterConnectionUnparsedInitQueue)(XmlBlasterConnectionUnparsed *xb, QueueProperties *queueProperties, XmlBlasterException *exception);
00034 typedef char *( * XmlBlasterConnectionUnparsedConnect)(XmlBlasterConnectionUnparsed *xb, const char * const qos, XmlBlasterException *exception);
00035 typedef bool  ( * XmlBlasterConnectionUnparsedDisconnect)(XmlBlasterConnectionUnparsed *xb, const char * qos, XmlBlasterException *exception);
00036 typedef char *( * XmlBlasterConnectionUnparsedPublish)(XmlBlasterConnectionUnparsed *xb, MsgUnit *msgUnit, XmlBlasterException *exception);
00037 typedef QosArr *( * XmlBlasterConnectionUnparsedPublishArr)(XmlBlasterConnectionUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception);
00038 typedef void  ( * XmlBlasterConnectionUnparsedPublishOneway)(XmlBlasterConnectionUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception);
00039 typedef char *( * XmlBlasterConnectionUnparsedSubscribe)(XmlBlasterConnectionUnparsed *xb, const char * const key, const char * qos, XmlBlasterException *exception);
00040 typedef QosArr *( * XmlBlasterConnectionUnparsedUnSubscribe)(XmlBlasterConnectionUnparsed *xb, const char * const key, const char * qos, XmlBlasterException *exception);
00041 typedef QosArr *( * XmlBlasterConnectionUnparsedErase)(XmlBlasterConnectionUnparsed *xb, const char * const key, const char * qos, XmlBlasterException *exception);
00042 typedef MsgUnitArr *( * XmlBlasterConnectionUnparsedGet)(XmlBlasterConnectionUnparsed *xb, const char * const key, const char * qos, XmlBlasterException *exception);
00043 typedef char *( * XmlBlasterConnectionUnparsedPing)(XmlBlasterConnectionUnparsed *xb, const char * const qos, XmlBlasterException *exception);
00044 typedef bool  ( * XmlBlasterConnectionUnparsedIsConnected)(XmlBlasterConnectionUnparsed *xb);
00045 typedef void  ( * XmlBlasterConnectionUnparsedShutdown)(XmlBlasterConnectionUnparsed *xb);
00046 typedef MsgRequestInfo *( * XmlBlasterConnectionUnparsedPreSendEvent)(MsgRequestInfo *msgRequestInfo, XmlBlasterException *exception);
00047 typedef MsgRequestInfo *( * XmlBlasterConnectionUnparsedPostSendEvent)(MsgRequestInfo *msgRequestInfo, XmlBlasterException *exception);
00048 
00052 struct Dll_Export XmlBlasterConnectionUnparsedStruct {
00053    int argc;
00054    const char * const*argv;
00055    Properties *props;
00056    int socketToXmlBlaster;
00057    int socketToXmlBlasterUdp;
00058    long requestId;
00059    char secretSessionId[MAX_SECRETSESSIONID_LEN];
00060    bool isInitialized;
00061    XmlBlasterConnectionUnparsedInitConnection initConnection; 
00062    XmlBlasterConnectionUnparsedInitQueue initQueue; 
00063    XmlBlasterConnectionUnparsedConnect connect;   
00064    XmlBlasterConnectionUnparsedDisconnect disconnect;   
00065    XmlBlasterConnectionUnparsedPublish publish;
00066    XmlBlasterConnectionUnparsedPublishArr publishArr;
00067    XmlBlasterConnectionUnparsedPublishOneway publishOneway;
00068    XmlBlasterConnectionUnparsedSubscribe subscribe;
00069    XmlBlasterConnectionUnparsedUnSubscribe unSubscribe;
00070    XmlBlasterConnectionUnparsedErase erase;
00071    XmlBlasterConnectionUnparsedGet get;
00072    XmlBlasterConnectionUnparsedPing ping;
00073    XmlBlasterConnectionUnparsedIsConnected isConnected;
00074    XmlBlasterConnectionUnparsedShutdown shutdown;
00075    XmlBlasterConnectionUnparsedPreSendEvent preSendEvent; 
00076    void *preSendEvent_userP;
00077    XmlBlasterConnectionUnparsedPostSendEvent postSendEvent; 
00078    void *postSendEvent_userP;
00079    I_Queue *queueP;
00080    XMLBLASTER_LOG_LEVEL logLevel;
00081    XmlBlasterLogging log;
00082    void *logUserP;               
00083    bool useUdpForOneway;         
00085    /* Socket write access: */
00086    XmlBlasterWriteToSocketFuncHolder writeToSocket;  
00088    struct XmlBlasterZlibWriteBuffers *zlibWriteBuf; 
00090    /* Socket read access: */
00091    XmlBlasterReadFromSocketFuncHolder readFromSocket; 
00092    struct XmlBlasterZlibReadBuffers *zlibReadBuf; 
00093 };
00094 
00095 
00101 Dll_Export extern XmlBlasterConnectionUnparsed *getXmlBlasterConnectionUnparsed(int argc, const char* const* argv);
00102 
00108 Dll_Export extern void freeXmlBlasterConnectionUnparsed(XmlBlasterConnectionUnparsed **xmlBlasterAccess);
00109 
00113 Dll_Export extern const char *xmlBlasterConnectionUnparsedUsage();
00114 
00115 
00116 #ifdef __cplusplus
00117 #ifndef XMLBLASTER_C_COMPILE_AS_CPP
00118 }
00119 #endif
00120 #endif
00121 
00122 #endif /* XMLBLASTER_XmlBlasterConnectionUnparsed_H */
00123