这篇教程C++ DaoProcess_PutValue函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DaoProcess_PutValue函数的典型用法代码示例。如果您正苦于以下问题:C++ DaoProcess_PutValue函数的具体用法?C++ DaoProcess_PutValue怎么用?C++ DaoProcess_PutValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DaoProcess_PutValue函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: FRAME_GETMIstatic 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,
示例2: STD_Compilestatic 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,
示例3: DaoState_Valuestatic 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,
示例4: UT_BinaryOper2static 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,
示例5: UT_UnaryOperstatic 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,
示例6: DaoIO_SStreamstatic 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,
示例7: STD_Loadstatic 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,
示例8: SYS_Popenstatic 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,
示例9: DaoCallServer_AddCallvoid 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,
示例10: RES_LoadColladaFilestatic 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,
示例11: DaoSTD_Execstatic 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,
示例12: AUX_Deserializestatic 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,
示例13: UT_CompOper2static 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,
示例14: DaoBUF_Newstatic 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,
示例15: FUTURE_Valuestatic 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,
示例16: DaoSTD_Evalstatic void DaoSTD_Eval( DaoProcess *proc, DaoValue *p[], int N ){ DaoVmSpace *vms = proc->vmSpace; DaoNamespace *ns = proc->activeNamespace; DaoStream *prevStream = proc->stdioStream; DaoStream *redirect = (DaoStream*) p[1]; char *source = DaoValue_TryGetChars( p[0] ); if( redirect != prevStream ) GC_Assign( & proc->stdioStream, redirect ); DaoProcess_Eval( proc, ns, source ); DaoProcess_PutValue( proc, proc->stackValues[0] ); if( redirect != prevStream ) GC_Assign( & proc->stdioStream, prevStream );}
开发者ID:carriercomm,项目名称:dao,代码行数:12,
示例17: DaoSTD_Trystatic void DaoSTD_Try( DaoProcess *proc, DaoValue *p[], int n ){ DaoVmCode *sect = DaoProcess_InitCodeSection( proc, 0 ); int i, ecount = proc->exceptions->size; if( sect == NULL ) return; DaoProcess_Execute( proc ); DaoProcess_PopFrame( proc ); if( proc->exceptions->size > (ecount+1) ){ DaoList *list = DaoProcess_PutList( proc ); for(i=ecount; i<proc->exceptions->size; ++i){ DaoList_Append( list, proc->exceptions->items.pValue[i] ); } DList_Erase( proc->exceptions, ecount, -1 ); }else if( proc->exceptions->size > ecount ){ DaoProcess_PutValue( proc, proc->exceptions->items.pValue[proc->exceptions->size-1] ); DList_PopBack( proc->exceptions ); }else{ DaoProcess_PutValue( proc, proc->stackValues[0] ); }}
开发者ID:carriercomm,项目名称:dao,代码行数:21,
示例18: FUTURE_Valuestatic 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; } if( DaoProcess_CheckCB( proc, "cannot block inside code section method" ) ) return; proc->status = DAO_PROCESS_SUSPENDED; proc->pauseType = DAO_PAUSE_FUTURE_VALUE; DaoCallServer_AddWait( proc, self, -1 );}
开发者ID:sanyaade-teachings,项目名称:dao,代码行数:12,
示例19: FUTURE_Valuestatic 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; }#ifdef DAO_WITH_CONCURRENT proc->status = DAO_PROCESS_SUSPENDED; proc->pauseType = DAO_PAUSE_FUTURE_VALUE; DaoCallServer_AddWait( proc, self, -1 );#else DaoProcess_RaiseError( proc, NULL, "Invalid future value" );#endif}
开发者ID:carriercomm,项目名称:dao,代码行数:15,
示例20: DaoSTD_Loadstatic void DaoSTD_Load( DaoProcess *proc, DaoValue *p[], int N ){ DaoNamespace *ns; DaoVmSpace *vms = proc->vmSpace; DString *name = p[0]->xString.value; int import = p[1]->xInteger.value; int runim = p[2]->xInteger.value; int res = 0; DList_PushFront( vms->pathLoading, proc->activeNamespace->path ); ns = DaoVmSpace_LoadEx( vms, DString_GetData( name ), runim ); DaoProcess_PutValue( proc, (DaoValue*) ns ); if( ns == NULL ) DaoProcess_RaiseError( proc, NULL, "loading failed" ); DList_PopFront( vms->pathLoading ); if( import && ns ) DaoNamespace_AddParent( proc->activeNamespace, ns );}
开发者ID:carriercomm,项目名称:dao,代码行数:16,
示例21: CHANNEL_Newstatic void CHANNEL_New( DaoProcess *proc, DaoValue *par[], int N ){ DaoType *retype = DaoProcess_GetReturnType( proc ); DaoChannel *self = DaoChannel_New( retype, 0 ); CHANNEL_SetCap( self, par[0], proc ); if( DaoType_CheckPrimitiveType( retype->nested->items.pType[0] ) == 0 ){ DString *s = DString_New(); DString_AppendChars( s, "data type " ); DString_Append( s, retype->nested->items.pType[0]->name ); DString_AppendChars( s, " is not supported for channel" ); DaoProcess_RaiseError( proc, NULL, s->chars ); DString_Delete( s ); } DaoProcess_PutValue( proc, (DaoValue*) self ); DaoCallServer_TryInit( mainVmSpace );}
开发者ID:carriercomm,项目名称:dao,代码行数:16,
示例22: WIN_Newstatic void WIN_New( DaoProcess *proc, DaoValue *p[], int N ){ DaoxWindow *self = DaoxWindow_New(); DString_Assign( self->title, p[2]->xString.value ); self->width = self->context->deviceWidth = p[0]->xInteger.value; self->height = self->context->deviceHeight = p[1]->xInteger.value; self->handle = glfwCreateWindow( self->width, self->height, self->title->chars, NULL, NULL); if( self->handle == NULL ){ DaoProcess_RaiseError( proc, NULL, "Failed to create window" ); return; } glfwSetWindowUserPointer( self->handle, self ); glfwSetWindowCloseCallback( self->handle, DaoxWindow_CloseCallback ); glfwHideWindow( self->handle ); glfwMakeContextCurrent( self->handle ); DaoProcess_PutValue( proc, (DaoValue*) self );}
开发者ID:dreamsxin,项目名称:DaoGraphics-1,代码行数:17,
示例23: DaoMT_Startstatic void DaoMT_Start( DaoProcess *proc, DaoValue *p[], int n ){ DaoProcess *clone; DaoVmCode *vmc, *end; DaoVmCode *sect = DaoGetSectionCode( proc->activeCode ); DaoType *type = DaoProcess_GetReturnType( proc ); DaoFuture *future = DaoFuture_New( type, 0 ); int entry, nop = proc->activeCode[1].code == DVM_NOP; DaoProcess_PutValue( proc, (DaoValue*) future ); if( sect == NULL || DaoMT_PushSectionFrame( proc ) == 0 ) return; entry = proc->topFrame->entry; end = proc->activeRoutine->body->vmCodes->data.codes + proc->activeCode[nop+1].b; clone = DaoVmSpace_AcquireProcess( proc->vmSpace ); DaoProcess_PopFrame( proc ); DaoProcess_SetActiveFrame( proc, proc->topFrame ); DaoMT_InitProcess( proc, clone ); clone->topFrame->entry = entry; /* // Use the cloned process instead of the parent process, in case that // the cloned process will not be joined by the parent process: */ clone->topFrame->outer = clone; future->process = clone; GC_IncRC( clone ); GC_ShiftRC( future, clone->future ); clone->future = future; future->state = DAO_CALL_RUNNING; for(vmc=sect; vmc!=end; vmc++){ int i = -1, code = vmc->code; if( code == DVM_GETVH || (code >= DVM_GETVH_I && code <= DVM_GETVH_C) ){ i = vmc->b; }else if( code == DVM_SETVH || (code >= DVM_SETVH_II && code <= DVM_SETVH_CC) ){ i = vmc->b; } if( i >= 0 ){ /* These values should be shared with the parent thread: */ GC_ShiftRC( proc->activeValues[i], clone->activeValues[i] ); clone->activeValues[i] = proc->activeValues[i]; } } DaoCallServer_AddTask( DaoMT_Start0, clone, p[0]->xEnum.value );}
开发者ID:hooloong,项目名称:dao,代码行数:45,
示例24: DaoQueue_Popstatic void DaoQueue_Pop( DaoProcess *proc, DaoValue *p[], int N ){ DaoQueue *self = (DaoQueue*)DaoValue_CastCstruct( p[0], NULL ); QueueItem *item = NULL; DaoMutex_Lock( self->mtx ); while( !self->size ) DaoCondVar_Wait( self->popvar, self->mtx ); item = self->head; self->head = item->next; if( !self->head ) self->tail = NULL; else self->head->previous = NULL; if( self->capacity && self->size == self->capacity ) DaoCondVar_Signal( self->pushvar ); self->size--; DaoMutex_Unlock( self->mtx ); DaoProcess_PutValue( proc, item->value ); DaoGC_DecRC( item->value ); dao_free( item );}
开发者ID:sanyaade-teachings,项目名称:dao-modules,代码行数:21,
示例25: STD_Loadstatic 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 == NULL ) DaoProcess_RaiseException( proc, DAO_ERROR, "loading failed" ); DArray_PopFront( vms->pathLoading ); if( import && ns ) DaoNamespace_AddParent( proc->activeNamespace, ns );}
开发者ID:wherby,项目名称:dao,代码行数:21,
注:本文中的DaoProcess_PutValue函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DataException函数代码示例 C++ D_WARN函数代码示例 |