## don't import(parallel), to avoid in-package name conflicts

import(methods)

importFrom(parallel, detectCores, makeCluster, nextRNGStream,
           splitIndices, clusterMap)

importFrom(BiocGenerics, lapply)

if (tools:::.OStype() == "unix") {
    importFrom(parallel, mccollect, mcparallel, mc.reset.stream)
}

importFrom(foreach, "%dopar%", foreach, getDoParName,
    getDoParRegistered, getDoParWorkers)

importFrom(BatchJobs, getConfig, loadConfig, setConfig, makeRegistry, 
           batchMap, submitJobs, waitForJobs, findErrors, findDone, 
           loadResults, getErrorMessages, killJobs)

importFrom(BBmisc, chunk)

importFrom(tools, SIGTERM)

exportClass(BiocParallelParam, MulticoreParam, SnowParam,
            DoparParam, SerialParam, BatchJobsParam)

export(MulticoreParam, SnowParam, DoparParam, SerialParam, BatchJobsParam,
    bplapply, bpvec, bpvectorize, bpmapply, bpaggregate, bpiterate,
    ## bp-controls
    bpworkers, bpbackend, "bpbackend<-",
    bpstart, bpstop, bpisup,
    ## schedule
    bpschedule,
    ## register
    register, registered, bpparam,
    ## error handlers
    bpresume, bplasterror,
    ## helpers
    multicoreWorkers, snowWorkers)

exportMethods(show)
