Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

Grule Class Reference

Base class for describing rules. More...

Inheritance diagram for Grule:

Inheritance graph
[legend]
Collaboration diagram for Grule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 __init__ (name, subsystem, category, enabled, continuous=False)
 _eval_ (value, attr, node)
 evaluate (value, attr, node=None)
 name ()
 subsystem ()
 category ()
 enabled ()
 enable ()
 disable ()
 reset (node=None)
 fire (node=None)
 fired (node=None)
 registerAction (action, method, sender=dispatcher.Any)
 setActions (actions)
 sendAction (action, sender, arguments, named)
 clearAllActions ()
 unregisterAction (action, method, sender=dispatcher.Any)

Detailed Description

Base class for describing rules.

Definition at line 21 of file gRule.py.


Member Function Documentation

__init__ name  ,
subsystem  ,
category  ,
enabled  ,
continuous  = False
 

Constructor.

Parameters:
name Rule name
subsystem Subsystem gGroup to which the rule belongs
category Category gGroup to which the rule belongs
enabled Flag indicating whether rule is enabled
continuous Flag indicating whether rule can fire repeatedly

_eval_ value  ,
attr  ,
node 
 

Base method called from derived classes. determine whether or not this rule can fire or not.

Returns:
a tuple containing the value of the test and whether the rule can fire or not.

Reimplemented in GruleLimit, and GruleAlarms.

category  ) 
 

Method for discovering this rule's category

Returns:
Rule's category.

clearAllActions  ) 
 

Forces all registered actions to be cleared. If this is not done and the scripts re-register their actions there may be extraneous rule action firings.

disable  ) 
 

Method used to disable evaluation of this rule

enable  ) 
 

Method used to enable evaluation of this rule

enabled  ) 
 

Method for discovering whether this rule is enabled

Returns:
Whether this rule is enabled or not.

evaluate value  ,
attr  ,
node  = None
 

This method is called to evaluate the rule on 'value'

Parameters:
value Value to be evaluated.
attr Attribute object whose value is being evaluated.
Returns:
Result of the evaluation, if any.

Reimplemented from GruleBase.

fire node  = None  ) 
 

Method used to tell the rule it has fired

fired node  = None  ) 
 

Method for discovering whether this rule has fired

Returns:
Whether this rule has fired or not

name  ) 
 

Method to retrieve the rule's name

Returns:
Rule's name.

registerAction action  ,
method  ,
sender  = dispatcher.Any
 

Associate and action with a user method, optionally specifying a sender. If a sender is not specified, the rule action may be fired for all registers which declare its rule to be the rule of this action. If an attribute is specified as the sender then only if the evaluation of that specific attribute causes the action to be fired the method will be called.

Parameters:
action A string that represents the action to be taken. This is specified under the <actions> tag in the schema/configuration.
method A user method visible to the current context.
sender Optional parameter that specifies the sender of the action registration. If specifed, only the sendAction requests which specify the same sender will be honored. Defaults to dispatcher.Any.

reset node  = None  ) 
 

Method used to reenable evaluation of this rule in the case of noncontinuous mode after it has been violated

sendAction action  ,
sender  ,
arguments  ,
named 
 

Called from the rule evaluation method to fire the appropriate alarm action.

Parameters:
action A string that represents the action to be taken. This is specified under the <actions> tag in the schema/configuration.
sender The sender that made the rule firing request. This is usually the attribute which is being evaluated.
*arguments An optional list of arguments which gets passed to the action method.
Returns:
A list of tuple pairs [(receiver, response), ... ]

setActions actions   ) 
 

Convenience method that gets called from the rule constructor that defines the action names (which is read from the schema/configuration).

Parameters:
actions A list containing the action names.

subsystem  ) 
 

Method for discovering this rule's subsystem

Returns:
Rule's subsystem.

unregisterAction action  ,
method  ,
sender  = dispatcher.Any
 

Reverse of registerAction, disassociates the action from the method.

Parameters:
action A string that represents the action to be taken. This is specified under the <actions> tag in the schema/configuration.
method A user method visible to the current context.
sender Optional parameter that specifies the sender of the action registration. If specifed, only the sendAction requests which specify the same sender will be honored. Defaults to dispatcher.Any.


The documentation for this class was generated from the following file:
Generated on Fri Jul 21 13:27:10 2006 for LATTE R04-12-00 by doxygen 1.4.3