X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0fa541e8706f74887efeba9e475eae618873da2a..f1ddb476b1d90a1e24f904eb74462f5dc5165442:/interface/wx/persist.h diff --git a/interface/wx/persist.h b/interface/wx/persist.h index beae4c785f..bb0dc58c31 100644 --- a/interface/wx/persist.h +++ b/interface/wx/persist.h @@ -62,10 +62,7 @@ public: defined for the objects of this class. */ template - wxPersistentObject *Register(T *obj) - { - return Register(obj, wxCreatePersistentObject(obj)); - } + wxPersistentObject *Register(T *obj); /** Register an object with the manager. @@ -117,7 +114,7 @@ public: @see SaveAndUnregister() */ void Save(void *obj); - + /** Restore the object properties previously saved by Save(). @@ -233,10 +230,7 @@ protected: @true if the value was saved or @false if an error occurred. */ template - bool SaveValue(const wxString& name, T value) const - { - return wxPersistenceManager::Get().SaveValue(*this, name, value); - } + bool SaveValue(const wxString& name, T value) const; /** Restore the value saved by Save(). @@ -251,10 +245,7 @@ protected: found or an error occurred. */ template - bool RestoreValue(const wxString& name, T *value) - { - return wxPersistenceManager::Get().RestoreValue(*this, name, value); - } + bool RestoreValue(const wxString& name, T *value); }; /** @@ -268,6 +259,23 @@ protected: framework. @see @ref persistence_defining + + @header{wx/persist.h} */ template wxPersistentObject *wxCreatePersistentObject(T *obj); + +/** + A shorter synonym for wxPersistenceManager::RegisterAndRestore(). + + This function simply calls wxPersistenceManager::RegisterAndRestore() but + using it results in slightly shorter code as it calls + wxPersistenceManager::Get() internally. + + For the implementation reasons, this function @em mucst be used instead of + the template method when using Microsoft Visual C++ 6 compiler. + + @header{wx/persist.h} + */ +template +bool wxPersistentRegisterAndRestore(T *obj);