-
_j<c       s    d  Z  U Z d Z ^ d Z  d Z  d Z  d Z  d Z  d Z  d Z  d	 Z	  d
 Z
  d Z d Z d Z *d Z /d Z 5d Z Sd Z Yd Z ^d Z dd Z kd Z qd Z ud Z zd Z ~d Z d Z d Z d Z d Z d Z d Z d  Z  d! Z!  d" Z" .d# Z# 4d$ Z$ 8d% Z% Zd& Z& ed' Z' od( Z( zd) Z) ~d* Z* d+ Z+ d, Z, d- Z- d. Z. d/ Z/ d0 S(1   s    C++ templates for the SK.cc files'   POA_@fqname@::~@POA_prefix@@name@() {}
si  @name@_ptr @name@_Helper::_nil() {
  return @name@::_nil();
}

CORBA::Boolean @name@_Helper::is_nil(@name@_ptr p) {
  return CORBA::is_nil(p);

}

void @name@_Helper::release(@name@_ptr p) {
  CORBA::release(p);
}

void @name@_Helper::duplicate(@name@_ptr p) {
  if( p && !p->_NP_is_nil() )  omni::duplicateObjRef(p);
}

size_t @name@_Helper::NP_alignedSize(@name@_ptr obj, size_t offset) {
  return @name@::_alignedSize(obj, offset);
}

void @name@_Helper::marshalObjRef(@name@_ptr obj, NetBufferedStream& s) {
  @name@::_marshalObjRef(obj, s);
}

@name@_ptr @name@_Helper::unmarshalObjRef(NetBufferedStream& s) {
  return @name@::_unmarshalObjRef(s);
}

void @name@_Helper::marshalObjRef(@name@_ptr obj, MemBufferedStream& s) {
  @name@::_marshalObjRef(obj, s);
}

@name@_ptr @name@_Helper::unmarshalObjRef(MemBufferedStream& s) {
  return @name@::_unmarshalObjRef(s);
}
s  @name@_ptr
@name@::_duplicate(@name@_ptr obj)
{
  if( obj && !obj->_NP_is_nil() )  omni::duplicateObjRef(obj);

  return obj;
}


@name@_ptr
@name@::_narrow(CORBA::Object_ptr obj)
{
  if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil();
  _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId);
  return e ? e : _nil();
}


@name@_ptr
@name@::_nil()
{
  static @objref_name@* _the_nil_ptr = 0;
  if( !_the_nil_ptr ) {
    omni::nilRefLock().lock();
  if( !_the_nil_ptr )  _the_nil_ptr = new @objref_name@;
    omni::nilRefLock().unlock();
  }
  return _the_nil_ptr;
}

const char* @name@::_PD_repoId = "@repoID@";

s  @fq_objref_name@::~@objref_name@() {}


@fq_objref_name@::@objref_name@(const char* mdri,
   IOP::TaggedProfileList* p, omniIdentity* id, omniLocalIdentity* lid) :
   @inherits_str@
   omniObjRef(@name@::_PD_repoId, mdri, p, id, lid)
{
  _PR_setobj(this);
}

void*
@fq_objref_name@::_ptrToObjRef(const char* id)
{
  if( !strcmp(id, CORBA::Object::_PD_repoId) )
    return (CORBA::Object_ptr) this;
  if( !strcmp(id, @name@::_PD_repoId) )
    return (@name@_ptr) this;
  @inherited_repoIDs@
  return 0;
}
sC   static const char*const @context_descriptor@[] = {
  @contexts@
};
s  // Local call call-back function.
static void
@local_call_descriptor@(omniCallDescriptor* cd, omniServant* svnt)
{
  @get_call_descriptor@
  @impl_fqname@* impl = (@impl_fqname@*) svnt->_ptrToInterface(@name@::_PD_repoId);
  @result@impl->@cxx_operation_name@(@operation_arguments@);
}
s_  // Proxy call descriptor class. Mangled signature:
//  @signature@
class @call_descriptor@
  : public omniCallDescriptor
{
public:
  inline @call_descriptor@(@ctor_args@):
     @inherits_list@ {}
  
  @marshal_arguments_decl@
  @unmarshal_arguments_decl@  
  @user_exceptions_decl@
  @result_member_function@
  @member_data@
  @result_member_data@
};
s{   void @call_descriptor@::unmarshalReturnedValues(GIOP_C& giop_client)
{
  @pre_decls@
  @unmarshal_block@
  @post_assign@
}
sT   void @call_descriptor@::marshalArguments(GIOP_C& giop_client)
{
  @marshal_block@
}
sm   CORBA::ULong @call_descriptor@::alignedSize(CORBA::ULong msgsize)
{
  @size_calculation@
  return msgsize;
}
s   void @call_descriptor@::userException(GIOP_C& giop_client, const char* repoId)
{
  @exception_block@
  else {
    giop_client.RequestCompleted(1);
    throw CORBA::MARSHAL(0, CORBA::COMPLETED_MAYBE);
  }
}
s   @result_type@ @objref_fqname@::@operation_name@(@arguments@)
{
  @call_descriptor@ _call_desc(@call_desc_args@);
  @context@
  _invoke(_call_desc);
  @return_string@
}
s  @pof_name@::~@uname@() {}


omniObjRef*
@pof_name@::newObjRef(const char* mdri, IOP::TaggedProfileList* p,
               omniIdentity* id, omniLocalIdentity* lid)
{
  return new @objref_fqname@(mdri, p, id, lid);
}


CORBA::Boolean
@pof_name@::is_a(const char* id) const
{
  if( !strcmp(id, @name@::_PD_repoId) )
    return 1;
  @Other_repoIDs@
  return 0;
}

const @pof_name@ _the_pof_@idname@;
s7   if( !strcmp(id, @inherited@::_PD_repoId) )
  return 1;
sx   typedef @fqname@ @flat_fqname@;
typedef @impl_fqname@ @impl_flat_fqname@;
typedef @objref_fqname@ @objref_flat_fqname@;
s  @impl_fqname@::~_impl_@uname@() {}


CORBA::Boolean
@impl_fqname@::_dispatch(GIOP_S& giop_s)
{
  @this_dispatch@
  @inherited_dispatch@
  return 0;
}

void*
@impl_fqname@::_ptrToInterface(const char* id)
{
  if( !strcmp(id, CORBA::Object::_PD_repoId) )
    return (void*) 1;
  if( !strcmp(id, @name@::_PD_repoId) )
    return (@impl_name@*) this;
  @Other_repoIDs@
  return 0;
}

const char*
@impl_fqname@::_mostDerivedRepoId()
{
  return @name@::_PD_repoId;
}
s?   if( @impl_inherited_name@::_dispatch(giop_s) ) {
  return 1;
}
sX   if( !strcmp(id, @inherited_name@::_PD_repoId) )
  return (@impl_inherited_name@*) this;
s]   @sk_fqname@::@sk_name@(const omniOrbBoaKey& k) { pd_key = k; }

@sk_fqname@::~@sk_name@() {}
sj   static const char* const _user_exns[] = {
  @repoID_list@
};
giop_s.set_user_exceptions(_user_exns, @n@);
s;   #ifndef HAS_Cplusplus_catch_exception_by_base
try {
#endif
s0   #ifndef HAS_Cplusplus_catch_exception_by_base
}
sP   catch(@exname@& ex) {
  throw omniORB::StubUserException(ex._NP_duplicate());
}
s   #endif
sL   CORBA::Context_var _ctxt;
_ctxt = CORBA::Context::unmarshalContext(giop_s);
s(  if( !strcmp(giop_s.operation(), "@idl_operation_name@") ) {
  @exception_decls@
  @get_arguments@
  @get_context@
  giop_s.RequestReceived();
  @decl_result@
  @try_@
  @result_assignment@this->@operation_name@(@argument_list@);
  @catch@
  if( giop_s.response_expected() ) {
    size_t msgsize = (size_t) GIOP_S::ReplyHeaderSize();
    @size_calculation_results@
    @size_calculation_arguments@
    giop_s.InitialiseReply(GIOP::NO_EXCEPTION, (CORBA::ULong) msgsize);
    @put_results@
    @put_arguments@
  }
  giop_s.ReplyCompleted();
  return 1;
}
s  if( !strcmp(giop_s.operation(), "_get_@attrib_name@") ) {    
  giop_s.RequestReceived();
  @attrib_type@ result = this->@cxx_attrib_name@();
  if( giop_s.response_expected() ) {
    size_t msgsize = (size_t) GIOP_S::ReplyHeaderSize();
    @size_calculation@
    giop_s.InitialiseReply(GIOP::NO_EXCEPTION, (CORBA::ULong) msgsize);
    @marshall_result@
  }
  giop_s.ReplyCompleted();
  return 1;
}
sw  if( !strcmp(giop_s.operation(), "_set_@attrib_name@") ) {
  @attrib_type@ value;
  @unmarshall_value@
  giop_s.RequestReceived();
  this->@cxx_attrib_name@(value);
  if( giop_s.response_expected() ) {
    size_t msgsize = (size_t) GIOP_S::ReplyHeaderSize();
    giop_s.InitialiseReply(GIOP::NO_EXCEPTION, (CORBA::ULong) msgsize);
  }
  giop_s.ReplyCompleted();
  return 1;
}
s  
@fq_derived@_slice* @fq_derived@_alloc() {
  return new @fq_derived@_slice@decl_first_dim_str@;
}

@fq_derived@_slice* @fq_derived@_dup(const @fq_derived@_slice* _s)
{
  if (!_s) return 0;
  @fq_derived@_slice* _data = @fq_derived@_alloc();
  if (_data) {
    @dup_loop@
  }
  return _data;
}

void @fq_derived@_copy(@fq_derived@_slice* _to, const @fq_derived@_slice* _from) {
  @copy_loop@
}

void @fq_derived@_free(@fq_derived@_slice* _s) {
  delete [] _s;
}
su  @fq_derived@_slice* @fq_derived@_alloc() {
  return @fq_aliased@_alloc();
}

@fq_derived@_slice* @fq_derived@_dup(const @fq_derived@_slice* p) {
  return @fq_aliased@_dup(p);
}

void @fq_derived@_copy( @fq_derived@_slice* _to, const @fq_derived@_slice* _from){
  @fq_aliased@_copy(_to, _from);
}

void @fq_derived@_free( @fq_derived@_slice* p) {
   @fq_aliased@_free(p);
}
s  size_t
@name@::_NP_alignedSize(size_t _initialoffset) const
{
  CORBA::ULong _msgsize = _initialoffset;
  @size_calculation@
  return _msgsize;
}

void
@name@::operator>>= (NetBufferedStream &_n) const
{
  @marshall_code@
}

void
@name@::operator<<= (NetBufferedStream &_n)
{
  @net_unmarshall_code@
}

void
@name@::operator>>= (MemBufferedStream &_n) const
{
  @marshall_code@
}

void
@name@::operator<<= (MemBufferedStream &_n)
{
  @mem_unmarshall_code@
}
sO   if (_pd__default) {
  @size_calc@
}
else {
  switch(_pd__d){
    @cases@
  }
}
s   switch(_pd__d){
  @cases@
}
s   size_t
@name@::_NP_alignedSize(size_t initialoffset) const
{
  CORBA::ULong _msgsize = initialoffset;
  @discriminator_size_calc@

  @switch@

  return _msgsize;
}
s4   #ifndef HAS_Cplusplus_Bool
  default: break;
#endif
s   default: break;
s  void
@name@::operator>>= (NetBufferedStream& _n) const
{
  _pd__d >>= _n;
  @marshal_cases@
}

void
@name@::operator<<= (NetBufferedStream& _n)
{
  _pd__d <<= _n;
  switch(_pd__d) {
    @unmarshal_cases@
  }
}

void
@name@::operator>>= (MemBufferedStream& _n) const
{
  _pd__d >>= _n;
  @marshal_cases@
}

void
@name@::operator<<= (MemBufferedStream& _n)
{
  _pd__d <<= _n;
  switch(_pd__d) {
    @unmarshal_cases@
  }
}
sN   if (_pd__default) {
  @default@
}
else {
  switch(_pd__d) {
    @cases@
  }
}
s   switch(_pd__d) {
  @cases@
}
s   #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER)
// MSVC++ does not give the constant external linkage othewise.
@open_namespace@
  extern const @type@ @simple_name@ = @value@;
@close_namespace@
#else
const @type@ @name@ = @value@;
#endif
s   const @type@ @name@ = @value@;
s2   const @type@ @name@ _init_in_cldef_( = @value@ );
s0   _init_in_def_( const @type@ @name@ = @value@; )
s$  CORBA::Exception::insertExceptionToAny @scoped_name@::insertToAnyFn = 0;
CORBA::Exception::insertExceptionToAnyNCP @scoped_name@::insertToAnyFnNCP = 0;

@scoped_name@::@name@(const @scoped_name@& _s) : CORBA::UserException(_s)
{
  @copy_ctor_body@
}

@default_ctor@

@scoped_name@& @scoped_name@::operator=(const @scoped_name@& _s)
{
  ((CORBA::UserException*) this)->operator=(_s);
  @assign_op_body@
  return *this;
}

@scoped_name@::~@name@() {}

void @scoped_name@::_raise() { throw *this; }

@scoped_name@* @scoped_name@::_downcast(CORBA::Exception* _e) {
  return (@name@*) _NP_is_a(_e, "Exception/UserException/@scoped_name@");
}

const @scoped_name@* @scoped_name@::_downcast(const CORBA::Exception* _e) {
  return (const @name@*) _NP_is_a(_e, "Exception/UserException/@scoped_name@");
}

const char* @scoped_name@::_PD_repoId = "@repoID@";

CORBA::Exception* @scoped_name@::_NP_duplicate() const {
  return new @name@(*this);
}

const char* @scoped_name@::_NP_typeId() const {
  return "Exception/UserException/@scoped_name@";
}

const char* @scoped_name@::_NP_repoId(int* _size) const {
  *_size = sizeof("@repoID@");
  return "@repoID@";
}
 
void @scoped_name@::_NP_marshal(NetBufferedStream& _s) const {
  *this >>= _s;
}

void @scoped_name@::_NP_marshal(MemBufferedStream& _s) const {
  *this >>= _s;
}
s   @scoped_name@::@name@(@ctor_args@)
{
  pd_insertToAnyFn    = @scoped_name@::insertToAnyFn;
  pd_insertToAnyFnNCP = @scoped_name@::insertToAnyFnNCP;
  @default_ctor_body@
}
s  size_t
@scoped_name@::_NP_alignedSize(size_t _msgsize) const
{
  @aligned_size@
  return _msgsize;
}

void
@scoped_name@::operator>>= (NetBufferedStream& _n) const
{
  @net_marshal@
}

void
@scoped_name@::operator<<= (NetBufferedStream& _n)
{
  @net_unmarshal@
}

void
@scoped_name@::operator>>= (MemBufferedStream& _n) const
{
  @mem_marshal@
}

void
@scoped_name@::operator<<= (MemBufferedStream& _n)
{
  @mem_unmarshal@
}
s   {
  CORBA::String_member @private_prefix@_str_tmp;
  @private_prefix@_str_tmp <<= giop_s;
  @item_name@ = @private_prefix@_str_tmp._ptr;
  @private_prefix@_str_tmp._ptr = 0;
}
N(0   s   __doc__s   interface_POAs   interface_Helpers   interface_classs   interface_objrefs   interface_context_arrays   interface_callbacks   interface_proxy_classs   interface_proxy_unmarshals   interface_proxy_marshals   interface_proxy_alignments   interface_proxy_exns   interface_operations   interface_pofs   interface_pof_repoIDs   interface_ALIASs   interface_impls   interface_impl_inherit_dispatchs   interface_impl_repoIDs   interface_sks   interface_operation_exns   interface_operation_trys   interface_operation_catch_starts   interface_operation_catch_exns   interface_operation_catch_ends   interface_operation_contexts   interface_operation_dispatchs!   interface_attribute_read_dispatchs"   interface_attribute_write_dispatchs   typedef_global_array_declarators   typedef_global_simple_arrays   structs   union_align_nonexhaustives   union_align_exhaustives   unions   union_default_bools   union_defaults   union_operatorss   union_operators_nonexhaustives   union_operators_exhaustives   const_namespaces   const_simples   const_in_interfaces   const_init_in_defs	   exceptions   exception_default_ctors   exception_operatorss   unmarshal_string_tmp(/   s   interface_proxy_exns   interface_sks   union_operatorss   const_namespaces   interface_callbacks   interface_objrefs   union_align_exhaustives   interface_Helpers   exception_default_ctors   interface_classs   interface_operation_dispatchs   interface_operation_trys   interface_impl_inherit_dispatchs   structs   unions   interface_operation_exns   exception_operatorss   interface_operations   interface_operation_catch_ends   interface_impl_repoIDs   interface_proxy_alignments   interface_proxy_unmarshals   union_operators_nonexhaustives   interface_context_arrays   union_default_bools   const_init_in_defs   interface_impls   union_defaults   interface_proxy_classs   typedef_global_array_declarators   interface_POAs   const_in_interfaces   interface_ALIASs   interface_operation_contexts   interface_operation_catch_starts	   exceptions   typedef_global_simple_arrays   interface_pof_repoIDs   union_operators_exhaustives   interface_pofs   interface_operation_catch_exns   union_align_nonexhaustives   unmarshal_string_tmps"   interface_attribute_write_dispatchs   interface_proxy_marshals!   interface_attribute_read_dispatchs   const_simple(    (    s   ./cxx/skel/template.pys   ?U s^   		&	$																													&						"		
					6			$