MockLivestatus_StateMachine Class Reference

Local helper for MockLivestatus-library. More...

Public Member Functions

 __construct ()
 Initialize the state machine to generate a filter function.
 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.
 finish_And ()
 Finish up all posts in stack with an implicit And filter, so the stack is guaranteed to contain one element.
 get_stack ()
 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.

Detailed Description

Local helper for MockLivestatus-library.

Handles the stack for resolving livestatus filters on a given object.


Member Function Documentation

MockLivestatus_StateMachine::get_stack (  ) 

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_Exception 
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_Exception 
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_Exception 
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:
MockLivestatus_Exception 

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 19 Dec 2018 for ninja by  doxygen 1.6.1