• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IOCLONE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: IoMessage_locals_valueArgAt_

IoObject *IoCFFIPointer_castTo(IoCFFIPointer *self, IoObject *locals, IoMessage *m)
{
    IoObject *toType = IoMessage_locals_valueArgAt_(m, locals, 0);
    IoObject *o = IoState_on_doCString_withLabel_(IOSTATE, toType, "?typeString", "IoCFFIPointer_castTo");

    if(!ISNIL(o)) {
        char *typeStr = CSTRING(o);

        switch(typeStr[0]) {
            case '^':
                toType = IOCLONE(toType);
                *(DATA(toType)->valuePointer) = *((void **)IoCFFIDataType_ValuePointerFromObject_(toType, self));
                return toType;
            case '*':
                toType = IOCLONE(toType);
                IoCFFIDataType_rawSetValue(toType, self);
                return toType;
            default:
                IoState_error_(IOSTATE, m, "Wrong type to cast to.");
                break;
        }
    }
    else {
        // Mm... well, if the type to cast to does not have a typeString slot,
        // it should be an Io Object, so the address stored here is a pointer to an
        // Io Object. Simply cast the pointer and return it... dangerous but...
        
        IoObject *obj = (IoObject *)*(DATA(self)->valuePointer);
        if(ISOBJECT(obj))
            return (IoObject *)*(DATA(self)->valuePointer);
    }

    return IONIL(self);
}
开发者ID:akimd,项目名称:io,代码行数:34,代码来源:IoCFFIPointer.c


示例2: IOCLONE

IoCFFIArray *IoCFFIArray_with(IoCFFIArray *self, IoObject *locals, IoMessage *m)
{
	IoCFFIDataType *type;
	int size, i;
	ffi_type *item_type;
	IoCFFIArray *o = IOCLONE(self);

	IoState_on_doCString_withLabel_(IoObject_state(o), o, "init", "IoCFFIArray_with");

	type = IOCLONE(IoMessage_locals_valueArgAt_(m, locals, 0));
	IoObject_setSlot_to_(o, IOSYMBOL("arrayType"), type);

	size = IoMessage_locals_intArgAt_(m, locals, 1);
	DATA(o)->arraySize = size;

	item_type = IoCFFIDataType_ffiType(type);
	DATA(o)->itemSize = item_type->size;

	// Fake libffi to think we are a Struct
	DATA(o)->ffiType.size = 0;
	DATA(o)->ffiType.alignment = 0;
	DATA(o)->ffiType.type = FFI_TYPE_STRUCT;
	DATA(o)->ffiType.elements = io_calloc(size + 1, sizeof(ffi_type *));
	DATA(o)->needToFreeFFIType = 1;
	for ( i = 0 ; i < size ; i++ ) {
		DATA(o)->ffiType.elements[i] = item_type;
	}
	DATA(o)->ffiType.elements[size] = NULL;

	ffi_cif cif;
	ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &(DATA(o)->ffiType), NULL);

	return o;
}
开发者ID:bomma,项目名称:io,代码行数:34,代码来源:IoCFFIArray.c


示例3: IoObject_rawClonePrimitive

IoBox *IoBox_rawClone(IoBox *proto)
{
	IoBox *self = IoObject_rawClonePrimitive(proto);
	IoObject_setDataPointer_(self, calloc(1, sizeof(IoBoxData)));

	DATA(self)->origin = IOCLONE(DATA(proto)->origin);
	DATA(self)->size   = IOCLONE(DATA(proto)->size);
	return self;
}
开发者ID:ADTSH,项目名称:io,代码行数:9,代码来源:IoBox.c


示例4: IoObject_rawClonePrimitive

IoAudioDevice *IoAudioDevice_rawClone(IoAudioDevice *proto)
{
	IoObject *self = IoObject_rawClonePrimitive(proto);
	IoObject_setDataPointer_(self, calloc(1, sizeof(IoAudioDeviceData)));
	DATA(self)->writeBuffer = IOCLONE(DATA(proto)->writeBuffer);
	DATA(self)->readBuffer = IOCLONE(DATA(proto)->readBuffer);
	DATA(self)->audioDevice = AudioDevice_new();
	return self;
}
开发者ID:Akiyah,项目名称:io,代码行数:9,代码来源:IoAudioDevice.c


示例5: IoObject_rawClonePrimitive

IoGLScissor *IoGLScissor_rawClone(IoGLScissor *proto)
{
	IoObject *self = IoObject_rawClonePrimitive(proto);
	IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoGLScissorData)));

	DATA(self)->rect    = IOCLONE(DATA(proto)->rect);
	DATA(self)->tmpRect = IOCLONE(DATA(proto)->tmpRect);
	return self;
}
开发者ID:Akiyah,项目名称:io,代码行数:9,代码来源:IoGLScissor.c


示例6: IoObject_rawClonePrimitive

IoAVCodec *IoAVCodec_rawClone(IoAVCodec *proto)
{
	IoObject *self = IoObject_rawClonePrimitive(proto);
	IoObject_setDataPointer_(self, calloc(1, sizeof(IoAVCodecData)));

	DATA(self)->inputBuffer        = IOCLONE(DATA(proto)->inputBuffer);
	DATA(self)->outputBuffer       = IOCLONE(DATA(proto)->outputBuffer);

	return self;
}
开发者ID:BMeph,项目名称:io,代码行数:10,代码来源:IoAVCodec.c


示例7: IoObject_rawClonePrimitive

IoMP3Decoder *IoMP3Decoder_rawClone(IoMP3Decoder *proto) 
{ 
	IoObject *self = IoObject_rawClonePrimitive(proto);
	IoObject_setDataPointer_(self, calloc(1, sizeof(IoMP3DecoderData)));
	
	DATA(self)->willProcessMessage = DATA(proto)->willProcessMessage;
	DATA(self)->didProcessMessage = DATA(proto)->didProcessMessage;
	DATA(self)->inputBuffer  = IOCLONE(DATA(proto)->inputBuffer);
	DATA(self)->outputBuffer = IOCLONE(DATA(proto)->outputBuffer);
	DATA(self)->tmpInputBa = UArray_new();
	
	IoState_addValue_(IOSTATE, self);
	return self; 
}
开发者ID:Akiyah,项目名称:io,代码行数:14,代码来源:IoMP3Decoder.c


示例8: checkStatus_

IoCairoSurface *IoCairoSurface_newWithRawSurface_(void *state, IoMessage *m, cairo_surface_t *surface)
{
	IoObject *self = 0;
	IoStateProtoFunc *initFunc = 0;

	checkStatus_(state, m, cairo_surface_status(surface));

	switch(cairo_surface_get_type(surface))
	{
		case CAIRO_SURFACE_TYPE_IMAGE:
			initFunc = IoCairoImageSurface_proto;
			break;
		case CAIRO_SURFACE_TYPE_PS:
			initFunc = IoCairoPSSurface_proto;
			break;
		case CAIRO_SURFACE_TYPE_PDF:
			initFunc = IoCairoPDFSurface_proto;
			break;
		case CAIRO_SURFACE_TYPE_SVG:
			initFunc = IoCairoSVGSurface_proto;
			break;
	default:
			IoState_error_(state, 0, "Unsupported surface type");
	}

	self = IOCLONE(IoState_protoWithId_(state, protoId));
	IoObject_setDataPointer_(self, surface);
	return self;
}
开发者ID:AlexGensek,项目名称:io,代码行数:29,代码来源:IoCairoSurface.c


示例9: IoState_protoWithInitFunction_

IoODEBody *IoODEBody_newBodyProtoWithWorld(void *state, IoODEWorld *world)
{
	IoODEBody *proto = IoState_protoWithInitFunction_(state, IoODEBody_proto);
	IoODEBody *self = IOCLONE(proto);
	WORLD = world;
	return self;
}
开发者ID:cdcarter,项目名称:io,代码行数:7,代码来源:IoODEBody.c


示例10: CNUMBER

IoCFFIArray *IoCFFIArray_atPut(IoCFFIArray *self, IoObject *locals, IoMessage *m)
{
	int pos;
	IoObject *value, *arrayType, *d;
	char *ptr;

	pos = CNUMBER(IoMessage_locals_numberArgAt_(m, locals, 0));
	value = IoMessage_locals_valueArgAt_(m, locals, 1);

	if ( pos >= DATA(self)->arraySize ) {
		IoState_error_(IOSTATE, m, "index out of bounds");
		return IONIL(self);
	}

	arrayType = IoObject_getSlot_(self, IOSYMBOL("arrayType"));
	ptr = ((char *)DATA(self)->buffer) + (DATA(self)->itemSize * pos);

	d = IOCLONE(arrayType);
	IoCFFIDataType_rawSetValue(d, value);
	memcpy(ptr, (void *)IoCFFIDataType_ValuePointerFromObject_(self, d), DATA(self)->itemSize);

	if ( DATA(self)->keepValuesRefs ) {
		DATA(self)->keepValuesRefs[pos] = IOREF(d);
	}

	return self;
}
开发者ID:bomma,项目名称:io,代码行数:27,代码来源:IoCFFIArray.c


示例11: printf

// _new creates a new object from this prototype
IoObject *IoSVN_new(void *state)
{
	printf("IoSVN_new\n");

	IoObject *proto = IoState_protoWithInitFunction_(state, IoSVN_proto);
	return IOCLONE(proto);
}
开发者ID:omf,项目名称:iosvnnative,代码行数:8,代码来源:IoSVN.c


示例12: IoState_protoWithInitFunction_

IoCoroutine *IoCoroutine_new(void *state)
{
	IoObject *proto = IoState_protoWithInitFunction_((IoState *)state, IoCoroutine_proto);
	IoObject *self = IOCLONE(proto);
	//printf("IoCoroutine_new %p\n", (void *)self);
	return self;
}
开发者ID:jdp,项目名称:io,代码行数:7,代码来源:IoCoroutine.c


示例13: IoState_protoWithInitFunction_

IoNumber *IoNumber_newWithDouble_(void *state, double n)
{
	IoNumber *proto = IoState_protoWithInitFunction_((IoState *)state, IoNumber_proto);
	IoNumber *self = IOCLONE(proto); // since Numbers have no refs, we can avoid IOCLONE
	DATA(self) = n;
	return self;
}
开发者ID:Akiyah,项目名称:io,代码行数:7,代码来源:IoNumber.c


示例14: IOCLONE

IoCairoFontOptions *IoCairoFontOptions_newWithRawFontOptions_(void *state, IoMessage *m, cairo_font_options_t *options)
{
	IoCairoFontOptions *self = IOCLONE(IoState_protoWithId_(state, proto));
	IoObject_setDataPointer_(self, options);
	CHECK_STATUS(self);
	return self;
}
开发者ID:AlexGensek,项目名称:io,代码行数:7,代码来源:IoCairoFontOptions.c


示例15: IoState_protoWithInitFunction_

IoODEJoint *IoODEJoint_newProtoCommon(void *state, IoStateProtoFunc *func, IoODEJointGroup *jointGroup)
{
	IoODEJoint *proto = IoState_protoWithInitFunction_(state, func);
	IoODEJoint *self = IOCLONE(proto);
	JOINTGROUP = jointGroup;
	return self;
}
开发者ID:Akiyah,项目名称:io,代码行数:7,代码来源:IoODEJoint.c


示例16: IoState_setupSingletons

void IoState_setupSingletons(IoState *self)
{
	IoObject *core = self->core;
	// nil

	self->ioNil = IOCLONE(self->objectProto);
	IoObject_setSlot_to_(core, SIOSYMBOL("nil"), self->ioNil);
	//IoObject_setSlot_to_(core, self->noShufflingSymbol, self->ioNil);
	IoObject_setSlot_to_(core, SIOSYMBOL("Message"), IoMessage_proto(self));
	IoObject_setSlot_to_(core, SIOSYMBOL("Call"),  IoCall_proto(self));

	self->nilMessage  = IoMessage_newWithName_(self, SIOSYMBOL("nil"));
	IoMessage_cachedResult_(self->nilMessage, self->ioNil);
	IoState_retain_(self, self->nilMessage);

	// true

	self->ioTrue = IoObject_new(self);
	IoObject_setSlot_to_(core, SIOSYMBOL("true"), self->ioTrue);
	IoObject_setSlot_to_(self->ioTrue, SIOSYMBOL("type"), SIOSYMBOL("true"));
	IoState_retain_(self, self->ioTrue);

	// false

	self->ioFalse = IoObject_new(self);
	IoObject_setSlot_to_(core, SIOSYMBOL("false"), self->ioFalse);
	IoObject_setSlot_to_(self->ioFalse, SIOSYMBOL("type"), SIOSYMBOL("false"));
	IoState_retain_(self, self->ioFalse);

	// Flow control: Normal
	self->ioNormal = IoObject_new(self);
	IoObject_setSlot_to_(core, SIOSYMBOL("Normal"), self->ioNormal);
	IoObject_setSlot_to_(self->ioNormal, SIOSYMBOL("type"), SIOSYMBOL("Normal"));
	IoState_retain_(self, self->ioNormal);

	// Flow control: Break
	self->ioBreak = IoObject_new(self);
	IoObject_setSlot_to_(core, SIOSYMBOL("Break"), self->ioBreak);
	IoObject_setSlot_to_(self->ioBreak, SIOSYMBOL("type"), SIOSYMBOL("Break"));
	IoState_retain_(self, self->ioBreak);

	// Flow control: Continue
	self->ioContinue = IoObject_new(self);
	IoObject_setSlot_to_(core, SIOSYMBOL("Continue"), self->ioContinue);
	IoObject_setSlot_to_(self->ioContinue, SIOSYMBOL("type"), SIOSYMBOL("Continue"));
	IoState_retain_(self, self->ioContinue);

	// Flow control: Return
	self->ioReturn = IoObject_new(self);
	IoObject_setSlot_to_(core, SIOSYMBOL("Return"), self->ioReturn);
	IoObject_setSlot_to_(self->ioReturn, SIOSYMBOL("type"), SIOSYMBOL("Return"));
	IoState_retain_(self, self->ioReturn);

	// Flow control: Eol
	self->ioEol = IoObject_new(self);
	IoObject_setSlot_to_(core, SIOSYMBOL("Eol"), self->ioEol);
	IoObject_setSlot_to_(self->ioEol, SIOSYMBOL("type"), SIOSYMBOL("Eol"));
	IoState_retain_(self, self->ioEol);
}
开发者ID:robertpfeiffer,项目名称:io,代码行数:59,代码来源:IoState.c


示例17: IoState_protoWithInitFunction_

IoODEPlane *IoODEPlane_new(void *state, dGeomID geomId)
{
	IoODEPlane *proto = IoState_protoWithInitFunction_(state, IoODEPlane_proto);
	IoODEPlane *self = IOCLONE(proto);
	GEOMID = geomId;
	dGeomSetData(GEOMID, self);
	return self;
}
开发者ID:Akiyah,项目名称:io,代码行数:8,代码来源:IoODEPlane.c


示例18: IOCLONE

IoCairoContext *IoCairoContext_newWithSurface_(void *state, IoCairoImageSurface *surface)
{
	IoCairoContext *self = IOCLONE(IoState_protoWithInitFunction_(state, IoCairoContext_proto));
	cairo_t *rawContext = cairo_create(IoCairoSurface_rawSurface(surface));
	checkStatus_(state, 0, cairo_status(rawContext));
	IoObject_setDataPointer_(self, rawContext);
	return self;
}
开发者ID:eklitzke,项目名称:io,代码行数:8,代码来源:IoCairoContext.c


示例19: IoObject_rawClonePrimitive

IoImage *IoImage_rawClone(IoImage *proto)
{
	IoObject *self = IoObject_rawClonePrimitive(proto);
	IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoImageData)));
	DATA(self)->buffer = IOCLONE(DATA(proto)->buffer);
	DATA(self)->image = Image_copyWithUArray_(DATA(proto)->image, IoSeq_rawUArray(DATA(self)->buffer));
	return self;
}
开发者ID:Alessandroo,项目名称:io,代码行数:8,代码来源:IoImage.c


示例20: IOCLONE

IoRegexMatch *IoRegexMatch_newWithRegex_subject_captureRanges_(void *state, IoRegex *regex, IoSymbol *subject, IoList *captureRanges)
{
	IoRegexMatch *self = IOCLONE(IoState_protoWithId_(state, protoId));
	DATA(self)->regex = IOREF(regex);
	DATA(self)->subject = IOREF(subject);
	DATA(self)->ranges = captureRanges;
	return self;
}
开发者ID:ADTSH,项目名称:io,代码行数:8,代码来源:IoRegexMatch.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IOConfigGPIO函数代码示例发布时间:2022-05-30
下一篇:
C++ IOBOOL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap