本文整理匯總了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 );
}
}
示例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 ] );
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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] );
}
}
示例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 );
}
示例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 );
}
示例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;
}
}
示例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 );
}