aboutsummaryrefslogtreecommitdiff
path: root/examples/cxx/serializer/library/library-simpl-tiein.hxx
blob: 6b74fd027712c67e5fe9fd440bf4c9d1947593f6 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// file      : examples/cxx/serializer/library/library-simpl-tiein.hxx
// copyright : not copyrighted - public domain

#ifndef LIBRARY_SIMPL_HXX
#define LIBRARY_SIMPL_HXX

#include "library.hxx"
#include "library-sskel.hxx"

namespace library
{
  //
  //
  struct isbn_simpl: isbn_sskel
  {
    isbn_simpl ();

    virtual void
    pre (isbn);

  private:
    xml_schema::unsigned_int_simpl base_impl_;
  };

  //
  //
  struct title_simpl: title_sskel
  {
    title_simpl ();

    virtual void
    pre (const title&);

    virtual bool
    lang_present ();

    virtual std::string
    lang ();

  private:
    xml_schema::string_simpl base_impl_;
    const title* title_;
  };

  //
  //
  struct genre_simpl: genre_sskel
  {
    genre_simpl ();

    virtual void
    pre (genre);

  private:
    xml_schema::string_simpl base_impl_;
  };

  //
  //
  struct person_simpl: person_sskel
  {
    virtual void
    pre (const person&);

    virtual std::string
    name ();

    virtual std::string
    born ();

    virtual bool
    died_present ();

    virtual std::string
    died ();

  private:
    const person* person_;
  };

  //
  //
  struct author_simpl: author_sskel
  {
    author_simpl ();

    virtual void
    pre (const author&);

    virtual bool
    recommends_present ();

    virtual std::string
    recommends ();

  private:
    person_simpl base_impl_;
    const author* author_;
  };

  //
  //
  struct book_simpl: book_sskel
  {
    virtual void
    pre (const book&);

    virtual library::isbn
    isbn ();

    virtual const library::title&
    title ();

    virtual library::genre
    genre ();

    virtual bool
    author_next ();

    virtual const library::author&
    author ();

    virtual bool
    available ();

    virtual std::string
    id ();

  private:
    const book* book_;
    book::authors::const_iterator ai_;
  };

  //
  //
  struct catalog_simpl: catalog_sskel
  {
    virtual void
    pre (const catalog&);

    virtual bool
    book_next ();

    virtual const library::book&
    book ();

  private:
    const catalog* catalog_;
    catalog::const_iterator ci_;
  };
}

#endif // LIBRARY_SIMPL_HXX