Beispiel #1
0
csp::WorkResult::Enum csp::Process::Evaluate( Host& host, int numArgs )
{
	if( LuaThread().Status() != lua::Return::YIELD && LuaThread().Status() != lua::Return::OK )
		return WorkResult::FINISH;

	if( m_operation )
	{
		WorkResult::Enum result = m_operation->IsFinished()
			? WorkResult::FINISH
			: m_operation->Evaluate( host );

		if( result == WorkResult::FINISH )
		{
			lua::LuaStack luaStack = m_luaThread.GetStack();
			numArgs = m_operation->PushResults( luaStack );
			DeleteOperation( host );
		}
		else
			return WorkResult::YIELD;
	}
	
	WorkResult::Enum result = Resume( numArgs );
	
	if ( result == WorkResult::YIELD && m_operation )
		host.PushEvalStep( *this );
	else if ( result == WorkResult::FINISH && m_parentProcess )
	{
		if( host.GetTopProcess() != m_parentProcess )
			host.PushEvalStep( *m_parentProcess );
	}

	return result;
}
Beispiel #2
0
void csp::Process::Terminate( Host& host )
{
	if( m_operation )
	{
		m_operation->DoTerminate( host );
		DeleteOperation( host );
	}
	
	host.RemoveProcessFromStack( *this );
}
/**
Invokes an asynchronous move operation.
Moves the message from current location (drafts folder) to the outbox.
*/
void CSendAsSender::InvokeMoveOperationL()
	{
	iEntry = iClientMtm->Entry().Entry();
	iClientMtm->Entry().SetEntryL(iEntry.Parent());

	DeleteOperation();
	iOperation = iClientMtm->Entry().MoveL(iEntry.Id(), KMsvGlobalOutBoxIndexEntryId, iStatus);
	SetActive();

	iState = ESenderMoving;
	}
/**
Invokes an asychronous send operation.
*/
void CSendAsSender::InvokeSendOperationL()
	{
	// Buffer required for call to InvokeAsyncFunction, unused.
	TBuf8<1> buf;
	iClientMtm->Entry().SetEntryL(iEntry.Id());
	DeleteOperation();
	// Note: This operation must be a CMsvSendOperation as TMsvSendOperationProgress is needed
	iOperation = iClientMtm->InvokeAsyncFunctionL(KMTMStandardFunctionsSendMessage, *iSelection, buf, iStatus);
	SetActive();
	
	iState = ESenderSending;	
	}