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

Google


Objective Systems, Inc.

rtxCppXSDElement.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2003-2004 by 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 _RTXCPPXSDELEMENT_H_
00029 #define _RTXCPPXSDELEMENT_H_
00030 
00031 #include "rtxsrc/rtxCppContext.h"
00032 #include "rtxsrc/rtxCppMsgBufIF.h"
00033 
00041 class EXTERNRTX OSXSDGlobalElement {
00042  protected:
00049    OSCtxtPtr mpContext;
00050 
00055    OSMessageBufferIF* mpMsgBuf;
00056 
00061    OSXSDGlobalElement () : mpMsgBuf (0), mpContext (new OSContext()) {}
00062 
00069    OSXSDGlobalElement (OSContext& ctxt) : mpContext (&ctxt), mpMsgBuf (0) {}
00070 
00077    void setMsgBuf (OSMessageBufferIF& msgBuf);
00078 
00079  public:
00089    OSXSDGlobalElement (OSMessageBufferIF& msgBuf) : mpMsgBuf(&msgBuf) {
00090       mpContext = msgBuf.getContext();
00091    }
00092 
00100    OSXSDGlobalElement (const OSXSDGlobalElement& o) : 
00101       mpContext (o.mpContext), mpMsgBuf (o.mpMsgBuf) { }
00102 
00107    virtual ~OSXSDGlobalElement () {}
00108 
00113    inline int decode () { return decodeFrom (*mpMsgBuf); }
00114 
00122    virtual int decodeFrom (OSMessageBufferIF& msgBuf) { return 0; }
00123 
00128    inline int encode () { return encodeTo (*mpMsgBuf); }
00129 
00137    virtual int encodeTo (OSMessageBufferIF& msgBuf) { return 0; }
00138 
00143    inline OSCTXT* getCtxtPtr () {
00144       return (!mpContext.isNull ()) ? mpContext->getPtr() : 0;
00145    }
00146 
00156    inline void* memAlloc (size_t numocts) {
00157       return rtxMemAlloc (getCtxtPtr(), numocts);
00158    }
00159 
00170    inline void* memRealloc (void* ptr, size_t oldnumocts, size_t numocts) {
00171       return rtxMemRealloc (getCtxtPtr(), ptr, oldnumocts, numocts);
00172    }
00173 
00182    inline void memFreePtr (void* ptr) {
00183       rtxMemFreePtr (getCtxtPtr(), ptr);
00184    }
00185 
00192    inline void setDefaultNamespace (const OSUTF8CHAR* uri) {
00193       setNamespace (0, uri);
00194    }
00195 
00203    inline void setNamespace (const OSUTF8CHAR* prefix, const OSUTF8CHAR* uri) {
00204       mpMsgBuf->setNamespace (prefix, uri);
00205    }
00206 
00207 } ;
00208 
00209 #endif

This file was last modified on 1 Jun 2004.
XBinder, Version 1.0.0