pas
Public Member Functions | Public Attributes | List of all members
pas\Condition Class Reference
Inheritance diagram for pas\Condition:
Inheritance graph
[legend]

Public Member Functions

 __construct (callable $condition_function)
 
 isTrue ()
 
 add (callable $function, float $interval_seconds=0.001, bool $call_immediately=false)
 
 remove (Loop $loop)
 

Public Attributes

 $loops = []
 

Constructor & Destructor Documentation

◆ __construct()

pas\Condition::__construct ( callable  $condition_function)
Parameters
callable$condition_function
See also
pas::whileLoop()

Member Function Documentation

◆ add()

pas\Condition::add ( callable  $function,
float  $interval_seconds = 0.001,
bool  $call_immediately = false 
)

Registers a function to be called every X seconds.

Parameters
callable$function
float$interval_seconds
bool$call_immediatelyTrue if the function should be called immediately, false if the interval should expire first.
Returns
Loop

◆ isTrue()

pas\Condition::isTrue ( )

Reimplemented in pas\AlwaysTrueCondition.

◆ remove()

pas\Condition::remove ( Loop  $loop)

Removes the given loop.

Deprecated:
Use Loop::remove(), instead.
Parameters
Loop$loop
Returns
void

Member Data Documentation

◆ $loops

pas\Condition::$loops = []