File: getDefaultRegistry.R

package info (click to toggle)
r-cran-batchtools 0.9.15%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,416 kB
  • sloc: ansic: 172; sh: 156; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 602 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#' @title Get and Set the Default Registry
#' @description
#' \code{getDefaultRegistry} returns the registry currently set as default (or
#' stops with an exception if none is set). \code{setDefaultRegistry} sets
#' a registry as default.
#'
#' @template reg
#' @family Registry
#' @export
getDefaultRegistry = function() {
  if (is.null(batchtools$default.registry))
    stop("No default registry defined")
  batchtools$default.registry
}

#' @export
#' @rdname getDefaultRegistry
setDefaultRegistry = function(reg) {
  if (!is.null(reg))
    assertRegistry(reg)
  batchtools$default.registry = reg
}