aboutsummaryrefslogtreecommitdiff
path: root/examples/cxx/serializer/polyroot/supermen-simpl-tiein.cxx
blob: f72e0f4e7ff028b41affea793891c499d29169f9 (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
// file      : examples/cxx/serializer/polyroot/supermen-simpl-tiein.cxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain

#include "supermen-simpl-tiein.hxx"

//
//
void person_simpl::
pre (const person& p)
{
  person_ = &p;
}

std::string person_simpl::
name ()
{
  return person_->name ();
}

//
//
superman_simpl::
superman_simpl ()
    : superman_sskel (&base_impl_)
{
}

bool superman_simpl::
can_fly ()
{
  return superman_ ().can_fly ();
}

const superman& superman_simpl::
superman_ ()
{
  return *static_cast<const superman*> (base_impl_.person_);
}

//
//
batman_simpl::
batman_simpl ()
    : batman_sskel (&base_impl_)
{
}

unsigned int batman_simpl::
wing_span ()
{
  return batman_ ().wing_span ();
}

const batman& batman_simpl::
batman_ ()
{
  return static_cast<const batman&> (base_impl_.superman_ ());
}