declareSignal: Declaring a signal field

View source: R/utils.R

declareSignalR Documentation

Declaring a signal field

Description

Declares a signal field that is lazily populated when the field is first accessed. This avoids the need for the constructor/initializer to explicitly create the signal.

Usage

declareSignal(expr)

Arguments

expr

The expression that names the signal and specifies its signature. See the example.

Value

A list of field definitions, suitable for passing to setRefClass.

Author(s)

Michael Lawrence

Examples

setRefClass("Dataset", fields = c(elements = "list",
declareSignal(elementsChanged(which))))

objectSignals documentation built on April 5, 2022, 9:05 a.m.