Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

rtXmlCppXSDElement.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2006 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  *****************************************************************************/
00028 #ifndef _RTXMLCPPXSDELEMENT_H_
00029 #define _RTXMLCPPXSDELEMENT_H_
00030 
00031 #include "rtxsrc/rtxCppContext.h"
00032 #include "rtxsrc/rtxCppMsgBufIF.h"
00033 #include "rtxsrc/rtxErrCodes.h"
00034 #include "rtxmlsrc/osrtxml.h"
00035 
00043 class EXTERNXML OSXSDGlobalElement {
00044  protected:
00051    OSCtxtPtr mpContext;
00052 
00057    OSMessageBufferIF* mpMsgBuf;
00058 
00063    const OSUTF8CHAR* mpSOAPFaultCode;
00064 
00069    const OSUTF8CHAR* mpSOAPFaultString;
00070 
00075    OSXSDGlobalElement () : mpContext (new OSContext()), mpMsgBuf(0),
00076       mpSOAPFaultCode(0), mpSOAPFaultString(0) {}
00077 
00084    OSXSDGlobalElement (OSContext& ctxt) : mpContext (&ctxt), mpMsgBuf (0) {}
00085 
00092    void setMsgBuf (OSMessageBufferIF& msgBuf);
00093 
00094  public:
00104    OSXSDGlobalElement (OSMessageBufferIF& msgBuf) : mpMsgBuf(&msgBuf), 
00105       mpSOAPFaultCode(0), mpSOAPFaultString(0) {
00106       mpContext = msgBuf.getContext();
00107    }
00108 
00116    OSXSDGlobalElement (const OSXSDGlobalElement& o) : 
00117       mpContext (o.mpContext), mpMsgBuf (o.mpMsgBuf), 
00118       mpSOAPFaultCode (o.mpSOAPFaultCode), 
00119       mpSOAPFaultString (o.mpSOAPFaultString) {}
00120 
00125    virtual ~OSXSDGlobalElement () {}
00126 
00131    inline int decode () { return decodeFrom (*mpMsgBuf); }
00132 
00140    virtual int decodeFrom (OSMessageBufferIF& msgBuf) { return 0; }
00141 
00146    inline int encode () { return encodeTo (*mpMsgBuf); }
00147 
00155    virtual int encodeTo (OSMessageBufferIF& msgBuf) { return 0; }
00156 
00161    inline OSCTXT* getCtxtPtr () {
00162       return (!mpContext.isNull ()) ? mpContext->getPtr() : 0;
00163    }
00164 
00174    inline void* memAlloc (size_t numocts) {
00175       return rtxMemAlloc (getCtxtPtr(), numocts);
00176    }
00177 
00188    inline void* memRealloc (void* ptr, size_t oldnumocts, size_t numocts) {
00189       return rtxMemRealloc (getCtxtPtr(), ptr, oldnumocts, numocts);
00190    }
00191 
00200    inline void memFreePtr (void* ptr) {
00201       rtxMemFreePtr (getCtxtPtr(), ptr);
00202    }
00203 
00210    inline void setDefaultNamespace (const OSUTF8CHAR* uri) {
00211       setNamespace (0, uri);
00212    }
00213 
00221    inline void setNamespace (const OSUTF8CHAR* prefix, const OSUTF8CHAR* uri) {
00222       mpMsgBuf->setNamespace (prefix, uri);
00223    }
00224 
00231    inline void setSOAPFaultCode (const OSUTF8CHAR* value) {
00232       mpSOAPFaultCode = value;
00233    }
00234 
00241    inline void setSOAPFaultString (const OSUTF8CHAR* value) {
00242       mpSOAPFaultString = value;
00243    }
00244 
00251    inline void setXSIType (const OSUTF8CHAR* typeName) {
00252       rtXmlSetXSITypeAttr (mpContext->getPtr(), typeName);
00253    }
00254 
00259    inline int validate () { return validateFrom (*mpMsgBuf); }
00260 
00268    virtual int validateFrom (OSMessageBufferIF& msgBuf) 
00269       { return RTERR_NOTSUPP; }
00270 } ;
00271 
00272 #endif

This file was last modified on 8 Jan 2007.
XBinder, Version 1.1.9