Class cveitem
About :
This class defines nodes of the graph which will have states. The "states" attribute refers a dictionary which defines the states of the current object. For instance no mechanism rules the states that are associated with the object unless a classifier is defined. Then the states are the instance of attributes of the referenced classifier. states : dictionary of state value classifier : definition of states that must be associated with the item. When classifier is defined, states become attributes of an object instance of the classifier.
Functions
Function | summury |
---|---|
__init__(self, classifier=None) | |
init_from_class(self, classifier=None) | This new version creates deep_copy of attributes (more…) |
init_methods(self, classifier) | |
exported(self) | |
update_class_version(self, classifier) | |
update_to_last_version(self) | |
attribute_insert(self, attribute, item, i=-1) | Description: Insert an item into a specific state. (more…) |
attribute_remove(self, attribute, item) | insert an item from a specific state (more…) |
attribute_set(self, attribute, value) | set a specific state value (more…) |
insert(self, attribute, item, i=-1, atkey=None) | Description: (more…) |
remove(self, attribute, item, atkey=None) | |
set(self, attribute, value, atkey=None) | |
get_state(self, state) | |
get_state_value(self, state) | |
set_state_value(self, state, value, waitfeedback=True, newitem=False, local=True, sendtoserver=True) | |
set_state(self, state, value, waitfeedback=True, newitem=False, local=True, sendtoserver=True) | |
state_insert(self, state, item, i=-1, waitfeedback=True, newitem=False, local=True) | A new Insert Method which do both local and remote propagation of event (more…) |
state_remove(self, state, item, waitfeedback=True, stillExist=False, local=True) | A new Remove Method which do both local and remote propagation of event (more…) |
is_instance(self, classifier) | return True if the current cveitem is an instance of the classifier (more…) |
add_callback(self, event, state, callback) | add a callback to be processed when an event appear on a given state (more…) |
remove_callback(self, event, state, callback) | remove a callback to be processed when an event appear on a given state (more…) |
get_states_of_child(self, child) | returns the list of states including a given child (more…) |
get_callbacks(self, event, state) | get all callbacks concerning a state for a given event including supertypes callbacks (more…) |
at_init_event(self) | execute callbacks when a state value is set’ (more…) |
at_set_event(self, state, olditem) | execute callbacks when a state value is set’ (more…) |
at_insert_event(self, state, sitem, index, newitem) | execute callbacks when an item is inserted in state’ (more…) |
at_remove_event(self, state, sitem, uid, stillexist) | execute callbacks when an item is removed from state’ (more…) |
Methods desciption :
init
def __init__(self, classifier=None)
init_from_class
def init_from_class(self, classifier=None)
This new version creates deep_copy of attributes
init_methods
def init_methods(self, classifier)
exported
def exported(self)
update_class_version
def update_class_version(self, classifier)
update_to_last_version
def update_to_last_version(self)
attribute_insert
def attribute_insert(self, attribute, item, i=-1)
Description: Insert an item into a specific state. Parameters: - attribute (string): Where insert item.
- item (vitem): the object to insert.
- i (int): the position to insert. if -1, last.
attribute_remove
def attribute_remove(self, attribute, item)
insert an item from a specific state
attribute_set
def attribute_set(self, attribute, value)
set a specific state value
insert
def insert(self, attribute, item, i=-1, atkey=None)
Description: Parameters: - attribute (string): Where insert the item.
- item (vitem): the object to insert.
- i (int): the position to insert. if -1, last.
- atkey (string) Return:
remove
def remove(self, attribute, item, atkey=None)
set
def set(self, attribute, value, atkey=None)
get_state
def get_state(self, state)
get_state_value
def get_state_value(self, state)
set_state_value
def set_state_value(self, state, value, waitfeedback=True, newitem=False, local=True, sendtoserver=True)
set_state
def set_state(self, state, value, waitfeedback=True, newitem=False, local=True, sendtoserver=True)
state_insert
def state_insert(self, state, item, i=-1, waitfeedback=True, newitem=False, local=True)
A new Insert Method which do both local and remote propagation of event
state_remove
def state_remove(self, state, item, waitfeedback=True, stillExist=False, local=True)
A new Remove Method which do both local and remote propagation of event
is_instance
def is_instance(self, classifier)
return True if the current cveitem is an instance of the classifier
add_callback
def add_callback(self, event, state, callback)
add a callback to be processed when an event appear on a given state
- → state (string) : state name
- → event (string) : ‘set’,’ins’,’del’ : stands for the type of event (set state value, insert or del subite
- → callback : function to execute for a set event : prototype def on_set_cb(self,state,olditem) for a ins event : prototype def on_ins_cb(self,state,sitem,index,newitem) for a del event : prototype def on_del_cb(self,state,sitem,suid,stillexist)
remove_callback
def remove_callback(self, event, state, callback)
remove a callback to be processed when an event appear on a given state
- → state (string) : state name
- → event (string) : ‘set’,’ins’,’del’ : stands for the type of event (set state value, insert or del subite
- → callback : function to execute
get_states_of_child
def get_states_of_child(self, child)
returns the list of states including a given child
- → : child
- ← : a set of states (strings)
get_callbacks
def get_callbacks(self, event, state)
get all callbacks concerning a state for a given event including supertypes callbacks
at_init_event
def at_init_event(self)
execute callbacks when a state value is set’
at_set_event
def at_set_event(self, state, olditem)
execute callbacks when a state value is set’
at_insert_event
def at_insert_event(self, state, sitem, index, newitem)
execute callbacks when an item is inserted in state’
at_remove_event
def at_remove_event(self, state, sitem, uid, stillexist)
execute callbacks when an item is removed from state’