useDynLib(XVector)

import(methods)
import(BiocGenerics)
import(IRanges)

exportClasses(
    SharedVector, SharedVector_Pool,
    SharedRaw, SharedRaw_Pool,
    SharedInteger, SharedDouble,
    XVector, XRaw, XInteger, XDouble,
    GroupedIRanges, XVectorList, XRawList,
    XIntegerViews
)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S3 methods
###

S3method(duplicated, XRawList)

### We also export them thru the export() directive so that (a) they can be
### called directly, (b) tab-completion on the name of the generic shows them,
### and (c) methods() doesn't asterisk them.
export(
    duplicated.XRawList
)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S4 methods for generics not defined in XVector
###

exportMethods(
    length, 
    names, "names<-",
    "[", "[<-", "[[", "[[<-",
    elementLengths,

    as.vector, as.integer, as.numeric, as.raw, as.data.frame,
    toString,
    coerce,
    c,
    show,
    showAsCell,

    width,

    compare,
    "==", "!=", "<=",
    duplicated, match,
    order, rank, is.unsorted,

    rev, reverse,
    endoapply,

    Views,
    slice,
    viewMins, viewMaxs, viewSums, viewMeans,
    viewWhichMins, viewWhichMaxs,

    updateObject
)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export non-generic functions
###

export(
    SharedVector.compare,
    SharedVector.copy,
    SharedRaw,
    SharedRaw.readInts, SharedRaw.writeInts,
    SharedRaw.read, SharedRaw.write,
    SharedRaw.readComplexes,
    #SharedInteger, SharedInteger.read, SharedInteger.write,
    #SharedDouble, SharedDouble.read, SharedDouble.write,
    XRaw, XInteger, XDouble, XNumeric,
    XVectorList,
    unlist_list_of_XVectorList, unsplit_list_of_XVectorList
)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S4 generics defined in XVector + export corresponding methods
###

export(
    ## XVector-class.R:
    subseq, "subseq<-",

    ## compact-methods.R:
    xvcopy, compact,

    ## reverse-methods.R:
    reverse
)

### Exactly the same list as above.
exportMethods(
    subseq, "subseq<-",
    xvcopy, compact,
    reverse
)

