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
|
// file : odb/semantics/relational/column.cxx
// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
// license : GNU GPL v3; see accompanying LICENSE file
#include <cutl/compiler/type-info.hxx>
#include <odb/semantics/relational/column.hxx>
namespace semantics
{
namespace relational
{
column::
column (column const& c, uscope&, graph& g)
: unameable (c, g),
type_ (c.type_),
null_ (c.null_),
default__ (c.default__),
options_ (c.options_)
{
}
column::
column (xml::parser& p, uscope&, graph& g)
: unameable (p, g),
type_ (p.attribute ("type", string ())),
null_ (p.attribute<bool> ("null")),
default__ (p.attribute ("default", string ())),
options_ (p.attribute ("options", string ()))
{
p.content (xml::parser::empty);
}
column& column::
clone (uscope& s, graph& g) const
{
return g.new_node<column> (*this, s, g);
}
void column::
serialize (xml::serializer& s) const
{
s.start_element (xmlns, "column");
unameable::serialize_attributes (s);
s.attribute ("type", type ());
s.attribute ("null", null ()); // Output even if false.
if (!default_ ().empty ())
s.attribute ("default", default_ ());
if (!options ().empty ())
s.attribute ("options", options ());
s.end_element ();
}
// type info
//
namespace
{
struct init
{
init ()
{
unameable::parser_map_["column"] = &unameable::parser_impl<column>;
using compiler::type_info;
{
type_info ti (typeid (column));
ti.add_base (typeid (unameable));
insert (ti);
}
}
} init_;
}
}
}
|