]> git.saurik.com Git - wxWidgets.git/blame - include/wx/serbase.h
wxTextFile::Type changed to ::wxTextFileType (portability)
[wxWidgets.git] / include / wx / serbase.h
CommitLineData
7a4b9130
GL
1/////////////////////////////////////////////////////////////////////////////
2// Name: serbase.h
3// Purpose: Serialization plug-ins
4// Author: Guilhem Lavaux
5// Modified by:
6// Created: July 1998
7// RCS-ID: $Id$
8// Copyright: (c) Guilhem Lavaux
9// Licence: wxWindows license
10/////////////////////////////////////////////////////////////////////////////
34138703
JS
11#ifndef _WX_WX_SERBASEH_H__
12#define _WX_WX_SERBASEH_H__
7a4b9130
GL
13
14#include <wx/dynlib.h>
15
16#define WXSERIAL(classname) classname##_Serialize
17
18class wxObject_Serialize : public wxObject {
19 DECLARE_DYNAMIC_CLASS(wxObject_Serialize)
20 public:
21 wxObject_Serialize() {}
22 virtual ~wxObject_Serialize() {}
23
24 void SetObject(wxObject *obj) { m_object = obj; }
25 wxObject *Object() { return m_object; }
26
27 protected:
28 wxObject *m_object;
29};
30
31
32#define DECLARE_SERIAL_CLASS(classname, parent) \
33class WXSERIAL(classname) : public WXSERIAL(parent) { \
34 DECLARE_DYNAMIC_CLASS(classname##_Serialize) \
35 public: \
36 WXSERIAL(classname)() { } \
37 virtual ~WXSERIAL(classname)() { } \
38\
39 virtual void StoreObject(wxObjectOutputStream& stream); \
40 virtual void LoadObject(wxObjectInputStream& stream); \
41};
42
43#define DECLARE_ALIAS_SERIAL_CLASS(classname, parent) \
44class WXSERIAL(classname) : public WXSERIAL(parent) { \
45 DECLARE_DYNAMIC_CLASS(classname##_Serialize) \
46 public: \
47 WXSERIAL(classname)() { } \
48 virtual ~WXSERIAL(classname)() { } \
49};
50
51#define IMPLEMENT_SERIAL_CLASS(classname, parent) \
52IMPLEMENT_DYNAMIC_CLASS(classname##_Serialize, parent##_Serialize)
53
54#define IMPLEMENT_ALIAS_SERIAL_CLASS(classname, parent) \
55IMPLEMENT_DYNAMIC_CLASS(classname##_Serialize, parent##_Serialize)
56
907789a0
RR
57DECLARE_SERIAL_CLASS(wxList, wxObject)
58DECLARE_SERIAL_CLASS(wxHashTable, wxObject)
59
7a4b9130 60#endif