blob: 806d0173dd573949c003a1b5095fe843f5e38b82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
// file : examples/cxx/serializer/polymorphism/supermen-simpl-tiein.hxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain
#ifndef SUPERMEN_SIMPL_HXX
#define SUPERMEN_SIMPL_HXX
#include "supermen.hxx"
#include "supermen-sskel.hxx"
struct person_simpl: person_sskel
{
virtual void
pre (const person&);
virtual std::string
name ();
// Derived serializers need access to this variable.
//
public:
const person* person_;
};
struct superman_simpl: superman_sskel
{
superman_simpl ();
virtual bool
can_fly ();
const superman&
superman_ ();
private:
person_simpl base_impl_;
};
struct batman_simpl: batman_sskel
{
batman_simpl ();
virtual unsigned int
wing_span ();
const batman&
batman_ ();
private:
superman_simpl base_impl_;
};
struct supermen_simpl: supermen_sskel
{
virtual void
pre (const supermen&);
virtual bool
person_next ();
virtual const ::person&
person ();
private:
const supermen* supermen_;
supermen::const_iterator i_;
};
#endif // SUPERMEN_SIMPL_HXX
|