allocators(externalVector)
allocators()所属R语言包:externalVector
Generics associated with external resources and their allocators
与外部的资源和他们的分配器相关的泛型
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These are generics used with objects of class "externalResource" and "externalAllocator".
这些都是与类的“externalResource”和“externalAllocator”的对象使用泛型。
用法----------Usage----------
allocator(resource)
getPointer(resource)
initializeResource(resource, ptr, size, type, ...)
allocatedSize(resource)
allocatedType(resource)
allocate(resource, alloc, size, type, ...)
deallocate(resource, alloc)
external.size(resource, alloc)
external.size(resource, copy, alloc) <- value
reinitializePointer(resource, alloc)
参数----------Arguments----------
参数:resource
An object which is an "externalResource".
一个对象,它是“externalResource”。
参数:alloc
An object which is an "externalAllocator".
一个对象,它是“externalAllocator”。
参数:ptr
An external pointer.
外部指针。
参数:size
The size - if given for a non-vector type, the numebr of bytes. Otherwise, the length of the vector.
大小 - 如果非向量类型,numebr字节。否则,向量的长度。
参数:type
Object represnting the type stored in the resource.
反对represnting存储资源的类型。
参数:copy
Logical, if TRUE (the default), then the new memory is initialized to the content of the old memory for the minimum of old and new sizes. Content of any uninitialized memory is undefined. Under any circumstance, the inherent type of the allocated memory remains the same as its initial value.
逻辑,如果TRUE(默认),那么新的内存初始化旧为新老大小的最低内存的内容。任何未初始化的内存的内容是不确定的。在任何情况下,分配的内存的固有类型仍作为其初始值相同。
参数:value
Integer, new size.
整数,新的大小。
参数:...
Further arguments passed to or from other functions.
进一步传递的参数,或从其他职能。
值----------Value----------
allocator returns the allocator to be used by default with resource.
allocator返回到默认使用resource分配器。
getPointer returns the "externalptr" associated with resource.
getPointer返回"externalptr"与resource关联。
initializeResource intializes resource with ptr of type "externalptr" and returns resource.
initializeResourceintializesresourceptr类型"externalptr"“回报resource。
allocatedSize returns the size of memory to be allocated for resource. If allocatedType(resource) is an R basic vector type, then the size is the length of the vector. Otherwise the size is the total number of bytes.
allocatedSize返回的内存大小分配resource。如果allocatedType(resource)是一个R的基本向量类型,那么大小是矢量的长度。否则,大小是字节的总数。
allocatedType returns an object representing the type to be stored in the resource
allocatedType返回一个代表存储在资源类型的对象
allocate allocates the external pointer in resource using the allocator alloc for resource. If type is a basic vector object, then it allocates an object of same mode with length size and otherwise allocates size bytes of raw memory. The resource object is initialized by a call to initializeResource.
allocate分配资源的外部指针使用分配器allocresource。如果type是一个基本的矢量对象,那么它分配长度size对象相同的模式,否则分配size原始内存字节。 resource对象初始化调用initializeResource由。
deallocate asks the allocator alloc to deallocate the memory in resource. The result is allocator dependant.
deallocate问分配器alloc释放内存在resource。结果分配器依赖。
external.size returns the argument size used in the last call to allocate for resource.
external.size返回参数sizeallocateresource在最后一次通话使用。
The replacement form can be used to change the size of the allocated memory. If value is same as external.size(resource), then no action is taken. Otherwise, this reallocates the memory in resource using the allocator alloc (or allocator(resource) if alloc is missing) with new size value and the same type as earlier.
可用于替代形式,改变分配内存的大小。如果value作为external.size(resource)是相同的,那么不采取任何行动。否则,这种重新分配resource使用分配器alloc(或allocator(resource)如果alloc丢失),新的大小value和同类型的内存。
reinitializePointer tries to reinitialize the memory pointer in resource after resource was saved and restored as an R image (by serialization code, by saving the R workspace, or by an explicit call to save).
reinitializePointer试图在资源重新初始化内存指针后resource保存和恢复作为一个R图像(序列化代码,保存的R工作区,或通过显式调用save) 。
参见----------See Also----------
externalAllocator-class,
externalAllocator-class
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|