MockLivestatus_StateMachine Class Reference
Local helper for MockLivestatus-library.
More...
Public Member Functions |
| __construct ($object) |
| Initialize the state machine, with an empty stack and a object to work with.
|
| process_Filter ($args) |
| Process a "Filter: args" line, and push the reuslt to the stack.
|
| process_And ($args) |
| Process a "And: N" livestatus filter line, manipulates the stack accordingly.
|
| process_Or ($args) |
| Process a "Or: N" livestatus filter line, manipulates the stack accordingly.
|
| process_Negate ($args) |
| Process a "Negate:" livestatus filter line, negates the top of the stack.
|
| get_result () |
| Get the result from the stack, as anding all the lines that is left.
|
Data Fields |
| $stack |
| Stack for the state of the state machine.
|
| $object |
| The object to use as source for tests.
|
Detailed Description
Local helper for MockLivestatus-library.
Handles the stack for resolving livestatus filters on a given object.
Constructor & Destructor Documentation
MockLivestatus_StateMachine::__construct |
( |
$ |
object |
) |
|
Initialize the state machine, with an empty stack and a object to work with.
- Parameters:
-
| $object | an array with retrieved parameters |
Member Function Documentation
MockLivestatus_StateMachine::get_result |
( |
|
) |
|
Get the result from the stack, as anding all the lines that is left.
- Returns:
- boolean
MockLivestatus_StateMachine::process_And |
( |
$ |
args |
) |
|
Process a "And: N" livestatus filter line, manipulates the stack accordingly.
- Parameters:
-
| $args | the "N" part of the filter line, expected to be numeric |
- Exceptions:
-
MockLivestatus_StateMachine::process_Filter |
( |
$ |
args |
) |
|
Process a "Filter: args" line, and push the reuslt to the stack.
- Parameters:
-
| $args | the "args" part of the filter line |
- Exceptions:
-
MockLivestatus_StateMachine::process_Negate |
( |
$ |
args |
) |
|
Process a "Negate:" livestatus filter line, negates the top of the stack.
- Parameters:
-
| $args | an empty string (tested to be empty) |
- Exceptions:
-
MockLivestatus_StateMachine::process_Or |
( |
$ |
args |
) |
|
Process a "Or: N" livestatus filter line, manipulates the stack accordingly.
- Parameters:
-
| $args | the "N" part of the filter line, expected to be numeric |
- Exceptions:
-
The documentation for this class was generated from the following file: