Infinity.AclMask

Fields

Name

Type

Access

Description

mask

[int]

r/w

A 256 bit wide bitfield of Infinity.AclSetting s.

Methods

and1 (setting)

and_ (rhs)

clear ()

copy ()

empty ()

equal (rhs)

free ()

has (setting)

neg ()

or1 (setting)

or_ (rhs)

set1 (setting)

setv (settings)

Details

class Infinity.AclMask

This structure represents a mask of Infinity.AclSetting s, where each setting can be either turned on or off.

and1(setting)
Parameters:

setting (Infinity.AclSetting) – The setting to unset.

Returns:

The mask itself.

Return type:

Infinity.AclMask

Disables the bit corresponding to setting in self, leaving all other bits alone.

and_(rhs)
Parameters:

rhs (Infinity.AclMask) – Second mask.

Returns:

The output mask.

out:

Output mask.

Return type:

(Infinity.AclMask, out: Infinity.AclMask)

Computes the bitwise AND of self and rhs and writes the result to out. out is allowed to be equivalent to self and/or rhs.

clear()

Resets a mask so that all fields are zero.

copy()
Returns:

A new Infinity.AclMask. Free with Infinity.AclMask.free() when no longer needed.

Return type:

Infinity.AclMask

Creates a dynamically allocated copy of self. This function should not usually be used since masks can simply created on the stack and copied by value. This function is mainly meant for the boxed type definition and for language bindings.

empty()
Returns:

True if self has all fields zero, or False otherwies.

Return type:

bool

Checks whether the given mask is empty, i.e. all fields are set to zero.

equal(rhs)
Parameters:

rhs (Infinity.AclMask) – The second mask.

Returns:

True if self and rhs are equal or False otherwise.

Return type:

bool

Checks whether the two masks are equal.

free()

Releases a Infinity.AclMask that was created with Infinity.AclMask.copy().

has(setting)
Parameters:

setting (Infinity.AclSetting) – The setting to check.

Returns:

True if the bit corresponding to setting is set in self.

Return type:

bool

Returns True if the given mask has the bit which corresponds to setting set, or False otherwise.

neg()
Returns:

The output mask.

out:

The output mask.

Return type:

(Infinity.AclMask, out: Infinity.AclMask)

Negates the given mask bitwise and writes the result to out. The output mask is allowed to be equivalent to self itself.

or1(setting)
Parameters:

setting (Infinity.AclSetting) – The setting to add.

Returns:

The mask itself.

Return type:

Infinity.AclMask

Enables the bit corresponding to setting in self, leaving all other bits alone.

or_(rhs)
Parameters:

rhs (Infinity.AclMask) – Second mask.

Returns:

The output mask.

out:

Output mask.

Return type:

(Infinity.AclMask, out: Infinity.AclMask)

Computes the bitwise OR of self and rhs and writes the result to out. out is allowed to be equivalent to self and/or rhs.

set1(setting)
Parameters:

setting (Infinity.AclSetting) – The permission to set.

Returns:

The mask itself.

Return type:

Infinity.AclMask

Initializes self such that all permissions are off except the one corresponding to setting.

setv(settings)
Parameters:

settings ([Infinity.AclSetting]) – An array of Infinity.AclSetting s to set.

Returns:

The mask itself.

Return type:

Infinity.AclMask

Initializes self such that all permissions are off except the ones specified in the settings array.