⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 template.py

📁 编译工具
💻 PY
📖 第 1 页 / 共 2 页
字号:
# -*- python -*-#                           Package   : omniidl# template.py               Created on: 2000/01/20#			    Author    : David Scott (djs)##    Copyright (C) 1999 AT&T Laboratories Cambridge##  This file is part of omniidl.##  omniidl is free software; you can redistribute it and/or modify it#  under the terms of the GNU General Public License as published by#  the Free Software Foundation; either version 2 of the License, or#  (at your option) any later version.##  This program 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#  General Public License for more details.##  You should have received a copy of the GNU General Public License#  along with this program; if not, write to the Free Software#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA#  02111-1307, USA.## Description:#   #   C++ templates for the DynSK.cc file# $Id: template.py,v 1.3.2.14 2005/08/15 11:10:53 dgrisby Exp $# $Log: template.py,v $# Revision 1.3.2.14  2005/08/15 11:10:53  dgrisby# Changes on 22 July broke the stubs for MSVC and maybe other compilers.## Revision 1.3.2.13  2005/07/22 09:52:56  dgrisby# Remove more gcc warnings. Thanks Matej Kenda.## Revision 1.3.2.12  2001/10/29 17:42:39  dpg1# Support forward-declared structs/unions, ORB::create_recursive_tc().## Revision 1.3.2.11  2001/08/29 13:41:04  dpg1# jnw's fix for compilers with variable sizeof(enum)## Revision 1.3.2.10  2001/08/22 13:29:48  dpg1# Re-entrant Any marshalling.## Revision 1.3.2.9  2001/08/15 10:29:53  dpg1# Update DSI to use Current, inProcessIdentity.## Revision 1.3.2.8  2001/06/13 17:26:41  sll# Remove '+' from 'namespace' in the generated code.## Revision 1.3.2.7  2001/06/08 17:12:15  dpg1# Merge all the bug fixes from omni3_develop.## Revision 1.3.2.6  2001/04/19 09:30:12  sll#  Big checkin with the brand new internal APIs.# Scoped where appropriate with the omni namespace.## Revision 1.3.2.5  2001/03/13 10:32:08  dpg1# Fixed point support.## Revision 1.3.2.4  2000/11/20 14:43:24  sll# Added support for wchar and wstring.## Revision 1.3.2.3  2000/11/03 19:21:55  sll# Use include omniORB4 in the generated code.## Revision 1.3.2.2  2000/10/12 15:37:50  sll# Updated from omni3_1_develop.## Revision 1.4  2000/07/13 15:26:00  dpg1# Merge from omni3_develop for 3.0 release.## Revision 1.1.2.10  2000/07/04 12:57:52  djs# Fixed Any insertion/extraction operators for unions and exceptions## Revision 1.1.2.9  2000/06/30 09:33:05  djs# Removed more possible nameclashes with user supplied names.## Revision 1.1.2.8  2000/06/27 16:15:10  sll# New classes: _CORBA_String_element, _CORBA_ObjRef_Element,# _CORBA_ObjRef_tcDesc_arg to support assignment to an element of a# sequence of string and a sequence of object reference.## Revision 1.1.2.7  2000/06/26 16:23:27  djs# Refactoring of configuration state mechanism.## Revision 1.1.2.6  2000/06/05 13:03:05  djs# Removed union member name clash (x & pd_x, pd__default, pd__d)# Removed name clash when a sequence is called "pd_seq"## Revision 1.1.2.5  2000/05/31 18:02:51  djs# Better output indenting (and preprocessor directives now correctly output at# the beginning of lines)## Revision 1.1.2.4  2000/03/28 18:28:23  djs# Sequence deletion function used unescaped name "data" which could clash with a# user identifier#   eg typedef sequence<char> data# produces output that could not be parsed.## Revision 1.1.2.3  2000/03/24 16:18:25  djs# Added missing prefix to CORBA::Any extraction operators used for#   typedef sequence<X> Y# (typedef sequence<long> a; would not produce C++ which gcc could parse)## Revision 1.1.2.2  2000/02/16 18:34:49  djs# Fixed problem generating fragments in DynSK.cc file## Revision 1.1.2.1  2000/02/15 15:36:25  djs# djr's and jnw's "Super-Hacky Optimisation" patched and added## Revision 1.1  2000/01/20 18:26:45  djs# Moved large C++ output strings into an external template file#"""C++ templates for the DynSK.cc file"""header_comment = """\// This file is generated by @program@- @library@. Do not edit."""header = """\#include "@basename@@hh@"#include <omniORB4/tcDescriptor.h>OMNI_USING_NAMESPACE(omni)static const char* @prefix@_dyn_library_version = @library@;"""# Required symbols:#   @private_prefix@_buildDesc_cstring# Generated symbols:#   @private_prefix@_buildDesc_c@n@stringbdesc_string = """\#ifndef @private_prefix@_buildDesc_c@n@string#define @private_prefix@_buildDesc_c@n@string @private_prefix@_buildDesc_cstring#endif"""# Required symbols:#   @private_prefix@_buildDesc_cwstring# Generated symbols:#   @private_prefix@_buildDesc_c@n@wstringbdesc_wstring = """\#ifndef @private_prefix@_buildDesc_c@n@wstring#define @private_prefix@_buildDesc_c@n@wstring @private_prefix@_buildDesc_cwstring#endif"""# Required symbols:#   @private_prefix@_buildDesc_cfixed# Generated symbols:#   @private_prefix@_buildDesc_c@digits@_@scale@fixedbdesc_fixed = """\#ifndef @private_prefix@_buildDesc_c@digits@_@scale@fixed#define @private_prefix@_buildDesc_c@digits@_@scale@fixed @private_prefix@_buildDesc_cfixed#endif"""# Required symbols:#   NONE# Generated symbols:#   @private_prefix@_tcParser_getElementDesc@this_cname@getdesc_array = """\#ifndef _@private_prefix@_tcParser_getElementDesc@this_cname@__#define _@private_prefix@_tcParser_getElementDesc@this_cname@__static CORBA::Boolean@private_prefix@_tcParser_getElementDesc@this_cname@(const tcArrayDesc* _adesc, CORBA::ULong _index, tcDescriptor &_desc, _CORBA_ULong& _contiguous){  @type@ (&@private_prefix@_tmp)@tail_dims@ = (*((@type@(*)@index_string@)_adesc->opq_array))[_index];  @builddesc@  return 1;}#endif"""# Requried symbols:#   @private_prefix@_tcParser_getElementDesc@decl_cname@# Generated symbols:#   @private_prefix@_buildDesc@decl_cname@builddesc_array = """\#ifndef _@private_prefix@_tcParser_buildDesc@decl_cname@__#define _@private_prefix@_tcParser_buildDesc@decl_cname@__static void@private_prefix@_buildDesc@decl_cname@(tcDescriptor& _desc, const @dtype@(*_data)@tail_dims@){  _desc.p_array.getElementDesc = @private_prefix@_tcParser_getElementDesc@decl_cname@;  _desc.p_array.opq_array = OMNI_CONST_VOID_CAST(_data);}#endif"""# Required symbols:#   NONE# Generated symbols:#   @private_prefix@_buildDesc@cname@builddesc_extern = """\@where@void @private_prefix@_buildDesc@cname@(tcDescriptor &, const @name@&);"""# Required symbols:#   NONE# Generated symbols:#   @private_prefix@_buildDesc@cname@builddesc_forward = """\void @private_prefix@_buildDesc@cname@(tcDescriptor &, const @name@&);"""# Required symbols:#   NONEsequence_elementDesc_contiguous = """\_newdesc.p_streamdata = @sequence@->NP_data();_contiguous = @sequence@->length() - _index;"""# Required symbols:#   @private_prefix@_buildDesc@thing_cname@sequence_elementDesc_noncontiguous = """\@private_prefix@_buildDesc@thing_cname@(_newdesc, @thing@);"""# Required symbols:#   NONE# Generated symbolc:#   @private_prefix@_tcParser_setElementCount@cname@#   @private_prefix@_tcParser_getElementCount@cname@#   @private_prefix@_tcParser_getElementDesc@cname@anon_sequence = """\#ifndef _@private_prefix@_tcParser_buildDesc@cname@__#define _@private_prefix@_tcParser_buildDesc@cname@__static void@private_prefix@_tcParser_setElementCount@cname@(const tcSequenceDesc* _desc, CORBA::ULong _len){  ((@sequence_template@*)_desc->opq_seq)->length(_len);}static CORBA::ULong@private_prefix@_tcParser_getElementCount@cname@(const tcSequenceDesc* _desc){  return ((@sequence_template@*)_desc->opq_seq)->length();}static CORBA::Boolean@private_prefix@_tcParser_getElementDesc@cname@(const tcSequenceDesc* _desc, CORBA::ULong _index, tcDescriptor& _newdesc, _CORBA_ULong& _contiguous){  @elementDesc@  return 1;}static void@private_prefix@_buildDesc@cname@(tcDescriptor &_desc, const @sequence_template@& _data){  _desc.p_sequence.opq_seq = OMNI_CONST_VOID_CAST(&_data);  _desc.p_sequence.setElementCount =    @private_prefix@_tcParser_setElementCount@cname@;  _desc.p_sequence.getElementCount =    @private_prefix@_tcParser_getElementCount@cname@;  _desc.p_sequence.getElementDesc =    @private_prefix@_tcParser_getElementDesc@cname@;  }#endif"""# Required symbols:#   @private_prefix@_tcParser_getMemberDesc_@guard_name@ # Generated symbols:#   @private_prefix@_tcParser_getMemberCount_@guard_name@#   @private_prefix@_buildDesc_c@guard_name@builddesc_member = """\@private_prefix@_tcParser_getMemberCount_@guard_name@(const tcStructDesc *_desc){  return @num_members@;}void @private_prefix@_buildDesc_c@guard_name@(tcDescriptor &_desc, const @fqname@& _data){  _desc.p_struct.getMemberDesc = @private_prefix@_tcParser_getMemberDesc_@guard_name@;  _desc.p_struct.getMemberCount = @private_prefix@_tcParser_getMemberCount_@guard_name@;  _desc.p_struct.opq_struct = OMNI_CONST_VOID_CAST(&_data);}"""# Required symbols:#   @private_prefix@_tcParser_setObjectPtr_@guard_name@#   @private_prefix@_tcParser_getObjectPtr_@guard_name@#   @private_prefix@_buildDesc_c@guard_name@# Generated symbols:#   @private_prefix@_tcParser_setObjectPtr_@guard_name@#   @private_prefix@_tcParser_getObjectPtr_@guard_name@#   @private_prefix@_buildDesc_c@guard_name@#   @private_prefix@_delete_@guard_name@interface = """\static void@private_prefix@_tcParser_setObjectPtr_@guard_name@(const tcObjrefDesc *_desc, CORBA::Object_ptr _ptr){  @fqname@_ptr _p = @fqname@::_narrow(_ptr);  @fqname@_ptr* pp = (@fqname@_ptr*)_desc->opq_objref;  if (_desc->opq_release && !CORBA::is_nil(*pp)) CORBA::release(*pp);  *pp = _p;  CORBA::release(_ptr);}static CORBA::Object_ptr@private_prefix@_tcParser_getObjectPtr_@guard_name@(const tcObjrefDesc *_desc){  return (CORBA::Object_ptr) *((@fqname@_ptr*)_desc->opq_objref);}void @private_prefix@_buildDesc_c@guard_name@(tcDescriptor& _desc, const @objref_member@& _d){  _desc.p_objref.opq_objref = OMNI_CONST_VOID_CAST(&_d._data);  _desc.p_objref.opq_release = _d._rel;  _desc.p_objref.setObjectPtr = @private_prefix@_tcParser_setObjectPtr_@guard_name@;  _desc.p_objref.getObjectPtr = @private_prefix@_tcParser_getObjectPtr_@guard_name@;}void @private_prefix@_delete_@guard_name@(void* _data) {  CORBA::release((@fqname@_ptr) _data);}void operator<<=(CORBA::Any& _a, @fqname@_ptr _s) {  tcDescriptor tcd;  @objref_member@ tmp(_s,0);  @private_prefix@_buildDesc_c@guard_name@(tcd, tmp);  _a.PR_packFrom(@tc_name@, &tcd);}void operator<<=(CORBA::Any& _a, @fqname@_ptr* _sp) {  _a <<= *_sp;  CORBA::release(*_sp);  *_sp = @fqname@::_nil();}CORBA::Boolean operator>>=(const CORBA::Any& _a, @fqname@_ptr& _s) {  @fqname@_ptr sp = (@fqname@_ptr) _a.PR_getCachedData();  if (sp == 0) {    tcDescriptor tcd;    @fqname@_var tmp;    @private_prefix@_buildDesc_c@guard_name@(tcd, tmp);    if( _a.PR_unpackTo(@tc_name@, &tcd) ) {      if (!omniORB::omniORB_27_CompatibleAnyExtraction) {        (OMNI_CONST_CAST(CORBA::Any*, &_a))->PR_setCachedData((void*)(@fqname@_ptr)tmp,@private_prefix@_delete_@guard_name@);      }      _s = tmp._retn();      return 1;    } else {      _s = @fqname@::_nil(); return 0;    }  }  else {    CORBA::TypeCode_var tc = _a.type();    if (tc->equivalent(@tc_name@)) {    _s = sp; return 1;    }    else {    _s = @fqname@::_nil(); return 0;    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -