Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <mitkPersistenceService.h>
Public Member Functions | |
PersistenceService () | |
~PersistenceService () | |
std::string | GetDefaultPersistenceFile () override |
mitk::PropertyList::Pointer | GetPropertyList (std::string &id, bool *existed=0) override |
bool | RemovePropertyList (std::string &id) override |
std::string | GetPersistenceNodePropertyName () override |
DataStorage::SetOfObjects::Pointer | GetDataNodes (DataStorage *ds=0) override |
bool | Save (const std::string &fileName="", bool appendChanges=false) override |
bool | Load (const std::string &fileName="", bool enforeReload=true) override |
void | SetAutoLoadAndSave (bool autoLoadAndSave) override |
bool | GetAutoLoadAndSave () override |
void | AddPropertyListReplacedObserver (PropertyListReplacedObserver *observer) override |
void | RemovePropertyListReplacedObserver (PropertyListReplacedObserver *observer) override |
bool | RestorePropertyListsFromPersistentDataNodes (const DataStorage *storage) override |
void | Clear () |
void | Unitialize () |
Public Member Functions inherited from mitk::IPersistenceService | |
virtual | ~IPersistenceService () |
Static Public Member Functions | |
static std::string | GetPersistencePropertyName () |
static std::string | GetPersistencePropertyListName () |
static void | LoadModule () |
static us::ModuleContext * | GetModuleContext () |
implementation of the IPersistenceService
Definition at line 30 of file mitkPersistenceService.h.
mitk::PersistenceService::PersistenceService | ( | ) |
Definition at line 35 of file mitkPersistenceService.cpp.
mitk::PersistenceService::~PersistenceService | ( | ) |
Definition at line 46 of file mitkPersistenceService.cpp.
References MITK_DEBUG.
|
overridevirtual |
adds a observer which is informed if a propertyList gets replaced during a Load() procedure
Implements mitk::IPersistenceService.
Definition at line 270 of file mitkPersistenceService.cpp.
void mitk::PersistenceService::Clear | ( | ) |
Definition at line 39 of file mitkPersistenceService.cpp.
|
overridevirtual |
Implements mitk::IPersistenceService.
Definition at line 377 of file mitkPersistenceService.cpp.
|
overridevirtual |
Creates a vector of DataNodes that contain all PropertyLists. Additionally, the DataNodes will have the property name set to the PropertyList's id and a BoolProperty equal to GetPersistenceNodePropertyName() set to true. If ds is set the returned DataNodes will also be added to that DS.
Implements mitk::IPersistenceService.
Definition at line 298 of file mitkPersistenceService.cpp.
References mitk::DataStorage::Add(), MITK_DEBUG, mitk::New(), and mitk::DataNode::New().
|
overridevirtual |
Get the default name of the PersistenceFile (the one that is loaded at startup)
Implements mitk::IPersistenceService.
Definition at line 51 of file mitkPersistenceService.cpp.
References us::GetModuleContext().
|
static |
Definition at line 287 of file mitkPersistenceService.cpp.
References us::GetModuleContext().
|
overridevirtual |
Implements mitk::IPersistenceService.
Definition at line 292 of file mitkPersistenceService.cpp.
|
static |
Definition at line 30 of file mitkPersistenceService.cpp.
|
static |
Definition at line 25 of file mitkPersistenceService.cpp.
|
overridevirtual |
If PropertyList with the given id exists, returns it. Otherwise creates a new one and returns it. If id is empty a UUID will be created and set on the variable If existed was passed, it is true if the PropertyList with that id existed, false otherwise
Implements mitk::IPersistenceService.
Definition at line 65 of file mitkPersistenceService.cpp.
References mitk::UIDGenerator::GetUID(), and mitk::PropertyList::New().
|
overridevirtual |
Load PropertyLists from fileName. If fileName is empty, a special file in the users home directory will be used. If enforeReload is false, the service will take care of modified time flags, i.e. it will not load a file that was loaded before and did not change in the meantime or that was modified by the service itself ATTENTION: If there are PropertyLists with the same id contained in the file, existing PropertyLists will be overwritten!
Implements mitk::IPersistenceService.
Definition at line 194 of file mitkPersistenceService.cpp.
References GetDefaultPersistenceFile(), MITK_DEBUG, and mitk::SceneIO::New().
|
static |
Definition at line 282 of file mitkPersistenceService.cpp.
References MITK_DEBUG.
|
overridevirtual |
removes the PropertyList with the given id
Implements mitk::IPersistenceService.
Definition at line 383 of file mitkPersistenceService.cpp.
|
overridevirtual |
removes a specific observer
Implements mitk::IPersistenceService.
Definition at line 276 of file mitkPersistenceService.cpp.
|
overridevirtual |
Searches storage for persistent DataNodes, extracts and inserts the appended property lists to this service
Implements mitk::IPersistenceService.
Definition at line 324 of file mitkPersistenceService.cpp.
References mitk::DataStorage::GetAll(), mitk::DataNode::GetBoolProperty(), mitk::DataNode::GetName(), mitk::DataNode::GetPropertyList(), and MITK_DEBUG.
|
overridevirtual |
Save the current PropertyLists to fileName. If fileName is empty, a special file in the users home directory will be used. if appendchanges is true, the file will not replaced but first loaded, then overwritten and then replaced
Implements mitk::IPersistenceService.
Definition at line 108 of file mitkPersistenceService.cpp.
References GetDefaultPersistenceFile(), MITK_ERROR, mitk::SceneIO::New(), and mitk::StandaloneDataStorage::New().
|
overridevirtual |
Using SetAutoLoadAndSave(true) will cause the service to load/save the property lists at application start/stop.
Implements mitk::IPersistenceService.
Definition at line 259 of file mitkPersistenceService.cpp.
void mitk::PersistenceService::Unitialize | ( | ) |
Definition at line 422 of file mitkPersistenceService.cpp.