BitwiseValue: Create enumeration value

BitwiseValueR Documentation

Create enumeration value

Description

These functions and related classes and methods are used to work

Usage

BitwiseValue(val, name = names(val),
               class = if (is(val, "BitwiseValue"))
                         class(val)
                       else "BitwiseValue",
             asVector = TRUE, S3 = FALSE,
             defValues = getEnumValues(class, name))

Arguments

val

the value which is to be converted to the appropriate enumerated class. This can be a numeric value or vector, or a character vector giving the names of the symbolic constants within the enumeration set.

name

the symbolic name(s) of the value(s) in val. This is the symbolic names from the enumeration set.

class

the name of the R class corresponding to the specific enumeration type.

asVector

a logical value controlling the case where there is more than one value in val and how we return it. We can process each value separately, or we can process them as a collection of values to be OR'ed together. If this is TRUE, then we OR the values together. Otherwise, we treat each value separtely and reutrn a list of these processed values.

S3

currently ignored. a logical value. This is no longer used as we use S4 classes for these enumeration types

defValues

the named vector of symbolic name and value pairs that define the enumeration collection. We try to find this based on the name of the class of val or class or from the names of the variables in val if this is a string.

Author(s)

Duncan Temple Lang

Examples

 # See tests/bits.R

omegahat/RAutoGenRunTime documentation built on Jan. 12, 2023, 9:19 p.m.