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.
Methods
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
