Example #1
0
 function get_csharp_return_type()
 {
     return thelpers::get_csharp_type_name($this->ret);
 }
Example #2
0
function generate_request_helper($client, $func, $async, $serialization_fmt)
{
    echo $client;
    ?>
.prototype.internal_<?php 
    if ($async) {
        echo "async_";
    }
    echo $func->name;
    ?>
 = function(args, <?php 
    if ($async) {
        echo "on_success, on_fail,";
    }
    ?>
 hash) {
    var self = this;
    var ret = null;
    dsn_call(
        this.get_<?php 
    echo $func->name;
    ?>
_address(hash),
        "POST",
<?php 
    if ($func->params[0]->is_base_type()) {
        ?>
        this.marshall_basic_type(args, "<?php 
        echo $func->get_return_type();
        ?>
"),
<?php 
    } else {
        ?>
        this.marshall_generated_type(args),
<?php 
    }
    ?>
        "<?php 
    echo $serialization_fmt;
    ?>
",
        <?php 
    if ($async) {
        echo "true";
    } else {
        echo "false";
    }
    ?>
,
        function(result) {
<?php 
    if (thelpers::is_base_type($func->ret)) {
        ?>
            ret = self.unmarshall_basic_type(result, "<?php 
        echo $func->get_return_type();
        ?>
");
<?php 
    } else {
        ?>
            ret = new <?php 
        echo $func->get_cpp_return_type();
        ?>
();
            self.unmarshall_generated_type(result, ret);
<?php 
    }
    if ($async) {
        ?>
            on_success(ret);
<?php 
    }
    ?>
        },
        function(xhr, textStatus, errorThrown) {
            ret = null;
<?php 
    if ($async) {
        ?>
            if (on_fail) {
                on_fail(xhr, textStatus, errorThrown);
            }
<?php 
    }
    ?>
        }
    );
    return ret;
}

<?php 
}