当前位置: 首页>>代码示例>>C++>>正文


C++ DaoProcess_PutValue函数代码示例

本文整理汇总了C++中DaoProcess_PutValue函数的典型用法代码示例。如果您正苦于以下问题:C++ DaoProcess_PutValue函数的具体用法?C++ DaoProcess_PutValue怎么用?C++ DaoProcess_PutValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DaoProcess_PutValue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FRAME_GETMI

static void FRAME_GETMI( DaoProcess *proc, DaoValue *p[], int N )
{
	DaoxDataFrame *df, *self = (DaoxDataFrame*) p[0];
	int singleIndex1 = DaoxDF_IsSingleIndex( p[1] );
	int singleIndex2 = DaoxDF_IsSingleIndex( p[2] );
	int singleIndex3 = DaoxDF_IsSingleIndex( p[3] );

	DaoxDataFrame_Sliced( self );
	if( singleIndex1 && singleIndex2 && (singleIndex3 || self->dims[2] == 1) ){
		daoint i = DaoxDF_MakeIndex( self, DAOX_DF_ROW, p[1], proc );
		daoint j = DaoxDF_MakeIndex( self, DAOX_DF_COL, p[2], proc );
		daoint k = DaoxDF_MakeIndex( self, DAOX_DF_DEP, p[3], proc );
		daoint ik = k * self->dims[0] + i;
		DaoValue value = {0};
		if( i < 0 || j < 0 || k < 0 ) return;
		memset( & value, 0, sizeof(DaoValue) );
		DaoxDataColumn_GetCell( (DaoxDataColumn*) self->columns->items.pVoid[j], ik, & value );
		DaoProcess_PutValue( proc, & value );
	}else{
		df = DaoProcess_MakeReturnDataFrame( proc );
		DaoxDataFrame_PrepareSlices( df );
		DaoDataFrame_MakeSlice( self, proc, p+1, N-1, df->slices );
		GC_ShiftRC( self, df->original );
		df->original = self;
		DaoProcess_PutValue( proc, (DaoValue*) df );
	}
}
开发者ID:hooloong,项目名称:dao,代码行数:27,代码来源:dao_dataframe.c

示例2: STD_Compile

static void STD_Compile( DaoProcess *proc, DaoValue *p[], int N )
{
	char *source = DaoValue_TryGetMBString( p[0] );
	DaoNamespace *ns = proc->activeNamespace;
	if( DaoProcess_Compile( proc, ns, source ) ==0 ){
		DaoProcess_PutValue( proc, dao_none_value );
		return;
	}
	DaoProcess_PutValue( proc, ns->mainRoutines->items.pValue[ ns->mainRoutines->size-1 ] );
}
开发者ID:hooloong,项目名称:dao,代码行数:10,代码来源:daoStdlib.c

示例3: DaoState_Value

static void DaoState_Value( DaoProcess *proc, DaoValue *p[], int N )
{
	DaoState *self = (DaoState*)DaoValue_CastCstruct( p[0], NULL );
	DaoMutex_Lock( self->lock );
	DaoProcess_PutValue( proc, self->state );
	DaoMutex_Unlock( self->lock );
}
开发者ID:sanyaade-teachings,项目名称:dao-modules,代码行数:7,代码来源:dao_sync.c

示例4: UT_BinaryOper2

static void UT_BinaryOper2( DaoProcess *proc, DaoValue *p[], int N, int oper )
{
	DaoxUserType *C = DaoxUserType_New();
	DaoxUserType *A = (DaoxUserType*) p[0];
	DaoxUserType *B = (DaoxUserType*) p[1];
	DaoProcess_PutValue( proc, (DaoValue*) C );
}
开发者ID:carriercomm,项目名称:dao,代码行数:7,代码来源:dao_UserType.c

示例5: UT_UnaryOper

static void UT_UnaryOper( DaoProcess *proc, DaoValue *p[], int N, int oper )
{
	daoint ta;
	DaoxUserType *A = (DaoxUserType*) p[0];
	DaoxUserType *C = DaoxUserType_New();
	DaoProcess_PutValue( proc, (DaoValue*) C );
}
开发者ID:carriercomm,项目名称:dao,代码行数:7,代码来源:dao_UserType.c

示例6: DaoIO_SStream

static void DaoIO_SStream( DaoProcess *proc, DaoValue *p[], int N )
{
	DaoStream *stream = DaoStream_New();
	if( p[0]->xEnum.value == 1 ) DString_ToWCS( stream->streamString );
	stream->attribs |= DAO_IO_STRING;
	DaoProcess_PutValue( proc, (DaoValue*)stream );
}
开发者ID:wherby,项目名称:dao,代码行数:7,代码来源:daoStream.c

示例7: STD_Load

static void STD_Load( DaoProcess *proc, DaoValue *p[], int N )
{
	DString *name = p[0]->xString.data;
	int import = p[1]->xInteger.value;
	int runim = p[2]->xInteger.value;
	int safe = p[3]->xInteger.value;
	int wasProt = 0;
	int res = 0;
	DaoVmSpace *vms = proc->vmSpace;
	DaoNamespace *ns;
	DString_ToMBS( name );
	if( safe ) vms->options |= DAO_OPTION_SAFE;
	if( vms->options & DAO_OPTION_SAFE ) wasProt = 1;
	DArray_PushFront( vms->pathLoading, proc->activeNamespace->path );
	ns = DaoVmSpace_LoadEx( vms, DString_GetMBS( name ), runim );
	DaoProcess_PutValue( proc, (DaoValue*) ns );
	if( ! wasProt ) vms->options &= ~DAO_OPTION_SAFE;
	if( ns ){ /* in the case that it is cancelled from console */
		DArray_PushFront( vms->pathLoading, ns->path );
		res = DaoProcess_Call( proc, ns->mainRoutine, NULL, NULL, 0 );
		if( proc->stopit | vms->stopit ){
			DaoProcess_RaiseException( proc, DAO_ERROR, "loading cancelled" );
		}else if( res ){
			DaoProcess_RaiseException( proc, res, "loading failed" );
		}
		DArray_PopFront( vms->pathLoading );
	}else{
		DaoProcess_RaiseException( proc, DAO_ERROR, "loading failed" );
	}
	DArray_PopFront( vms->pathLoading );
	if( import && ns ) DaoNamespace_AddParent( proc->activeNamespace, ns );
}
开发者ID:hooloong,项目名称:dao,代码行数:32,代码来源:daoStdlib.c

示例8: SYS_Popen

static void SYS_Popen( DaoProcess *proc, DaoValue *p[], int N )
{
	DaoStream *stream = NULL;
	char *mode;
	DString *fname;

	stream = DaoStream_New();
	stream->attribs |= DAO_IO_PIPE;
	fname = stream->fname;
	DString_Assign( fname, p[0]->xString.data );
	if( DString_Size( fname ) >0 ){
		mode = DString_GetMBS( p[1]->xString.data );
		stream->file = popen( DString_GetMBS( fname ), mode );
		if( stream->file == NULL ){
			DaoProcess_RaiseException( proc, DAO_ERROR, "error opening pipe" );
		}
		stream->mode = 0;
		if( strstr( mode, "+" ) )
			stream->mode = DAO_IO_WRITE | DAO_IO_READ;
		else{
			if( strstr( mode, "r" ) )
				stream->mode |= DAO_IO_READ;
			if( strstr( mode, "w" ) || strstr( mode, "a" ) )
				stream->mode |= DAO_IO_WRITE;
		}
	}else{
		DaoProcess_RaiseException( proc, DAO_ERROR, "empty command line" );
	}
	DaoProcess_PutValue( proc, (DaoValue*)stream );
}
开发者ID:sanyaade-teachings,项目名称:dao,代码行数:30,代码来源:dao_sys.c

示例9: DaoCallServer_AddCall

void DaoCallServer_AddCall( DaoProcess *caller )
{
	DaoProcess *callee = DaoVmSpace_AcquireProcess( caller->vmSpace );
	DaoStackFrame *frame = caller->topFrame;
	DaoTaskEvent *event = DaoCallServer_MakeEvent();
	DaoType *type = (DaoType*) frame->routine->routType->aux;
	DaoFuture *future = DaoFuture_New( type, 1 );
	DaoValue **params = caller->stackValues + caller->topFrame->stackBase;
	int i, count = caller->topFrame->parCount;

	future->state = DAO_CALL_PAUSED;
	future->actor = caller->topFrame->object;
	GC_IncRC( future->actor );

	GC_ShiftRC( future, callee->future );
	callee->future = future;
	future->process = callee;
	GC_IncRC( future->process );

	callee->parCount = count;
	for(i=0; i<count; ++i) DaoValue_Copy( params[i], & callee->paramValues[i] );
	DaoProcess_PushRoutine( callee, caller->topFrame->routine, future->actor );

	DaoTaskEvent_Init( event, DAO_EVENT_RESUME_TASKLET, DAO_EVENT_RESUME, future, NULL );

	DaoProcess_PopFrame( caller );
	DaoProcess_PutValue( caller, (DaoValue*) future );

	DaoCallServer_Add( event );
}
开发者ID:hooloong,项目名称:dao,代码行数:30,代码来源:daoTasklet.c

示例10: RES_LoadColladaFile

static void RES_LoadColladaFile( DaoProcess *proc, DaoValue *p[], int N )
{
	DaoxSceneResource *self = (DaoxSceneResource*) p[0];
	const char *file = DaoValue_TryGetMBString( p[1] );
	DaoxScene *scene = DaoxSceneResource_LoadColladaFile( self, file );
	DaoProcess_PutValue( proc, (DaoValue*) scene );
}
开发者ID:sanyaade-teachings,项目名称:DaoGraphics,代码行数:7,代码来源:dao_graphics.c

示例11: DaoSTD_Exec

static void DaoSTD_Exec( DaoProcess *proc, DaoValue *p[], int n )
{
	DaoVmCode *sect = DaoProcess_InitCodeSection( proc, 0 );
	int ecount = proc->exceptions->size;

	if( sect == NULL ) return;
	DaoProcess_Execute( proc );
	DaoProcess_PopFrame( proc );
	if( proc->exceptions->size > ecount ){
		if( n > 0 ){
			DaoProcess_PutValue( proc, p[0] );
			DList_Erase( proc->exceptions, ecount, -1 );
		}
	}else{
		DaoProcess_PutValue( proc, proc->stackValues[0] );
	}
}
开发者ID:carriercomm,项目名称:dao,代码行数:17,代码来源:daoStdlib.c

示例12: AUX_Deserialize

static void AUX_Deserialize( DaoProcess *proc, DaoValue *p[], int N )
{
	int top = proc->factory->size;
	DaoValue *value = NULL;
	DaoValue_Deserialize( & value, p[0]->xString.data, proc->activeNamespace, proc );
	DaoProcess_PutValue( proc, value );
	DaoProcess_PopValues( proc, proc->factory->size - top );
	GC_DecRC( value );
}
开发者ID:sanyaade-teachings,项目名称:dao,代码行数:9,代码来源:dao_serializer.c

示例13: UT_CompOper2

static void UT_CompOper2( DaoProcess *proc, DaoValue *p[], int N, int oper )
{
	DaoValue *C = NULL;
	DaoxUserType *A = (DaoxUserType*) p[0];
	DaoxUserType *B = (DaoxUserType*) p[1];
	daoint D = 0;
	if( C ) DaoProcess_PutValue( proc, C );
	else DaoProcess_PutInteger( proc, D );
}
开发者ID:carriercomm,项目名称:dao,代码行数:9,代码来源:dao_UserType.c

示例14: DaoBUF_New

static void DaoBUF_New( DaoProcess *proc, DaoValue *p[], int N )
{
	daoint size = p[0]->xInteger.value;
	Dao_Buffer *self = Dao_Buffer_New( size >= 0 ? size : 0 );
	DaoProcess_PutValue( proc, (DaoValue*) self );
	if( size < 0 ){
		DaoProcess_RaiseException( proc, DAO_ERROR, "negative buffer size" );
		return;
	}
}
开发者ID:sanyaade-teachings,项目名称:dao,代码行数:10,代码来源:dao_sys.c

示例15: FUTURE_Value

static void FUTURE_Value( DaoProcess *proc, DaoValue *par[], int N )
{
	DaoFuture *self = (DaoFuture*) par[0];
	if( self->state == DAO_CALL_FINISHED ){
		DaoProcess_PutValue( proc, self->value );
		return;
	}
	proc->status = DAO_PROCESS_SUSPENDED;
	proc->pauseType = DAO_PAUSE_FUTURE_VALUE;
	DaoCallServer_AddWait( proc, self, -1 );
}
开发者ID:itsky71,项目名称:dao,代码行数:11,代码来源:daoTasklet.c


注:本文中的DaoProcess_PutValue函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。