OSRTMsgBuf.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2010 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 _OSRTMSGBUF_H_
00029 #define _OSRTMSGBUF_H_
00030 
00031 #include "rtxsrc/OSRTCtxtHolder.h"
00032 #include "rtxsrc/OSRTMsgBufIF.h"
00033 
00046 class EXTRTCLASS OSRTMessageBuffer :
00047 public OSRTCtxtHolder, public OSRTMessageBufferIF
00048 {
00049  protected:
00050 
00055    Type mBufferType;
00056 
00066    EXTRTMETHOD OSRTMessageBuffer (Type bufferType, OSRTContext* pContext = 0);
00067 
00068  public:
00073    virtual ~OSRTMessageBuffer () {}
00074 
00078    virtual void* getAppInfo () { return 0; }
00079 
00086    virtual size_t getByteIndex () {
00087       return getCtxtPtr()->buffer.byteIndex;
00088    }
00089 
00094    virtual OSRTCtxtPtr getContext () {
00095       return OSRTCtxtHolder::getContext ();
00096    }
00097 
00102    virtual OSCTXT* getCtxtPtr () {
00103       return OSRTCtxtHolder::getCtxtPtr ();
00104    }
00105 
00113    virtual char* getErrorInfo () {
00114       return OSRTCtxtHolder::getErrorInfo ();
00115    }
00116 
00133    virtual char* getErrorInfo (char* pBuf, size_t& bufSize) {
00134       return OSRTCtxtHolder::getErrorInfo (pBuf, bufSize);
00135    }
00136 
00141    virtual OSOCTET* getMsgCopy () {
00142       return 0;
00143    }
00144 
00149    virtual const OSOCTET* getMsgPtr () {
00150       return getCtxtPtr()->buffer.data;
00151    }
00152 
00162    inline int getStatus () const {
00163       return OSRTCtxtHolder::getStatus();
00164    }
00165 
00173    virtual int init () { return 0; }
00174 
00186    virtual EXTRTMETHOD int initBuffer (OSOCTET* pMsgBuf, size_t msgBufLen);
00187 
00192    virtual void printErrorInfo () {
00193       OSRTCtxtHolder::printErrorInfo ();
00194    }
00195 
00200    virtual void resetErrorInfo () {
00201       OSRTCtxtHolder::resetErrorInfo ();
00202    }
00203 
00207    virtual void setAppInfo (void*) {}
00208 
00214    virtual EXTRTMETHOD void setDiag (OSBOOL value=TRUE);
00215 
00216 } ;
00217 
00220 #endif