示例#1
0
void Requestor::requestSynchCall( MemberOwner& owner, co::IMethod* method, 
                                           co::Slice<co::Any> args, const co::Any& ret )
{
    if( !_connected )
        CORAL_THROW( RemotingException, "Trying to request with the node stopped");
    
    InvocationDetails details( owner.instanceID, owner.facetID, method->getIndex(), 
                              owner.inheritanceDepth, true );
    ParameterPusher& pusher = _marshaller.beginInvocation( _publicEndpoint, details );
    
    pushParameters( method, args, pusher );
    
    std::string msg;
    _marshaller.marshalInvocation( msg );

    _handler->handleSynchRequest( msg, msg );

	MessageType msgType = _demarshaller.demarshal( msg );
    
    if( msgType == EXCEPTION )
        raiseReturnedException( _demarshaller );
    
	ParameterPuller& puller = _demarshaller.getOutput();

	if( method->getReturnType() )
		getReturn( puller, method->getReturnType(), ret );

	co::TSlice<co::IParameter*> params = method->getParameters();
	for( int i = 0; i < params.getSize(); i++ )
	{
		if( params[i]->getIsOut() )
			getReturn( puller, params[i]->getType(), args[i] );
	}
}
示例#2
0
文件: cfg.cpp 项目: h87kg/pyston
    void doReturn(AST_expr* value) {
        assert(value);
        CFGBlock *rtn_dest = getReturn();
        if (rtn_dest != NULL) {
            push_back(makeAssign("#rtnval", value));

            AST_Jump *j = makeJump();
            j->target = rtn_dest;
            curblock->connectTo(rtn_dest);
            push_back(j);
        } else {
            AST_Return *node = new AST_Return();
            node->value = value;
            node->col_offset = value->col_offset;
            node->lineno = value->lineno;
            push_back(node);
        }
        curblock = NULL;
    }
示例#3
0
void Requestor::requestGetField( MemberOwner& owner, co::IField* field, const co::Any& ret )
{
    if( !_connected )
        CORAL_THROW( RemotingException, "Trying to request with the node stopped");
    
    InvocationDetails details( owner.instanceID, owner.facetID, field->getIndex(), 
                              owner.inheritanceDepth, true );
    _marshaller.beginInvocation( _publicEndpoint, details );
    
    std::string msg;
    _marshaller.marshalInvocation( msg );
    _handler->handleSynchRequest( msg, msg );
    
    MessageType msgType = _demarshaller.demarshal( msg );
    
    if( msgType == EXCEPTION )
        raiseReturnedException( _demarshaller );
    
	ParameterPuller& puller = _demarshaller.getOutput();

	getReturn( puller, field->getType(), ret );
}