Class cveclassifier
Functions
Function | summury |
---|---|
__init__(self, name=’class’, itemtype=’cveitem’, default_name=None, rep=None) | This class is a node which describes a complex classifier in a meta model defintion (more…) |
set_documentation(self, filename) | set the filename for documenting the class (more…) |
set_role(self, role=None) | |
set_default_name(self, name=None) | |
set_abstract(self, abstract=True) | |
set_enumerated(self, enumerated=True) | |
specialisation(self, *cl) | |
exported(self) | |
add_attribute(self, name=’attribute_new’, classifier=None, cardmin=1, cardmax=1, mandatory=True, default_value=None, specialised=False) | |
get_attribute(self, atname) | Get attribute of a class by name (including inherited attributes) (more…) |
get_attributes(self) | Get the list of attributes associated to a classifier (more…) |
add_method(self, name, filename, comment=’’) | Add a single method to a classifier (more…) |
add_methods(self, filename, *args) | Add a list of methods to a classifier (more…) |
is_specialisation(self, classifier) | |
new(self) | |
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_callbacks_(self, event, state, L=[]) | get all callbacks concerning a state for a given event including supertypes callbacks (more…) |
get_callbacks(self, event, state) |
Methods desciption :
init
def __init__(self, name='class', itemtype='cveitem', default_name=None, rep=None)
This class is a node which describes a complex classifier in a meta model defintion name : name of the classifier documentation : vfile identifying a markdown documentation attributes : list of cveattribute specialised_attributes : specialised attributes supertypes : list of supertype for inheritance abstract : boolean to define if the class is abstract or not enumerated : boolean to define that a deep copy of an object containing an instance of this classifier does not create a new instance : keep the same object objectconcerned : if object is concerned else device are concerned default : string representation of the default value for non ‘states’ attributes
set_documentation
def set_documentation(self, filename)
set the filename for documenting the class the file is supposed to be a markdown file to be included in another one. Then titles should be indexed at level two
- → filename:
set_role
def set_role(self, role=None)
set_default_name
def set_default_name(self, name=None)
set_abstract
def set_abstract(self, abstract=True)
set_enumerated
def set_enumerated(self, enumerated=True)
specialisation
def specialisation(self, *cl)
exported
def exported(self)
add_attribute
def add_attribute(self, name='attribute_new', classifier=None, cardmin=1, cardmax=1, mandatory=True, default_value=None, specialised=False)
get_attribute
def get_attribute(self, atname)
Get attribute of a class by name (including inherited attributes)
- name of the search attribute
- returns the attribute definition
get_attributes
def get_attributes(self)
Get the list of attributes associated to a classifier
- returns a list of attributes
add_method
def add_method(self, name, filename, comment='')
Add a single method to a classifier
- → name: method name
- → filename: file where the method is scripted. The functions may have a signature with almost one parameter which is used as self attribute.
- → comment: ‘ a short comment’
add_methods
def add_methods(self, filename, *args)
Add a list of methods to a classifier
- → filename: the python file where the method are scripted
- → args: the names of functions to be used as method. The functions may have a signature with almost one parameter which is used as self attribute
is_specialisation
def is_specialisation(self, classifier)
new
def new(self)
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(instance,state,value) for a ins event : prototype def on_ins_cb(instance,state,sitem,newitem) for a del event : prototype def on_del_cb(instance,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_callbacks_
def get_callbacks_(self, event, state, L=[])
get all callbacks concerning a state for a given event including supertypes callbacks
get_callbacks
def get_callbacks(self, event, state)