externalResource-class(externalVector)
externalResource-class()所属R语言包:externalVector
Class "externalResource", base class for external resource
类的“externalResource”,对外部资源的基础类
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Class "externalResource" is a virtual class with no slots. External allocators, represented by subclasses of class "externalAllocator" can only allocate external pointers
"externalResource"类是虚拟类与无槽。 "externalAllocator"类的子类所代表的外部分配器,只能分配外部指针
类的对象----------Objects from the Class----------
A virtual Class: No objects may be created from it.
可以从它创建一个虚拟类:无对象。
虚拟类“externalResource”的方法。----------Methods for the virtual class "externalResource"----------
These methods are defined for the virtual class "externalResource" and need not be redefined by its subclasses.
这些方法被定义为虚拟类“externalResource”,而无须重新定义它的子类。
Signature components for the methods are:
签名组件的方法是:
The class "externalResource"
类“externalResource”
The class "missing"
类的“失踪”
The class "externalptr"
类“externalptr”
The class "ANY"
类的“ANY”
The class "ANY"
类的“ANY”
The class "logical"
类的“逻辑”
The class "ANY"
类的“ANY”
The argument alloc has the class "missing" wherever it appears in these methods. That means, to invoke these methods, the argument alloc must be ommitted from the call and to use any of the additional arguments, they must be specfied by name. For example, use allocate(resource, size=size, type=type) and not allocate(resource, size, type).
参数alloc类“失踪”一词出现在这些方法。这意味着,调用这些方法,参数alloc必须省略从通话和使用任何额外的参数,它们必须按名称而指定。例如,使用allocate(resource, size=size, type=type)不allocate(resource, size, type)。
Description of the methods:
方法描述:
allocatedType(resource): Returns NULL.
allocatedType(资源):返回NULL的。
allocate(resource, alloc, size, type, ...): Allocate the external pointer in resource using the default allocator for resource. If type is a basic vector object, then allocate an object of same mode with length size. Otherwise allocate size bytes of raw memory. The resource object is initialized by a call to
(分配资源,分配,大小,类型,...):分配资源的外部指针使用resource的默认分配器。 type如果是一个基本的矢量对象,然后分配长度size对象相同的模式。否则分配原始内存size字节。 resource对象初始化一个呼叫
deallocate(resource, alloc): Ask the default allocator to deallocate the memory in resource. The result is
释放(资源,分配):问的默认分配器来释放内存在resource。其结果是
external.size Return the argument size used in the
external.size返回参数size在使用
external.size<-(resource, copy, alloc, value): If value is same as external.size(resource), then no action is taken. Otherwise, reallocate the memory in resource using the default allocator with new size value and the same type as earlier. If copy is 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
external.size < - (资源,复制,分配,价值):如果value作为external.size(resource)是相同的,那么不采取任何行动。否则,重新分配的resource使用新的大小value和早先的同类型的默认分配器的内存。 copy如果是TRUE(默认),那么新的内存初始化旧为新老大小的最低内存的内容。任何未初始化的内存的内容是不确定的。在任何情况下,分配的内存固有的类型仍然是一样的
initialize(.Object): Code called by new("resourceSubclass", ...) if "resourceSubclass" is a subclass of "externalResource" and either has no initialize method of its own or its initialize method has callNextMethod() in its body. Returns the result of
初始化(对象)。:要求新(的“resourceSubclass”,...)如果“resourceSubclass”的守则是的“externalResource”的子类,或者有没有initialize方法自身或其initialize方法callNextMethod()在它的身上。返回的结果。
reinitializePointer(resource, alloc): If the object resource was saved as an R image (by serialization code, by saving the R workspace, or by an explicit call to save) then the raw memory pointer in any "externalptr" object in it would be set to 0. This method tries to reinitialize the raw memory pointer. The exact
reinitializePointer(资源,分配):如果对象resource被保存为一个R图像(序列化代码,保存的R工作区,或由一个显式的调用save),则原始内存指针任何"externalptr"在它的对象将被设置为0。这种方法试图重新初始化原始内存指针。确切
虚拟方法----------Virtual Methods----------
Attempt to execute these methods would result in an error unless they have been redefined for a subclass of "externalResource".
试图执行这些方法将导致错误,除非他们已经被重新定义为子类的"externalResource"。
Signature components for implementation of the methods:
实施方法的签名的组件:
A subclass of "externalResource"
“externalResource”的子类
The class "externalptr"
类“externalptr”
The class "ANY"
类的“ANY”
The class "ANY"
类的“ANY”
Description of the virtual methods:
虚拟方法的描述:
allocatedSize(resource): 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
allocatedSize(资源):内存的大小来分配resource。如果allocatedType(resource)是一个R的基本向量类型,那么大小的长度
allocator(resource): The allocator to be used by default with
分配器(资源):默认情况下使用分配器
getPointer(reource): Return the "externalptr"
getPointer(reource):返回"externalptr"
Intialize resource with ptr of type "externalptr". The size and type arguments are identical to that obtained from previous calls to
Intializeresource用ptr型"externalptr"。 size和type参数从以前调用获得的是相同的
其他虚拟方法----------Other Virtual Methods----------
These methods must be redefined for subclasses for "externalAllocator". It is not necessary to define them for specific subclasses of "externalResource".
这些方法必须重新定义为"externalAllocator"的子类。这是没有必要他们"externalResource"的具体子类定义。
Signature components for implementation of the methods:
实施方法的签名的组件:
The class "externalResource"
类“externalResource”
A subclass of "externalAllocator"
“externalAllocator”的子类
The class "ANY"
类的“ANY”
The class "ANY"
类的“ANY”
The class "logical"
类的“逻辑”
The class "ANY"
类的“ANY”
Description of the virtual methods:
虚拟方法的描述:
allocate(resource, alloc, size, type, ...): Allocate the external pointer in resource using the allocator
分配(资源,分配,大小,类型,...):resource使用分配器分配的外部指针
deallocate(resource, alloc): Ask the allocator alloc
释放(资源,分配):要求分配器alloc
external.size Return the size of the allocated memory in
external.size返回分配的内存的大小
external.size<-(resource, copy, alloc, value): Reallocate
external.size < - (资源,复制,分配,价值):再分配
reinitializePointer(resource, alloc): If the raw memory
reinitializePointer(资源,分配):如果原始的记忆
作者(S)----------Author(s)----------
Saikat DebRoy <a href="mailto:<saikat@stat.wisc.edu>"><saikat@stat.wisc.edu></a>
参见----------See Also----------
externalAllocator-class for more details on how to use an allocator with objects from subclasses of "externalResource".
externalAllocator-class如何使用与"externalResource"子类对象的一个allocator的更多细节。
gcAllocator-class for an example of a simple subclass of "externalResource".
gcAllocator-class了"externalResource"简单的子类的一个例子。
setVirtualMethod for more on virtual methods.
setVirtualMethod虚方法。
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|