📄 cdrstreamadapter.cc
字号:
// -*- Mode: C++; -*-// Package : omniORB// cdrStreamAdapter.cc Created on: 2001/01/09// Author : Duncan Grisby (dpg1)//// Copyright (C) 2001 AT&T Laboratories Cambrige//// This file is part of the omniORB library//// The omniORB library is free software; you can redistribute it and/or// modify it under the terms of the GNU Library General Public// License as published by the Free Software Foundation; either// version 2 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// Library General Public License for more details.//// You should have received a copy of the GNU Library General Public// License along with this library; if not, write to the Free// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA// 02111-1307, USA////// Description:// *** PROPRIETARY INTERFACE ***//// $Log: cdrStreamAdapter.cc,v $// Revision 1.1.2.5 2004/04/05 09:05:16 dgrisby// downcast of cdrStreamAdapter can downcast to adapted stream.//// Revision 1.1.2.4 2001/10/17 16:33:28 dpg1// New downcast mechanism for cdrStreams.//// Revision 1.1.2.3 2001/06/13 20:12:32 sll// Minor updates to make the ORB compiles with MSVC++.//// Revision 1.1.2.2 2001/05/10 15:03:50 dpg1// Update cdrStreamAdapter to modified cdrStream interface.//// Revision 1.1.2.1 2001/01/09 17:17:00 dpg1// New cdrStreamAdapter class to allow omniORBpy to intercept buffer// management.//#include <omniORB4/CORBA.h>#include <omniORB4/cdrStream.h>OMNI_NAMESPACE_BEGIN(omni) class StreamAdapterStateCopier { public: inline StreamAdapterStateCopier(cdrStreamAdapter* s) : pd_s(s) { s->copyStateToActual(); } inline ~StreamAdapterStateCopier() { pd_s->copyStateFromActual(); } private: cdrStreamAdapter* pd_s; };OMNI_NAMESPACE_END(omni)OMNI_USING_NAMESPACE(omni)voidcdrStreamAdapter::put_octet_array(const _CORBA_Octet* b, int size, omni::alignment_t align){ StreamAdapterStateCopier _c(this); pd_actual.put_octet_array(b, size, align);}voidcdrStreamAdapter::get_octet_array(_CORBA_Octet* b,int size, omni::alignment_t align){ StreamAdapterStateCopier _c(this); pd_actual.get_octet_array(b, size, align);}voidcdrStreamAdapter::skipInput(_CORBA_ULong size){ StreamAdapterStateCopier _c(this); pd_actual.skipInput(size);}_CORBA_BooleancdrStreamAdapter::checkInputOverrun(_CORBA_ULong itemSize, _CORBA_ULong nItems, omni::alignment_t align){ StreamAdapterStateCopier _c(this); return pd_actual.checkInputOverrun(itemSize, nItems, align);}_CORBA_BooleancdrStreamAdapter::checkOutputOverrun(_CORBA_ULong itemSize, _CORBA_ULong nItems, omni::alignment_t align){ StreamAdapterStateCopier _c(this); return pd_actual.checkOutputOverrun(itemSize, nItems, align);}voidcdrStreamAdapter::copy_to(cdrStream& stream, int size, omni::alignment_t align){ StreamAdapterStateCopier _c(this); pd_actual.copy_to(stream, size, align);}voidcdrStreamAdapter::fetchInputData(omni::alignment_t align,size_t required){ StreamAdapterStateCopier _c(this); pd_actual.fetchInputData(align, required);}_CORBA_BooleancdrStreamAdapter::reserveOutputSpaceForPrimitiveType(omni::alignment_t align, size_t required){ StreamAdapterStateCopier _c(this); return pd_actual.reserveOutputSpaceForPrimitiveType(align, required);}_CORBA_BooleancdrStreamAdapter::maybeReserveOutputSpace(omni::alignment_t align, size_t required){ StreamAdapterStateCopier _c(this); return pd_actual.maybeReserveOutputSpace(align, required);}_CORBA_ULongcdrStreamAdapter::currentInputPtr() const{ copyStateToActual(); return pd_actual.currentInputPtr();}_CORBA_ULongcdrStreamAdapter::currentOutputPtr() const{ copyStateToActual(); return pd_actual.currentOutputPtr();}_CORBA_ULongcdrStreamAdapter::completion(){ StreamAdapterStateCopier _c(this); return pd_actual.completion();}void*cdrStreamAdapter::ptrToClass(int* cptr){ if (cptr == &cdrStreamAdapter::_classid) return (cdrStreamAdapter*)this; if (cptr == &cdrStream ::_classid) return (cdrStream*) this; return pd_actual.ptrToClass(cptr);}int cdrStreamAdapter::_classid;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -