Public Member Functions | Protected Attributes

Bitmask Class Reference

List of all members.

Public Member Functions

 __construct ($flags=null, $value=null)
 __set ($bit, $on)
 __get ($bit)
 __isset ($flag)
 __tostring ()

Protected Attributes

 $flags = array()
 $full = 0
 $value = 0

Detailed Description

Definition at line 19 of file bitmask.php.


Constructor & Destructor Documentation

Bitmask::__construct ( flags = null,
value = null 
)

Constructor. Takes an optional array parameter of bit flags to mask on.

Parameters:
array $flags An array of flag names
integer $value (optional) a combined bitmask value
Exceptions:
\InvalidArgumentException 

Definition at line 33 of file bitmask.php.


Member Function Documentation

Bitmask::__get ( bit  ) 

Magic getter method for flag status

Parameters:
int $bit representing the mask bit to test
Exceptions:
\InvalidArgumentException 
Returns:
boolean

Definition at line 154 of file bitmask.php.

Bitmask::__isset ( flag  ) 

Magic check-whether-flag-exists method

Parameters:
string $flag of flag name
Returns:
boolean

Definition at line 177 of file bitmask.php.

Bitmask::__set ( bit,
on 
)

Magic setter method for flag values.

Parameters:
string $bit The name of the Bitmask part to set
mixed $on The value to set the bit to
Exceptions:
\InvalidArgumentException 
Returns:
mixed The set value

Definition at line 80 of file bitmask.php.

Referenced by __construct().

Bitmask::__tostring (  ) 

Convert this Bitmask into a string, based ont he flags that are set

Returns:
string Converted bitmask value

Definition at line 186 of file bitmask.php.


The documentation for this class was generated from the following file: