defined for the objects of this class.
*/
template <class T>
- wxPersistentObject *Register(T *obj)
- {
- return Register(obj, wxCreatePersistentObject(obj));
- }
+ wxPersistentObject *Register(T *obj);
/**
Register an object with the manager.
@see SaveAndUnregister()
*/
void Save(void *obj);
-
+
/**
Restore the object properties previously saved by Save().
@true if the value was saved or @false if an error occurred.
*/
template <typename T>
- 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().
found or an error occurred.
*/
template <typename T>
- bool RestoreValue(const wxString& name, T *value)
- {
- return wxPersistenceManager::Get().RestoreValue(*this, name, value);
- }
+ bool RestoreValue(const wxString& name, T *value);
};
/**
framework.
@see @ref persistence_defining
+
+ @header{wx/persist.h}
*/
template <class T>
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 <class T>
+bool wxPersistentRegisterAndRestore(T *obj);