StorageManager¶
-
class
StorageManager
(defaultVersion=1)¶ Define the way OpenTURNS’ objects are saved and reloaded.
- Available constructors:
StorageManager(defaultVersion=1)
- Parameters
- defaultVersionpositive int
Argument interpreted as the name of the object in a user point of view. This name is never used in another way than for user information. This name has no meaning to the platform.
See also
Notes
A StorageManager object can be used only through its derived class
XMLStorageManager
.Methods
finalize
(self, \*args)Do some administrative tasks after saving/reloading.
getClassName
(self)Accessor to the object’s name.
getDefaultStudyVersion
(self)Return the version of the study that the manager can read/write.
getStudy
(self)Get the study bound to the manager.
getStudyVersion
(self)Get the study version.
initialize
(self, \*args)Do some administrative tasks before saving/reloading.
isSavedObject
(self, id)Tell if an object is already saved.
load
(self, study)Reload the whole study from the medium.
markObjectAsSaved
(self, id)Tell that an object is saved.
read
(self)Read and create the internal representation.
save
(self, obj, label[, fromStudy])Save the object onto the medium.
setStudy
(self, p_study)Set the study bound to the manager.
setStudyVersion
(self, version)Set the study version.
write
(self)Write the internal representation.
-
__init__
(self, defaultVersion=1)¶ Initialize self. See help(type(self)) for accurate signature.
-
finalize
(self, \*args)¶ Do some administrative tasks after saving/reloading.
- Available usages
finalize(ot.SaveAction())
finalize(ot.LoadAction())
-
getClassName
(self)¶ Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
-
getDefaultStudyVersion
(self)¶ Return the version of the study that the manager can read/write.
- Returns
- versionpositive int
Version of the study that the manager can read/write.
-
getStudyVersion
(self)¶ Get the study version.
- Returns
- versionpositive int
Study version.
-
initialize
(self, \*args)¶ Do some administrative tasks before saving/reloading.
- Available usages
initialize(ot.SaveAction())
initialize(ot.LoadAction())
-
isSavedObject
(self, id)¶ Tell if an object is already saved.
- Returns
- isSavedbool
True if an object is already saved.
-
load
(self, study)¶ Reload the whole study from the medium.
- Parameters
- study
Study
The study to reload objects from.
- study
-
markObjectAsSaved
(self, id)¶ Tell that an object is saved.
- Parameters
- Idint
Internal identifier of the object.
-
read
(self)¶ Read and create the internal representation.
-
save
(self, obj, label, fromStudy=False)¶ Save the object onto the medium.
- Parameters
- object
PersistentObject
Object to be saved.
- labelstr
Name associate with the object to be saved.
- fromStudybool, optional
Flag telling if the object was explicitely put in the study or not. By default, it is equal to False.
- object
-
setStudy
(self, p_study)¶ Set the study bound to the manager.
- Parameters
- study
Study
Study bound to the manager.
- study
-
setStudyVersion
(self, version)¶ Set the study version.
- Parameters
- versionpositive int
Study version.
-
write
(self)¶ Write the internal representation.