summaryrefslogtreecommitdiff
path: root/xsd/examples/cxx/parser/library/library-pimpl.hxx
blob: 180070c1ada8383b4b7022ea43e2b44a5d798da5 (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
// file      : examples/cxx/parser/library/library-pimpl.hxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain

#ifndef LIBRARY_PIMPL_HXX
#define LIBRARY_PIMPL_HXX

#include "library.hxx"
#include "library-pskel.hxx"

namespace library
{
  //
  //
  struct isbn_pimpl: isbn_pskel, xml_schema::unsigned_int_pimpl
  {
    virtual isbn
    post_isbn ();
  };

  //
  //
  struct title_pimpl: title_pskel, xml_schema::string_pimpl
  {
    virtual void
    _pre ();

    virtual void
    lang (const std::string&);

    virtual title
    post_title ();

  private:
    title title_;
  };

  //
  //
  struct genre_pimpl: genre_pskel, xml_schema::string_pimpl
  {
    virtual genre
    post_genre ();
  };

  //
  //
  struct person_pimpl: virtual person_pskel
  {
    virtual void
    _pre ();

    virtual void
    name (const std::string&);

    virtual void
    born (const std::string&);

    virtual void
    died (const std::string&);

    virtual person
    post_person ();

  private:
    person person_;
  };

  //
  //
  struct author_pimpl: author_pskel, person_pimpl
  {
    virtual void
    _pre ();

    virtual void
    recommends (const std::string&);

    virtual author
    post_author ();

  private:
    author author_;
  };

  //
  //
  struct book_pimpl: book_pskel
  {
    virtual void
    _pre ();

    virtual void
    isbn (library::isbn);

    virtual void
    title (const library::title&);

    virtual void
    genre (library::genre);

    virtual void
    author (const library::author&);

    virtual void
    available (bool);

    virtual void
    id (const std::string&);

    virtual book
    post_book ();

  private:
    book book_;
  };

  //
  //
  struct catalog_pimpl: catalog_pskel
  {
    virtual void
    _pre ();

    virtual void
    book (const library::book&);

    virtual catalog
    post_catalog ();

  private:
    catalog catalog_;
  };
}

#endif // LIBRARY_PIMPL_HXX