Skip to contents

This function defines an R6 class called "Base". The class has a single public method called "initialize", which creates a new instance of the class and sets its "parent" attribute to the value passed in as an argument (or NULL if no argument is provided).

If a global option called "epi.log" is set to TRUE, all functions defined in the class are decorated with logging functionality. The class also has a single active field called "parent", which can be used to get or set the value of the "parent" attribute.

Value

An R6 class object.

Active bindings

parent

(R6Class)
Parent object of the object.

Methods

Public methods


Method new()

Creates a new instance of this R6 class.

Usage

Base$new(parent = NULL)

Arguments

parent

(R6Class)
Identifier of the parent object.


Method clone()

The objects of this class are cloneable with this method.

Usage

Base$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Create a new instance of the Base class with no parent
my_base <- Base$new()
#> Error in eval(expr, envir, enclos): object 'Base' not found

# Create a new instance of the Base class with a parent
my_child_base <- Base$new(parent = my_base)
#> Error in eval(expr, envir, enclos): object 'Base' not found

# Get the value of the "parent" attribute for an instance of the Base class
my_base$parent()
#> Error in eval(expr, envir, enclos): object 'my_base' not found

# Set the value of the "parent" attribute for an instance of the Base class
my_base$parent(my_child_base)
#> Error in eval(expr, envir, enclos): object 'my_base' not found