| ## Copyright 2007-2008 Cisco Systems Inc. |
| ## |
| ## Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| ## use this file except in compliance with the License. You may obtain a copy |
| ## of the License at |
| ## |
| ## http://www.apache.org/licenses/LICENSE-2.0 |
| ## |
| ## Unless required by applicable law or agreed to in writing, software |
| ## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| ## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| ## License for the specific language governing permissions and limitations |
| ## under the License. |
| // This file automatically generated by: |
| // $version |
| // $now |
| // This file is automatically created and should not be edited! |
| #set($i = $intf.name()) |
| #set($vfname = "ValueFactory$i") |
| #set($intfname = "$i$suffix") |
| #set($clname = "Remote$intfname") |
| |
| using System; |
| |
| namespace $intf.parent().name() |
| { |
| |
| #if (!$hasBaseClass) |
| #end |
| #foreach( $n in $intf.iterator() ) |
| #if ($n.isExtern()) |
| #if ($n.hasImport( $helper )) |
| using $n.getImport( $helper ); |
| #end |
| #end |
| #end |
| ///<summary>Call to message translator for $intfname.</summary> |
| #if ($hasBaseClass) |
| public class $clname : Remote$i, $intfname |
| #else |
| public class $clname : Org.Apache.Etch.Bindings.Csharp.Support.RemoteBase, $intfname |
| #end |
| { |
| #if ($hasBaseClass) |
| ///<summary>Class Instance used to hide synchronous message |
| ///implementation. Use this to invoke the asynchronous message |
| ///implementation</summary> |
| public new readonly _Async _async; |
| |
| ///<summary>Deprecated.</summary> |
| public new readonly _Async _inner; |
| #else |
| ///<summary>Class Instance used to hide synchronous message |
| ///implementation. Use this to invoke the asynchronous message |
| ///implementation</summary> |
| public readonly _Async _async; |
| |
| ///<summary>Deprecated.</summary> |
| public readonly _Async _inner; |
| #end |
| |
| /// <summary>Constructs the $clname.</summary> |
| /// <param name="svc"></param> |
| /// <param name="vf"></param> |
| public $clname( Org.Apache.Etch.Bindings.Csharp.Support.DeliveryService svc, |
| Org.Apache.Etch.Bindings.Csharp.Msg.ValueFactory vf ) |
| : base( svc, vf ) |
| { |
| _async = new _Async(this); |
| _inner = _async; |
| #set( $k = 0 ) |
| #foreach( $x in $intf.iterator() ) |
| #if( $x.isMixin() ) |
| #set( $k = $k + 1 ) |
| #set( $v = "_mixin$k" ) |
| #set( $m = $x.getModule() ) |
| #set( $z = $m.iterator().next() ) |
| $v = new ${m.name()}.Remote$z.name()${suffix}( svc, vf ); |
| #end |
| #end |
| } |
| |
| #foreach ($n in $intf.iterator()) |
| #if ($n.isMsgDir($mc)) |
| #if (!$n.isHidden()) |
| #if(!$methodList.contains($n.name().name())) |
| #set ( $addMethodListStatus = $methodList.add($n.name().name())) |
| #if ($n.isOneway()) |
| #if ($n.hasDescr()) |
| ///<summary> |
| #foreach($s in $n.descr()) |
| ///$s |
| #end |
| ///</summary> |
| #end |
| #foreach( $p in $n.iterator() ) |
| #set($first = true) |
| #set ($count = 0) |
| #if ($p.hasDescr()) |
| #foreach( $s in $p.descr() ) |
| #if ($first) |
| #set($count = $count + 1) |
| #set($first = false) |
| ///<param name="$p.name()">$s |
| #else |
| ///$s |
| #end |
| #end |
| #if ($count > 0) |
| ///</param> |
| #end |
| #end |
| #end |
| #if ($n.hasReturn()) |
| #set($first = true) |
| #set ($retCount = 0) |
| #if ($n.hasDescr()) |
| #foreach( $s in $n.returnDescr() ) |
| #if ($first) |
| #set($retCount = $retCount + 1) |
| #set($first = false) |
| ///<returns>$s |
| #else |
| ///$s |
| #end |
| #end |
| #if ($retCount > 0) |
| ///</returns> |
| #end |
| #end |
| #end |
| #if ($n.hasThrown()) |
| #if ($n.hasDescr()) |
| #foreach($t in $n.thrown().iterator()) |
| ///<Exception cref="$t.name().name()"> throws $t.name().name()</Exception> |
| #end |
| #end |
| #end |
| public $helper.getTypeName( $n.type() ) $n.name()( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$helper.getTypeName( $p.type() ) $p.name() |
| #set( $sep = ", " ) |
| #end |
| ) |
| { |
| Org.Apache.Etch.Bindings.Csharp.Msg.Message _msg = _NewMessage( $vfname.$n.vname( $helper ) ); |
| #foreach( $p in $n.iterator() ) |
| _msg.Add( $vfname.$p.vname( $helper ), $p.name() ); |
| #end |
| try |
| { |
| _Send( _msg ); |
| } |
| catch ( Exception _e ) |
| { |
| throw new Exception( "unexpected", _e ); |
| } |
| } |
| #else |
| #if($n.hasDescr()) |
| ///<summary> |
| #foreach($s in $n.descr()) |
| ///$s |
| #end |
| ///</summary> |
| #end |
| #foreach( $p in $n.iterator() ) |
| #set($first = true) |
| #if ($p.hasDescr()) |
| #foreach( $s in $p.descr() ) |
| #if ($first) |
| #set($first = false) |
| ///<param name="$p.name()">$s |
| #else |
| ///$s |
| #end |
| #end |
| ///</param> |
| #end |
| #end |
| #if ($n.hasReturn()) |
| #set($first = true) |
| #set($retCount = 0) |
| #if ($n.hasDescr()) |
| #foreach( $s in $n.returnDescr() ) |
| #if ($first) |
| #set($first = false) |
| #set($retCount = $retCount + 1) |
| ///<returns>$s |
| #else |
| ///$s |
| #end |
| #end |
| #if ($retCount > 0) |
| ///</returns> |
| #end |
| #end |
| #end |
| #if ($n.hasThrown()) |
| #if ($n.hasDescr()) |
| #foreach($t in $n.thrown().iterator()) |
| ///<Exception cref="$t.name().name()"> throws $t.name().name()</Exception> |
| #end |
| #end |
| #end |
| public $helper.getTypeName( $n.type() ) $n.name()( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$helper.getTypeName( $p.type() ) $p.name() |
| #set( $sep = ", " ) |
| #end |
| ) |
| { |
| #if ($n.hasReturn()) |
| return |
| #end |
| _async._end_${n.name()}( _async._begin_${n.name()}( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$p.name() |
| #set( $sep = ", " ) |
| #end |
| ) ); |
| } |
| |
| #end |
| #end |
| #end |
| #end |
| #end |
| #set( $k = 0 ) |
| #foreach( $x in $intf.iterator() ) |
| #if( $x.isMixin() ) |
| |
| // ----- mixin $x.name() ----- // |
| #set( $k = $k + 1 ) |
| #set( $v = "_mixin$k" ) |
| #set( $m = $x.getModule() ) |
| #set( $z = $m.iterator().next() ) |
| private ${m.name()}.Remote$z.name()$suffix $v; |
| |
| #foreach( $n in $z.messages( true ) ) |
| #if($n.isMsgDir($mc)) |
| #if(!$n.isHidden()) |
| #if(!$methodList.contains($n.name().name())) |
| #set ( $addMethodListStatus = $methodList.add($n.name().name()) ) |
| // --- generated methods for $n.name() --- // |
| #if($n.isOneway()) |
| public $helper.getTypeName( $n.type() ) $n.name()( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$helper.getTypeName( $p.type() ) $p.name() |
| #set( $sep = ", " ) |
| #end |
| ) |
| { |
| ${v}.$n.name()( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$p.name() |
| #set( $sep = ", " ) |
| #end |
| ); |
| } |
| #else |
| public $helper.getTypeName( $n.type() ) $n.name()( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$helper.getTypeName( $p.type() ) $p.name() |
| #set( $sep = ", " ) |
| #end |
| ) |
| { |
| #if($n.hasReturn()) |
| return |
| #end |
| ${v}.$n.name()( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$p.name() |
| #set( $sep = ", " ) |
| #end |
| ); |
| } |
| |
| #end |
| #end |
| #end |
| #end |
| #end |
| #end |
| #end |
| |
| ///<summary>Asynchronous Implementation of service methods</summary> |
| #if ($hasBaseClass) |
| public new class _Async : Remote${i}._Async |
| #else |
| public class _Async |
| #end |
| { |
| #if ($hasBaseClass) |
| public new $clname _parent; |
| #else |
| public $clname _parent; |
| #end |
| |
| public _Async() |
| { |
| } |
| |
| public _Async($clname parent) |
| { |
| _parent = parent; |
| } |
| |
| #foreach ($n in $intf.iterator()) |
| #if ($n.isMsgDir($mc)) |
| #if (!$n.isHidden()) |
| #if(!$methodList.contains("_begin_end_$n.name().name()")) |
| #set ( $addMethodListStatus = $methodList.add("_begin_end_$n.name().name()") ) |
| #if (!$n.isOneway()) |
| ///<summary>Begins the call to ${n.name()}.</summary> |
| #foreach( $p in $n.iterator() ) |
| #if ($p.hasDescr()) |
| #set($first = true) |
| #foreach( $s in $p.descr() ) |
| #if ($first) |
| #set($first = false) |
| ///<param name = $p.name()>$s |
| #else |
| ///$s |
| #end |
| #end |
| ///</param> |
| #end |
| #end |
| ///<returns>mailbox to use to retrieve the result using _end_${n.name()}.</returns> |
| public Org.Apache.Etch.Bindings.Csharp.Support.Mailbox _begin_${n.name()}( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$helper.getTypeName( $p.type() ) $p.name() |
| #set( $sep = ", " ) |
| #end |
| ) |
| { |
| Org.Apache.Etch.Bindings.Csharp.Msg.Message _msg = _parent._NewMessage( $vfname.$n.vname( $helper ) ); |
| #foreach( $p in $n.iterator() ) |
| _msg.Add( $vfname.$p.vname( $helper ), $p.name() ); |
| #end |
| return _parent._BeginCall( _msg ); |
| } |
| |
| /// <summary>Waits for the call to end and returns the result.</summary> |
| /// <param name="_mb">mailbox returned by _begin_${n.name()}.</param> |
| public $helper.getTypeName( $n.type() ) _end_${n.name()}( Org.Apache.Etch.Bindings.Csharp.Support.Mailbox _mb ) |
| { |
| #if ($n.hasReturn()) |
| return |
| ($helper.getTypeName( $n.type() )) |
| #if ($n.type().dim() > 0) |
| // ValueFactory${i}.to_$n.type().type()( |
| // typeof( ${helper.getTypeName( $n.type() )} ), |
| #end |
| _parent._EndCall( _mb, |
| $vfname.$n.getResultMessage().vname( $helper ) ) |
| #if ($n.type().dim() > 0) |
| //) |
| #end |
| ; |
| #else |
| |
| _parent._EndCall( _mb, |
| $vfname.$n.getResultMessage().vname( $helper ) ); |
| #end |
| |
| } |
| |
| #end |
| #end |
| #end |
| #end |
| #end |
| #set( $k = 0 ) |
| #foreach( $x in $intf.iterator() ) |
| #if( $x.isMixin() ) |
| #set( $k = $k + 1 ) |
| #set( $v = "_mixin$k" ) |
| #set( $m = $x.getModule() ) |
| #set( $z = $m.iterator().next() ) |
| |
| #foreach( $n in $z.messages( true ) ) |
| #if($n.isMsgDir($mc)) |
| #if(!$n.isHidden()) |
| #if(!$methodList.contains("_begin_end_$n.name().name()")) |
| #set ( $addMethodListStatus = $methodList.add("_begin_end_$n.name().name()") ) |
| // --- generated methods for $n.name() --- // |
| |
| #if(! $n.isOneway()) |
| ///<summary>Begins a call to ${n.name()}.</summary> |
| #foreach( $p in $n.iterator() ) |
| #if ($p.hasDescr()) |
| #set($first = true) |
| #foreach( $s in $p.descr() ) |
| #if ($first) |
| #set($first = false) |
| ///<param name = $p.name()>$s |
| #else |
| ///$s |
| #end |
| #end |
| ///</param> |
| #end |
| #end |
| |
| public Org.Apache.Etch.Bindings.Csharp.Support.Mailbox _begin_${n.name()}( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$helper.getTypeName( $p.type() ) $p.name() |
| #set( $sep = ", " ) |
| #end |
| ) |
| { |
| return _parent.${v}._async._begin_${n.name()}( |
| #set( $sep = "" ) |
| #foreach( $p in $n.iterator() ) |
| $sep$p.name() |
| #set( $sep = ", " ) |
| #end |
| ); |
| } |
| |
| ///<summary>Ends a call to ${n.name()}</summary> |
| ///<param name = mb> mailbox returned by _begin_${n.name()}. </param> |
| public $helper.getTypeName( $n.type() ) _end_${n.name()}( Org.Apache.Etch.Bindings.Csharp.Support.Mailbox _mb ) |
| { |
| #if($n.hasReturn()) |
| return |
| #end |
| _parent.${v}._async._end_${n.name()}( _mb ); |
| } |
| #end |
| #end |
| #end |
| #end |
| #end |
| #end |
| #end |
| } |
| } |
| } |