File: H5DSetDescriptor-class.R

package info (click to toggle)
r-bioc-hdf5array 1.34.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,736 kB
  • sloc: ansic: 5,815; makefile: 4
file content (40 lines) | stat: -rw-r--r-- 1,100 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
### =========================================================================
### H5DSetDescriptor objects
### -------------------------------------------------------------------------


setClass("H5DSetDescriptor",
    representation(
        xp="externalptr"
    )
)

.destroy_H5DSetDescriptor_xp <- function(xp)
{
    .Call2("C_destroy_H5DSetDescriptor_xp", xp, PACKAGE="HDF5Array")
}

H5DSetDescriptor <- function(filepath, name, as.integer=FALSE)
{
    if (!is(filepath, "H5File")) {
        filepath <- H5File(filepath, .no_rhdf5_h5id=TRUE)
        on.exit(close(filepath))
    }
    name <- normarg_h5_name(name)

    xp <- .Call2("C_new_H5DSetDescriptor_xp", filepath, name, as.integer,
                                              PACKAGE="HDF5Array")
    reg.finalizer(xp, .destroy_H5DSetDescriptor_xp, onexit=TRUE)
    new2("H5DSetDescriptor", xp=xp)
}

destroy_H5DSetDescriptor <- function(x)
{
    invisible(.destroy_H5DSetDescriptor_xp(x@xp))
}

setMethod("show", "H5DSetDescriptor",
    function(object)
        .Call2("C_show_H5DSetDescriptor_xp", object@xp, PACKAGE="HDF5Array")
)