similar to: Destructor for S4 objects?

Displaying 20 results from an estimated 20000 matches similar to: "Destructor for S4 objects?"

2009 Jul 21
2
destructor for S4 class objects in analogy to C++
Hi all, I'm wondering if there is a way to define a destructor function (to free memory) for S4 class objects in analogy to C++? rm() combined with gc() does not seem to be a good idea (Chambers, 2008). So could it be done on the C/C++ level or is it even already available in the "internals"? Many thanks, David [[alternative HTML version deleted]]
2007 Jan 17
3
R.oo Destructors
Has anyone figured out how to create a destructor in R.oo? How I'd like to use it: I have an object which opens a connection thru RODBC (held as a private member) It would be nice if the connection closes automatically (inside the destructor) when an object gets gc()'ed. Thanks in advance. Regards, Ken BTW, a >BIG< thanks to Henrik Bengtsson for creating the R.oo package! Lucky
2008 Feb 23
1
Standard method for S4 object
Hi the list, I am defining a new class MyClass. Shortly, I will submit a package with it. Before, I would like to know if there is a kind of "non official list" of what method a new S4 object have. More precisely, personnaly, I use 'print', 'summary' and 'plot' a lot. So for my new class, I define these 3 methods. Is there some other method that a R user can
2012 Sep 21
2
[LLVMdev] Clang API parsing of the destructor
I am using the clang API (version 3.1 - trunk 153913) to compile some very simple code as follows class MyClass { ~MyClass() ; }; MyClass::~MyClass() { } int main() { return 0; } My problem is that I get the error message: test.cpp:20:10: error: destructor cannot have a return type MyClass::~MyClass() If someone can point me to the right direction that would be great. It compiles fine if
2012 Sep 21
0
[LLVMdev] Clang API parsing of the destructor
On Fri, Sep 21, 2012 at 12:22 PM, Kamaljit Lall <klall at factset.com> wrote: > I am using the clang API (version 3.1 - trunk 153913) to compile some > very simple code as follows**** > > class MyClass > { > ~MyClass() ; > > }; > > MyClass::~MyClass() > { > > } > > int main() > { > return 0; > } **** > > My problem is that
2012 May 07
4
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
For the reasons listed in my 03-May-2012 email, I am proposing a new llvm/Support class for using in writing binary files: /// OutputBuffer - This interface provides simple way to create an in-memory /// buffer which when done will be written to a file. During the lifetime of /// these objects, the content or existence of the specified file is undefined. /// That is, creating an OutputBuffer
2011 Oct 16
2
[LLVMdev] Static destructor problem with recent HEAD
I recently updated my version of LLVM from revision 140108 to 142082, and several things broke, most of which were easily fixed. However, I'm now getting a "pure virtual method called" exception (__cxa_pure_virtual) which I wasn't getting before. This is happening in the destructor of a statically-initialized object. (More precisely, it's blowing up in a BumpPtrAllocator,
2012 May 24
1
[LLVMdev] JITEventListener destructor location
Hello, I've recently finished moving a cross-platform project to LLVM 3.0 and now transitioning to 3.1. One of the things I've hit is on OS X, I have linker errors involving JITEventListener and I've noticed if I move the JITEventListener destructor out of JIT.cpp and into JITEventListener.h (like other functions of JITEventListener), the linker is much happier. I'd like to push
2011 Oct 16
0
[LLVMdev] Static destructor problem with recent HEAD
On Sat, Oct 15, 2011 at 9:20 PM, Talin <viridia at gmail.com> wrote: > I recently updated my version of LLVM from revision 140108 to 142082, and > several things broke, most of which were easily fixed. However, I'm now > getting a "pure virtual method called" exception (__cxa_pure_virtual) which > I wasn't getting before. This is happening in the destructor of
2010 Jan 24
1
recursive data-structures in R - An S4 "node" Class
Hi, In an effort to learn S4 objects, I am trying to port some c based tree code to S4 object. My immediate goal is to use .Call() interface for calling my c code from R. My long term goal is to understand how to write c structs that follows S4 classes and not the other-way-around. The c struct for the node is : typedef struct node{ int c; int n; inode **nodes; //length = n } inode; I
2012 May 08
0
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
FWIW, I'd be interested in working on the Windows implementation. I've been knee-deep in *nixes lately and wouldn't mind the refresher. :) Gordon Keiser Software Development Engineer Arxan Technologies w:+1.765.889.4756 gkeiser at arxan.com www.arxan.com<http://www.arxan.com/> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Nick
2012 May 08
0
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
On Mon, May 7, 2012 at 12:56 PM, Nick Kledzik <kledzik at apple.com> wrote: > For the reasons listed in my 03-May-2012 email, I am proposing a new > llvm/Support class for using in writing binary files: > > /// OutputBuffer - This interface provides simple way to create an in-memory > /// buffer which when done will be written to a file. During the lifetime > of >
2006 Sep 03
1
Internal flag for S4 objects
A recent revision (svn version 39077) has introduced an internal flag (a bit in the C structure) that is turned on by the code that generates objects from an S4 class. There are corresponding tests for an S4 object, isS4() in R and IS_S4_OBJECT() in C. These are fast and reliable, and should replace any heuristic tests previously used. The tests are not currently used widely, but in the
2012 May 08
1
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
On May 8, 2012, at 3:52 AM, Gordon Keiser wrote: > FWIW, I'd be interested in working on the Windows implementation. I've been knee-deep in *nixes lately and wouldn't mind the refresher. J Cool! Does my proposed interface make sense to implement on top of Windows APIs? -Nick > > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
2012 May 08
3
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
On May 8, 2012, at 3:41 PM, Michael Spencer wrote: > On Mon, May 7, 2012 at 12:56 PM, Nick Kledzik <kledzik at apple.com> wrote: >> For the reasons listed in my 03-May-2012 email, I am proposing a new >> llvm/Support class for using in writing binary files: >> >> /// OutputBuffer - This interface provides simple way to create an in-memory >> /// buffer
2009 Jan 23
1
"for" loop wiht S4 Objects
Hi all, I'm working with the S4-Class system and I have a little problem with Implementing iteration functionality in my S4 class but it don't work: > setClass("foo",representation(bar="list")) > x <- new("foo",bar=list(1,2,3)) >for(e in x) cat(e) invalid type/length (S4/1) in vector allocation But when I extend from a
2009 Jun 02
1
S4 Objects [Sec=Unclassified]
I am new to R programming but have dived into a medium sized modelling software development project. Having come from a Java OO background I have a couple of questions about S4 objects. Is there a way to make S4 slots (and methods) private and hence force the use of accessor methods? Is there a straight-forward way to implement pass-by-reference for method parameters? I am currently
2006 Feb 06
1
match gets confused by S4 objects
If one accidentally calls match(x, obj), where obj is any S4 instance, the result is NA. I was expecting an error because, in general, if a match method is not defined for a particular S4 class, I don't know what a reasonable default could be. Specifically, here's what I see setClass("FOO", representation(a="numeric")) foo <- new("FOO", a=10)
2011 Jan 13
1
s3 methods on S4 objects
I have J Chambers wonderful text ( Software for data Analysis) and I've been trying my hand at some very routine S4 OOP development. One of the things I was trying to do was to create some very basic S4 classes. The first was simply a class that had a data.frame as part of its representation. setClass("df",representation(dirframe="data.frame")) The object basically
2019 Nov 01
3
R C api for 'inherits' S3 and S4 objects
Dear R developers, Motivated by discussion about checking inheritance of S3 and S4 objects (in head matrix/array topic) I would light to shed some light on a minor gap about that matter in R C API. Currently we are able to check inheritance for S3 class objects from C in a robust way (no allocation, thread safe). This is unfortunately not possible for S4 classes. I would kindly request new