Package mbdyn :: Module record :: Class RecordBase
[hide private]

Class RecordBase

source code

Known Subclasses:
Record

An object that have the values of its own attributes in a dictionary ParametersToSave. The goal is to select the attributes to save when pickling that object in a file. This object had to be developed, instead of using the default Python mechanism, because some of the attributes could not be pickled (like references to function or attributes from third part libraries -vtk, gtk-)

Instance Methods [hide private]
 
__init__(self) source code
 
_collect_own_para(self)
Loop in all the parameters of the class and set them in the para dictionary.
source code
 
set_own_para(self, para)
para is a ParametersToSave instance.
source code
 
collect_own_parameters(self)
Collect the object attributes in the para dictionary
source code
 
set_own_parameters(self, para)
The same as set_own_para.
source code
 
collect_parameters(self)
Collect the object attributes in the para dictionary.
source code
 
set_parameters(self, para)
Set the object attributes from the para dictionary.
source code
Method Details [hide private]

_collect_own_para(self)

source code 
Loop in all the parameters of the class and set them in the para dictionary. The keywords 'own' refers to the objects that can directly be pickled on the object ('self'). Others keywords may refer to others objects that will also have to collect their own para parameters.

set_own_para(self, para)

source code 
para is a ParametersToSave instance. The para received is loaded from a pickled file. Just the owned parameter names are set in that method, but para is a dictionary that can have others keys related to children.

set_own_parameters(self, para)

source code 
The same as set_own_para. This method is however tuned in the derived class Record.

collect_parameters(self)

source code 
Collect the object attributes in the para dictionary. For that object, just call collect_own_parameters but this method is tuned for many objects that need to call collect_parameters on some attributes

set_parameters(self, para)

source code 
Set the object attributes from the para dictionary. The same description as collect_parameters can be applied, instead that method is used for retrieving the object status.