1998-08-04 13:49:26 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: serbase.h
|
|
|
|
// Purpose: Serialization plug-ins
|
|
|
|
// Author: Guilhem Lavaux
|
|
|
|
// Modified by:
|
|
|
|
// Created: July 1998
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Guilhem Lavaux
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_WX_SERBASEH_H__
|
|
|
|
#define _WX_WX_SERBASEH_H__
|
1998-08-04 13:49:26 -04:00
|
|
|
|
1999-08-20 18:52:21 -04:00
|
|
|
#include "wx/setup.h"
|
|
|
|
#include "wx/dynlib.h"
|
1998-08-04 13:49:26 -04:00
|
|
|
|
|
|
|
#define WXSERIAL(classname) classname##_Serialize
|
|
|
|
|
1999-01-31 13:47:10 -05:00
|
|
|
#if wxUSE_SERIAL
|
1998-08-04 13:49:26 -04:00
|
|
|
class wxObject_Serialize : public wxObject {
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxObject_Serialize)
|
|
|
|
public:
|
|
|
|
wxObject_Serialize() {}
|
|
|
|
virtual ~wxObject_Serialize() {}
|
|
|
|
|
|
|
|
void SetObject(wxObject *obj) { m_object = obj; }
|
|
|
|
wxObject *Object() { return m_object; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
wxObject *m_object;
|
|
|
|
};
|
1999-01-31 13:47:10 -05:00
|
|
|
#endif
|
|
|
|
// wxUSE_SERIAL
|
1998-08-04 13:49:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
#define DECLARE_SERIAL_CLASS(classname, parent) \
|
|
|
|
class WXSERIAL(classname) : public WXSERIAL(parent) { \
|
|
|
|
DECLARE_DYNAMIC_CLASS(classname##_Serialize) \
|
|
|
|
public: \
|
|
|
|
WXSERIAL(classname)() { } \
|
|
|
|
virtual ~WXSERIAL(classname)() { } \
|
|
|
|
\
|
|
|
|
virtual void StoreObject(wxObjectOutputStream& stream); \
|
|
|
|
virtual void LoadObject(wxObjectInputStream& stream); \
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DECLARE_ALIAS_SERIAL_CLASS(classname, parent) \
|
|
|
|
class WXSERIAL(classname) : public WXSERIAL(parent) { \
|
|
|
|
DECLARE_DYNAMIC_CLASS(classname##_Serialize) \
|
|
|
|
public: \
|
|
|
|
WXSERIAL(classname)() { } \
|
|
|
|
virtual ~WXSERIAL(classname)() { } \
|
|
|
|
};
|
|
|
|
|
|
|
|
#define IMPLEMENT_SERIAL_CLASS(classname, parent) \
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS(classname##_Serialize, parent##_Serialize)
|
|
|
|
|
|
|
|
#define IMPLEMENT_ALIAS_SERIAL_CLASS(classname, parent) \
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS(classname##_Serialize, parent##_Serialize)
|
|
|
|
|
1999-01-31 13:47:10 -05:00
|
|
|
#if wxUSE_SERIAL
|
1998-12-07 03:27:06 -05:00
|
|
|
DECLARE_SERIAL_CLASS(wxList, wxObject)
|
|
|
|
DECLARE_SERIAL_CLASS(wxHashTable, wxObject)
|
1999-01-31 13:47:10 -05:00
|
|
|
#endif
|
|
|
|
// wxUSE_SERIAL
|
1998-12-07 03:27:06 -05:00
|
|
|
|
1998-08-04 13:49:26 -04:00
|
|
|
#endif
|